aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/utils/src')
-rw-r--r--packages/utils/src/abi_encoder/data_type.ts4
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types.ts3
2 files changed, 4 insertions, 3 deletions
diff --git a/packages/utils/src/abi_encoder/data_type.ts b/packages/utils/src/abi_encoder/data_type.ts
index 21c08ef54..243b221ef 100644
--- a/packages/utils/src/abi_encoder/data_type.ts
+++ b/packages/utils/src/abi_encoder/data_type.ts
@@ -40,8 +40,8 @@ export abstract class DataType {
return calldataHex;
}
- public decode(calldata: string, rules?: DecodingRules): any {
- const rawCalldata = new RawCalldata(calldata, true); // @TODO Sohuld not hardcode false here
+ public decode(calldata: string, rules?: DecodingRules, hasSelector: boolean = false): any {
+ const rawCalldata = new RawCalldata(calldata, hasSelector);
const rules_ = rules ? rules : DataType.DEFAULT_DECODING_RULES;
const value = this.generateValue(rawCalldata, rules_);
return value;
diff --git a/packages/utils/src/abi_encoder/evm_data_types.ts b/packages/utils/src/abi_encoder/evm_data_types.ts
index b6a62a5d4..2895ee00f 100644
--- a/packages/utils/src/abi_encoder/evm_data_types.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types.ts
@@ -515,7 +515,8 @@ export class Method extends MemberDataType {
if (!calldata.startsWith(this.selector)) {
throw new Error(`Tried to decode calldata, but it was missing the function selector. Expected '${this.selector}'.`);
}
- const value = super.decode(calldata, rules);
+ const hasSelector = true;
+ const value = super.decode(calldata, rules, hasSelector);
return value;
}