diff --git a/go.mod b/go.mod index 12e6fd7..8eb2ec2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/dipdup-io/starknet-indexer go 1.21 require ( - github.com/dipdup-io/starknet-go-api v0.0.0-20230912113406-c699cdbd6582 + github.com/dipdup-io/starknet-go-api v0.0.0-20231129152335-877b37e86db0 github.com/dipdup-io/workerpool v0.0.4 github.com/dipdup-net/go-lib v0.3.3 github.com/dipdup-net/indexer-sdk v0.0.4 diff --git a/go.sum b/go.sum index a6101dd..dacb61c 100644 --- a/go.sum +++ b/go.sum @@ -36,6 +36,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw= github.com/dipdup-io/starknet-go-api v0.0.0-20230912113406-c699cdbd6582 h1:Mo5MDCO9Bqdj62Jrn1at/f44KOOzWCPF+ohu5jqlb4o= github.com/dipdup-io/starknet-go-api v0.0.0-20230912113406-c699cdbd6582/go.mod h1:Pbi1et2OC3ZWhzv/76nDg5C0/v4Mrj7YWkZPXcZFys0= +github.com/dipdup-io/starknet-go-api v0.0.0-20231129152335-877b37e86db0 h1:kN20Ov/U90n3qRQti4PfjkWWlnoU/XcfTPmlAJvjRc8= +github.com/dipdup-io/starknet-go-api v0.0.0-20231129152335-877b37e86db0/go.mod h1:Pbi1et2OC3ZWhzv/76nDg5C0/v4Mrj7YWkZPXcZFys0= github.com/dipdup-io/workerpool v0.0.4 h1:m58fuFY3VIPRc+trWpjw2Lsm4FvIgtjP/4VRe79r+/s= github.com/dipdup-io/workerpool v0.0.4/go.mod h1:m6YMqx7M+fORTyabHD/auKymBRpbDax0t1aPZ1i7GZA= github.com/dipdup-net/go-lib v0.3.3 h1:vTUI+sT4L+x+eiMf712Cg8EtlqUCMiN6M3vcNaPlCw8= diff --git a/pkg/indexer/decode/decode.go b/pkg/indexer/decode/decode.go index 25abb04..6a7be18 100644 --- a/pkg/indexer/decode/decode.go +++ b/pkg/indexer/decode/decode.go @@ -22,7 +22,7 @@ func CalldataBySelector(contractAbi abi.Abi, selector []byte, calldata []string) return nil, function.Name, nil } - parsed, err := abi.DecodeFunctionCallData(calldata, *function, contractAbi.Structs) + parsed, err := abi.DecodeFunctionCallData(calldata, *function, contractAbi.Structs, contractAbi.Enums) return parsed, function.Name, err } @@ -36,7 +36,7 @@ func CalldataForConstructor(classAbi abi.Abi, calldata []string) (map[string]any } } - return abi.DecodeFunctionCallData(calldata, *function, classAbi.Structs) + return abi.DecodeFunctionCallData(calldata, *function, classAbi.Structs, classAbi.Enums) } // CalldataForL1Handler - @@ -50,7 +50,7 @@ func CalldataForL1Handler(contractAbi abi.Abi, selector []byte, calldata []strin return nil, function.Name, nil } - parsed, err := abi.DecodeFunctionCallData(calldata, *function, contractAbi.Structs) + parsed, err := abi.DecodeFunctionCallData(calldata, *function, contractAbi.Structs, contractAbi.Enums) return parsed, function.Name, err } @@ -64,7 +64,7 @@ func Event(contractAbi abi.Abi, keys []string, data []string) (map[string]any, s if !ok { return nil, "", nil } - parsed, err := abi.DecodeEventData(data, *event, contractAbi.Structs) + parsed, err := abi.DecodeEventData(data, *event, contractAbi.Structs, contractAbi.Enums) return parsed, event.Name, err } @@ -79,7 +79,7 @@ func ResultForFunction(contractAbi abi.Abi, data []string, selector []byte) (map return nil, errors.Wrapf(ErrUnknownSelector, "function %x", selector) } - return abi.DecodeFunctionResult(data, *function, contractAbi.Structs) + return abi.DecodeFunctionResult(data, *function, contractAbi.Structs, contractAbi.Enums) } // ResultForL1Handler - @@ -93,7 +93,7 @@ func ResultForL1Handler(contractAbi abi.Abi, data []string, selector []byte) (ma return nil, errors.Wrapf(ErrUnknownSelector, "l1_handler %x", selector) } - return abi.DecodeFunctionResult(data, *function, contractAbi.Structs) + return abi.DecodeFunctionResult(data, *function, contractAbi.Structs, contractAbi.Enums) } // ResultForConstructor - @@ -107,7 +107,7 @@ func ResultForConstructor(contractAbi abi.Abi, data []string, selector []byte) ( return nil, errors.Wrapf(ErrUnknownSelector, "constructor %x", selector) } - return abi.DecodeFunctionResult(data, *function, contractAbi.Structs) + return abi.DecodeFunctionResult(data, *function, contractAbi.Structs, contractAbi.Enums) } // Result -