diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..df418a6 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,31 @@ +--- +run: + timeout: 5m + skip-dirs: + - test + + +linters: + enable: + - whitespace + - gosec + - gci + - misspell + - gomnd + - gofmt + - goimports + - revive + - unconvert + +linters-settings: + revive: + rules: + - name: exported + arguments: + - disableStutteringCheck + +issues: + include: + - EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments + - EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments + diff --git a/ethtxmanager/ethtxmanager.go b/ethtxmanager/ethtxmanager.go index d799589..0600f63 100644 --- a/ethtxmanager/ethtxmanager.go +++ b/ethtxmanager/ethtxmanager.go @@ -124,7 +124,7 @@ func pendingL1Txs(URL string, from common.Address, httpHeaders map[string]string return nil, fmt.Errorf("failed to convert gasPrice %v to big.Int", tx.GasPrice) } - data := common.Hex2Bytes(string(tx.Data)) + data := common.Hex2Bytes(tx.Data) mTx := monitoredTx{ ID: types.NewTx(&types.LegacyTx{To: &to, Nonce: nonce.Uint64(), Value: value, Data: data}).Hash(), diff --git a/ethtxmanager/memstorage.go b/ethtxmanager/memstorage.go index 8a50326..bbf9d0f 100644 --- a/ethtxmanager/memstorage.go +++ b/ethtxmanager/memstorage.go @@ -19,7 +19,7 @@ type MemStorage struct { PersistenceFilename string } -// NewPostgresStorage creates a new instance of storage +// NewMemStorage creates a new instance of storage func NewMemStorage(persistenceFilename string) *MemStorage { transactions := make(map[common.Hash]monitoredTx) if persistenceFilename != "" { diff --git a/ethtxmanager/rpcclient.go b/ethtxmanager/rpcclient.go index 9a14595..74f9dd4 100644 --- a/ethtxmanager/rpcclient.go +++ b/ethtxmanager/rpcclient.go @@ -25,12 +25,12 @@ type Response struct { Result json.RawMessage } -// Client defines typed wrappers for the zkEVM RPC API. +// RPCClient is a client to interact with the Ethereum JSON RPC Server type RPCClient struct { url string } -// NewClient creates an instance of client +// NewRPCClient creates an instance of client func NewRPCClient(url string) *RPCClient { return &RPCClient{ url: url,