Skip to content

Commit

Permalink
Added additional ink_env types
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjan Zijderveld committed Dec 22, 2020
1 parent 33e9b4f commit 9f8a706
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions substrateinterface/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,25 @@ def get_type_string_for_metadata_type(self, type_id: int) -> str:

arg_type = self.metadata_dict['types'][type_id - 1]

# Predefined types defined in crate ink_env
if 'path' in arg_type:

if arg_type['path'] == ['ink_env', 'types', 'AccountId']:
return 'AccountId'

if arg_type['path'] == ['ink_env', 'types', 'Hash']:
return 'Hash'

if arg_type['path'] == ['ink_env', 'types', 'Balance']:
return 'Balance'

if arg_type['path'] == ['ink_env', 'types', 'Timestamp']:
return 'Moment'

if arg_type['path'] == ['ink_env', 'types', 'BlockNumber']:
return 'BlockNumber'

# RUST primitives
if 'primitive' in arg_type['def']:
return arg_type['def']['primitive']

Expand Down

0 comments on commit 9f8a706

Please sign in to comment.