Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make function comments match function names #270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion node/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (p *clientProvider) getOrRegisterGroup(group Group) *util.ConcurrentMap {
return v.(*util.ConcurrentMap)
}

// getRouteGroup get custom route group for specific route key
// GetRouteGroup get custom route group for specific route key
func (p *clientProvider) GetRouteGroup(key string) (grp Group, ok bool) {
if p.db == nil { // db not available
return grp, false
Expand Down
2 changes: 1 addition & 1 deletion store/mysql/store_log_big_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func newBigContractLogStore(
}
}

// preparePartition create new contract log partitions for the big contract if necessary.
// preparePartitions create new contract log partitions for the big contract if necessary.
// Also migrates event logs from address indexed table to separate contract specified log table
// for the initial partitioning.
func (bcls *bigContractLogStore) preparePartitions(dataSlice []*store.EpochData) (map[uint64]bnPartition, error) {
Expand Down
2 changes: 1 addition & 1 deletion store/mysql/store_map_epoch_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (e2bms *epochBlockMapStore) MaxEpoch() (uint64, bool, error) {
return uint64(maxEpoch.Int64), true, nil
}

// blockRange returns the spanning block range for the give epoch.
// BlockRange returns the spanning block range for the give epoch.
func (e2bms *epochBlockMapStore) BlockRange(epoch uint64) (citypes.RangeUint64, bool, error) {
var e2bmap epochBlockMap
var bnr citypes.RangeUint64
Expand Down
2 changes: 1 addition & 1 deletion util/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func GetSummaryOfBlock(block *types.Block) *types.BlockSummary {
return &summary
}

// StripLogExtraFields strips extra unnecessary fields from logs to comply with fullnode rpc
// StripLogExtraFieldsForRPC strips extra unnecessary fields from logs to comply with fullnode rpc
func StripLogExtraFieldsForRPC(logs []types.Log) {
for i := 0; i < len(logs); i++ {
log := &logs[i]
Expand Down
2 changes: 1 addition & 1 deletion virtualfilter/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type filterCursor struct {
type filterChainIterator func(node *filterNode, forkPoint bool) bool

type filterChain interface {
// snapshots filter cursor of the latest node
// snapshotLatestCursor filter cursor of the latest node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshot?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think snapshotLatestCursor might be more appropriate.

What do you think? Do I need to roll back the changes here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it should be a verb here to state the function of snapshotLatestCursor() method. Otherwise, it won't work semantically.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing it to snapshotLatestCursor returns the filter cursor of the latest node in the filter chain

snapshotLatestCursor() filterCursor
// check if node is on the chain
hasNode(node *filterNode) bool
Expand Down