-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from multiversx/update-23-2
Implement explicit enums
- Loading branch information
Showing
9 changed files
with
175 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import Any | ||
|
||
from multiversx_sdk.abi.string_value import StringValue | ||
|
||
|
||
class ExplicitEnumValue(StringValue): | ||
def __init__(self, value: str = "") -> None: | ||
self.value = value | ||
|
||
def __eq__(self, other: Any) -> bool: | ||
return isinstance(other, ExplicitEnumValue) and self.value == other.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,93 @@ | ||
{ | ||
"name": "Artificial", | ||
"constructor": { | ||
"inputs": [ | ||
{ | ||
"name": "a", | ||
"type": "utf-8 string" | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
"upgradeConstructor": { | ||
"inputs": [ | ||
{ | ||
"name": "a", | ||
"type": "u8" | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
"endpoints": [ | ||
{ | ||
"name": "blue", | ||
"mutability": "readonly", | ||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
"type": "optional<multi<TokenIdentifier,u64,BigUint>>" | ||
} | ||
] | ||
"name": "Artificial", | ||
"constructor": { | ||
"inputs": [ | ||
{ | ||
"name": "a", | ||
"type": "utf-8 string" | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
"upgradeConstructor": { | ||
"inputs": [ | ||
{ | ||
"name": "a", | ||
"type": "u8" | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
{ | ||
"name": "yellow", | ||
"mutability": "mutable", | ||
"inputs": [ | ||
"endpoints": [ | ||
{ | ||
"name": "value", | ||
"type": "multi<u32, bytes, bool>" | ||
"name": "blue", | ||
"mutability": "readonly", | ||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
"type": "optional<multi<TokenIdentifier,u64,BigUint>>" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "yellow", | ||
"mutability": "mutable", | ||
"inputs": [ | ||
{ | ||
"name": "value", | ||
"type": "multi<u32, bytes, bool>" | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
{ | ||
"name": "orange", | ||
"mutability": "mutable", | ||
"inputs": [ | ||
{ | ||
"name": "value", | ||
"type": "EgldOrEsdtTokenIdentifier" | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
{ | ||
"name": "green", | ||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
"type": "OperationCompletionStatus" | ||
} | ||
] | ||
} | ||
], | ||
"types": { | ||
"OperationCompletionStatus": { | ||
"type": "explicit-enum", | ||
"variants": [ | ||
{ | ||
"docs": ["indicates that operation was completed"], | ||
"name": "completed" | ||
}, | ||
{ | ||
"docs": [ | ||
"indicates that operation was interrupted prematurely, due to low gas" | ||
], | ||
"name": "interrupted" | ||
} | ||
] | ||
} | ||
], | ||
"outputs": [] | ||
}, | ||
{ | ||
"name": "orange", | ||
"mutability": "mutable", | ||
"inputs": [ | ||
"events": [ | ||
{ | ||
"name": "value", | ||
"type": "EgldOrEsdtTokenIdentifier" | ||
"identifier": "firstEvent", | ||
"inputs": [ | ||
{ | ||
"name": "result", | ||
"type": "BigUint", | ||
"indexed": true | ||
} | ||
] | ||
} | ||
], | ||
"outputs": [] | ||
} | ||
], | ||
"types": {}, | ||
"events": [ | ||
{ | ||
"identifier": "firstEvent", | ||
"inputs": [ | ||
{ | ||
"name": "result", | ||
"type": "BigUint", | ||
"indexed": true | ||
} | ||
] | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters