All 71 tests passing. Both for function encoding and individual types.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user