From 2fe30bb1845e320d91995a6169aa232da470811a Mon Sep 17 00:00:00 2001 From: stringscut Date: Thu, 18 Dec 2025 14:22:48 +0800 Subject: [PATCH] chore: fix some comments to improve readability Signed-off-by: stringscut --- cmd/ethkit/block.go | 2 +- ethcoder/abi_helpers.go | 4 ++-- ethcoder/abi_sig_parser.go | 4 ++-- ethmonitor/ethmonitor.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/ethkit/block.go b/cmd/ethkit/block.go index d5849ec2..59430e19 100644 --- a/cmd/ethkit/block.go +++ b/cmd/ethkit/block.go @@ -33,7 +33,7 @@ func init() { type block struct { } -// NewBlockCommand returns a new build command to retrieve a block. +// NewBlockCmd returns a new build command to retrieve a block. func NewBlockCmd() *cobra.Command { c := &block{} cmd := &cobra.Command{ diff --git a/ethcoder/abi_helpers.go b/ethcoder/abi_helpers.go index 77683de2..c781ec94 100644 --- a/ethcoder/abi_helpers.go +++ b/ethcoder/abi_helpers.go @@ -98,7 +98,7 @@ func ABIMarshalStringValues(argTypes []string, input []byte) ([]string, error) { return StringifyValues(values) } -// AbiUnmarshalStringValuesAny will take an array of ethereum types as string values, and decode +// ABIUnmarshalStringValuesAny will take an array of ethereum types as string values, and decode // the string values to runtime objects. This allows simple string value input from an app // or user, and converts them to the appropriate runtime objects. // @@ -563,7 +563,7 @@ func ABIUnmarshalStringValuesAny(argTypes []string, stringValues []any) ([]any, return values, nil } -// AbiUnmarshalStringValues will take an array of ethereum types as string values, and decode +// ABIUnmarshalStringValues will take an array of ethereum types as string values, and decode // the string values to runtime objects. This allows simple string value input from an app // or user, and converts them to the appropriate runtime objects. // diff --git a/ethcoder/abi_sig_parser.go b/ethcoder/abi_sig_parser.go index d24ecf46..e42e6f32 100644 --- a/ethcoder/abi_sig_parser.go +++ b/ethcoder/abi_sig_parser.go @@ -82,8 +82,8 @@ type abiSignatureTree struct { right []abiSignatureTree } -// parseEventArgs parses the event arguments and returns a tree structure -// ie. "address indexed from, address indexed to, uint256 value". +// parseABISignatureArgs parses the event arguments and returns a tree structure +// e.g. "address indexed from, address indexed to, uint256 value". func parseABISignatureArgs(eventArgs string, iteration int) (abiSignatureTree, error) { args := strings.TrimSpace(eventArgs) // if iteration == 0 { diff --git a/ethmonitor/ethmonitor.go b/ethmonitor/ethmonitor.go index 1c967c0a..0217cec7 100644 --- a/ethmonitor/ethmonitor.go +++ b/ethmonitor/ethmonitor.go @@ -1133,8 +1133,8 @@ func (m *Monitor) GetBlock(blockHash common.Hash) *Block { return m.chain.GetBlock(blockHash) } -// GetBlock will search within the retained canonical chain for the txn hash. Passing `optMined true` -// will only return transaction which have not been removed from the chain via a reorg. +// GetTransaction will search within the retained canonical chain for the given transaction hash +// and will only return transactions which have not been removed from the chain via a reorg. func (m *Monitor) GetTransaction(txnHash common.Hash) (*types.Transaction, Event) { return m.chain.GetTransaction(txnHash) }