Skip to content

Commit

Permalink
Merge pull request #137 from davesque/byte-alias
Browse files Browse the repository at this point in the history
Add alias "byte" for "bytes1"
  • Loading branch information
davesque committed Dec 10, 2019
2 parents 610f38a + c923c78 commit 2f8a0b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions eth_abi/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ def validate(self):
'fixed': 'fixed128x18',
'ufixed': 'ufixed128x18',
'function': 'bytes24',
'byte': 'bytes1',
}

TYPE_ALIAS_RE = re.compile(r'\b({})\b'.format(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_valid_abi_types(type_str):
'type_str, normalized',
tuple(TYPE_ALIASES.items()) + (
('(int,uint,fixed,ufixed)', '(int256,uint256,fixed128x18,ufixed128x18)'),
('(function,function,function)', '(bytes24,bytes24,bytes24)'),
('(function,function,(function,byte))', '(bytes24,bytes24,(bytes24,bytes1))'),
),
)
def test_normalize(type_str, normalized):
Expand Down

0 comments on commit 2f8a0b3

Please sign in to comment.