Skip to content

Commit

Permalink
feat: make int types capitalized
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Nov 13, 2023
1 parent 3e9febf commit 4b3d2a5
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/contract_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,45 +766,45 @@ function findCase(name: string) {
}

const PRIMITIVE_DEFINITONS = {
u64: {
U64: {
type: 'integer',
minimum: 0,
maximum: 18446744073709551615
},
i64: {
I64: {
type: 'integer',
minimum: -9223372036854775808,
maximum: 9223372036854775807
},
u32: {
U32: {
type: 'integer',
minimum: 0,
maximum: 4294967295
},
i32: {
I32: {
type: 'integer',
minimum: -2147483648,
maximum: 2147483647
},
u128: {
U128: {
type: 'string',
pattern: '^[0-9]+$',
minLength: 1,
maxLength: 39 // 128-bit max value has 39 digits
},
i128: {
I128: {
type: 'string',
pattern: '^-?[0-9]+$',
minLength: 1,
maxLength: 40 // Includes additional digit for the potential '-'
},
u256: {
U256: {
type: 'string',
pattern: '^[0-9]+$',
minLength: 1,
maxLength: 78 // 256-bit max value has 78 digits
},
i256: {
I256: {
type: 'string',
pattern: '^-?[0-9]+$',
minLength: 1,
Expand Down Expand Up @@ -853,19 +853,19 @@ function typeRef(typeDef: xdr.ScSpecTypeDef): object {
break;
}
case xdr.ScSpecType.scSpecTypeU32().value: {
ref = 'u32';
ref = 'U32';
break;
}
case xdr.ScSpecType.scSpecTypeI32().value: {
ref = 'i32';
ref = 'I32';
break;
}
case xdr.ScSpecType.scSpecTypeU64().value: {
ref = 'u64';
ref = 'U64';
break;
}
case xdr.ScSpecType.scSpecTypeI64().value: {
ref = 'i64';
ref = 'I64';
break;
}
case xdr.ScSpecType.scSpecTypeTimepoint().value: {
Expand All @@ -879,19 +879,19 @@ function typeRef(typeDef: xdr.ScSpecTypeDef): object {
break;
}
case xdr.ScSpecType.scSpecTypeU128().value: {
ref = 'u128';
ref = 'U128';
break;
}
case xdr.ScSpecType.scSpecTypeI128().value: {
ref = 'i128';
ref = 'I128';
break;
}
case xdr.ScSpecType.scSpecTypeU256().value: {
ref = 'u256';
ref = 'U256';
break;
}
case xdr.ScSpecType.scSpecTypeI256().value: {
ref = 'i256';
ref = 'I256';
break;
}
case xdr.ScSpecType.scSpecTypeBytes().value: {
Expand Down

0 comments on commit 4b3d2a5

Please sign in to comment.