From e5ea6d2bb28a919e2ad7042a789e552e6d3e4e22 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 04:59:17 +0000 Subject: [PATCH] Fix lint errors: range over integer, missing types in composite literals, unused variable, and unused parameter Co-Authored-By: Chris Li --- core/taskengine/engine_test.go | 2 +- pkg/erc4337/preset/builder.go | 4 ++-- pkg/erc4337/userop/object.go | 20 ++++++++++---------- pkg/graphql/graphql.go | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/taskengine/engine_test.go b/core/taskengine/engine_test.go index 92753dc9..5444ba25 100644 --- a/core/taskengine/engine_test.go +++ b/core/taskengine/engine_test.go @@ -145,7 +145,7 @@ func TestListTasksPagination(t *testing.T) { tr2.SmartWalletAddress = "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c" n.CreateTask(testutil.TestUser1(), tr2) - for i := range 20 { + for i := 0; i < 20; i++ { tr3 := testutil.RestTask() // salt 6789 tr3.Name = fmt.Sprintf("t3_%d", i) diff --git a/pkg/erc4337/preset/builder.go b/pkg/erc4337/preset/builder.go index 75a3bdb8..040b205a 100644 --- a/pkg/erc4337/preset/builder.go +++ b/pkg/erc4337/preset/builder.go @@ -316,8 +316,8 @@ func BuildUserOpWithPaymaster( // Define ABI types for timestamps uint48Type, _ := abi.NewType("uint48", "", nil) timestampArgs := abi.Arguments{ - {Type: uint48Type}, - {Type: uint48Type}, + abi.Argument{Type: uint48Type}, + abi.Argument{Type: uint48Type}, } // Pack timestamps according to ABI encoding rules diff --git a/pkg/erc4337/userop/object.go b/pkg/erc4337/userop/object.go index 5c658d90..765e5d8f 100644 --- a/pkg/erc4337/userop/object.go +++ b/pkg/erc4337/userop/object.go @@ -159,16 +159,16 @@ func (op *UserOperation) Pack() []byte { // PackForSignature returns a minimal message of the userOp. This can be used to generate a userOpHash. func (op *UserOperation) PackForSignature() []byte { args := abi.Arguments{ - {Name: "sender", Type: address}, - {Name: "nonce", Type: uint256}, - {Name: "hashInitCode", Type: bytes32}, - {Name: "hashCallData", Type: bytes32}, - {Name: "callGasLimit", Type: uint256}, - {Name: "verificationGasLimit", Type: uint256}, - {Name: "preVerificationGas", Type: uint256}, - {Name: "maxFeePerGas", Type: uint256}, - {Name: "maxPriorityFeePerGas", Type: uint256}, - {Name: "hashPaymasterAndData", Type: bytes32}, + abi.Argument{Name: "sender", Type: address}, + abi.Argument{Name: "nonce", Type: uint256}, + abi.Argument{Name: "hashInitCode", Type: bytes32}, + abi.Argument{Name: "hashCallData", Type: bytes32}, + abi.Argument{Name: "callGasLimit", Type: uint256}, + abi.Argument{Name: "verificationGasLimit", Type: uint256}, + abi.Argument{Name: "preVerificationGas", Type: uint256}, + abi.Argument{Name: "maxFeePerGas", Type: uint256}, + abi.Argument{Name: "maxPriorityFeePerGas", Type: uint256}, + abi.Argument{Name: "hashPaymasterAndData", Type: bytes32}, } packed, _ := args.Pack( op.Sender, diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 2bd67a0a..1382a46b 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -25,7 +25,7 @@ func NewClient(endpoint string, log func(s string), opts ...ClientOption) (*Clie client := &Client{ endpoint: endpoint, restyClient: resty.New(), - Log: func(string) {}, + Log: log, } for _, opt := range opts {