Skip to content

Commit 9e9d3f5

Browse files
committed
Add more basic encodable types
Fixes #10
1 parent dc756e9 commit 9e9d3f5

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

index.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,25 @@ function generatePacketHashGetters (types, typeName, fields, packetHashGetters:
174174
}
175175

176176
function getEncodedValueFor (field) {
177-
const basicEncodableTypes = ['address', 'bool', 'bytes32', 'int', 'uint', 'uint256'];
177+
const basicEncodableTypes = [
178+
'address',
179+
'bool',
180+
'string',
181+
'int',
182+
'uint',
183+
'int8',
184+
'uint8',
185+
'int16',
186+
'uint16',
187+
'int256',
188+
'uint256',
189+
'bytes32',
190+
'bytes16',
191+
'bytes8',
192+
'bytes4',
193+
'bytes2',
194+
'bytes1',
195+
];
178196
const hashedTypes = ['bytes', 'string'];
179197
if (basicEncodableTypes.includes(field.type)) {
180198
return `_input.${field.name}`;

0 commit comments

Comments
 (0)