Skip to content

Commit

Permalink
Replace BigInt object with {iu}128
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Nov 20, 2022
1 parent 1a76201 commit bd02341
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions Stellar-contract.x
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ enum SCObjectType
SCO_MAP = 1,
SCO_U64 = 2,
SCO_I64 = 3,
SCO_BYTES = 4,
SCO_BIG_INT = 5,
SCO_CONTRACT_CODE = 6,
SCO_ACCOUNT_ID = 7
SCO_U128 = 4,
SCO_I128 = 5,
SCO_BYTES = 6,
SCO_CONTRACT_CODE = 7,
SCO_ACCOUNT_ID = 8

// TODO: add more
};
Expand All @@ -232,22 +233,6 @@ const SCVAL_LIMIT = 256000;
typedef SCVal SCVec<SCVAL_LIMIT>;
typedef SCMapEntry SCMap<SCVAL_LIMIT>;

enum SCNumSign
{
NEGATIVE = -1,
ZERO = 0,
POSITIVE = 1
};

union SCBigInt switch (SCNumSign sign)
{
case ZERO:
void;
case POSITIVE:
case NEGATIVE:
opaque magnitude<256000>;
};

enum SCContractCodeType
{
SCCONTRACT_CODE_WASM_REF = 0,
Expand All @@ -272,10 +257,14 @@ case SCO_U64:
uint64 u64;
case SCO_I64:
int64 i64;
case SCO_U128:
uint64 u128_lo64;
uint64 u128_hi64;
case SCO_I128:
uint64 i128_lo64;
uint64 i128_hi64;
case SCO_BYTES:
opaque bin<SCVAL_LIMIT>;
case SCO_BIG_INT:
SCBigInt bigInt;
case SCO_CONTRACT_CODE:
SCContractCode contractCode;
case SCO_ACCOUNT_ID:
Expand Down

0 comments on commit bd02341

Please sign in to comment.