Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cha committed Aug 6, 2024
1 parent e840148 commit 142375b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion executor/batch/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (bs *BatchSubmitter) finalizeBatch(blockHeight uint64) error {
Save: true,
})

for offset := int64(0); ; offset += int64(bs.batchCfg.MaxChunkSize) {
for offset := int64(0); ; offset += bs.batchCfg.MaxChunkSize {
readLength, err := bs.batchFile.ReadAt(batchBuffer, offset)
if err != nil && err != io.EOF {
return err
Expand Down
2 changes: 1 addition & 1 deletion executor/child/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (ch *Child) beginBlockHandler(args nodetypes.BeginBlockArgs) (err error) {
func (ch *Child) endBlockHandler(args nodetypes.EndBlockArgs) error {
blockHeight := uint64(args.Block.Header.Height)
batchKVs := make([]types.RawKV, 0)
treeKVs, storageRoot, err := ch.handleTree(blockHeight, uint64(args.LatestHeight), args.BlockID, args.Block.Header)
treeKVs, storageRoot, err := ch.handleTree(blockHeight, args.LatestHeight, args.BlockID, args.Block.Header)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion executor/child/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (ch *Child) prepareTree(blockHeight uint64) error {
err := ch.mk.LoadWorkingTree(blockHeight - 1)
if err == dbtypes.ErrNotFound {
// must not happened
// TOOD: if user want to start from a specific height, we need to provide a way to do so
// TODO: if user want to start from a specific height, we need to provide a way to do so
panic(fmt.Errorf("working tree not found at height: %d, current: %d", blockHeight-1, blockHeight))
} else if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion merkle/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func (m *Merkle) fillLeaves() error {
}

lastLeaf := m.workingTree.LastSiblings[0]
//nolint:typecheck
for range numRestLeaves {
if err := m.InsertLeaf(lastLeaf); err != nil {
return err
Expand Down
8 changes: 0 additions & 8 deletions node/broadcaster/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,8 @@ func (b *Broadcaster) GetAccountWithHeight(_ client.Context, addr sdk.AccAddress
return nil, 0, fmt.Errorf("failed to parse block height: %w", err)
}

<<<<<<< HEAD:node/account.go
var acc authtypes.AccountI //nolint:staticcheck
if err := n.cdc.UnpackAny(res.Account, &acc); err != nil {
||||||| 168b4ff:node/account.go
var acc authtypes.AccountI
if err := n.cdc.UnpackAny(res.Account, &acc); err != nil {
=======
var acc sdk.AccountI
if err := b.cdc.UnpackAny(res.Account, &acc); err != nil {
>>>>>>> main:node/broadcaster/account.go
return nil, 0, err
}

Expand Down
4 changes: 2 additions & 2 deletions node/broadcaster/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func (b Broadcaster) getClientCtx() client.Context {
WithFromAddress(b.keyAddress)
}

func (n Broadcaster) GetTxf() tx.Factory {
return n.txf
func (b Broadcaster) GetTxf() tx.Factory {
return b.txf
}

func (b *Broadcaster) prepareBroadcaster(_ /*lastBlockHeight*/ uint64, lastBlockTime time.Time) error {
Expand Down
2 changes: 1 addition & 1 deletion node/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (n *Node) txChecker(ctx context.Context) error {
}
}

err = n.broadcaster.RemovePendingTx(int64(res.Height), pendingTx.TxHash, pendingTx.Sequence)
err = n.broadcaster.RemovePendingTx(res.Height, pendingTx.TxHash, pendingTx.Sequence)
if err != nil {
return err
}
Expand Down

0 comments on commit 142375b

Please sign in to comment.