Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wlawt committed Apr 24, 2024
1 parent 1c80740 commit 77fb107
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
7 changes: 3 additions & 4 deletions chain/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ type StatelessBlock struct {
bytes []byte
txsSet set.Set[ids.ID]

bctx *block.Context
vdrState validators.State
bctx *block.Context

results []*Result
feeManager *fees.Manager
Expand Down Expand Up @@ -257,7 +256,7 @@ func (b *StatelessBlock) initializeBuilt(
func (b *StatelessBlock) ID() ids.ID { return b.id }

// implements "block.WithVerifyContext"
func (b *StatelessBlock) ShouldVerifyWithContext(context.Context) (bool, error) {
func (*StatelessBlock) ShouldVerifyWithContext(context.Context) (bool, error) {
return false, nil
}

Expand Down Expand Up @@ -451,7 +450,7 @@ func (b *StatelessBlock) innerVerify(ctx context.Context, vctx VerifyContext) er
feeKey := FeeKey(b.vm.StateManager().FeeKey())
feeRaw, err := parentView.GetValue(ctx, feeKey)
if err != nil {
return err //nolint:spancheck
return err
}
parentFeeManager := fees.NewManager(feeRaw)
feeManager, err := parentFeeManager.ComputeNext(parentTimestamp, b.Tmstmp, r)
Expand Down
14 changes: 7 additions & 7 deletions examples/tokenvm/cmd/token-cli/cmd/resolutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ import (
func sendAndWait(
ctx context.Context, action chain.Action, cli *rpc.JSONRPCClient,
scli *rpc.WebSocketClient, tcli *trpc.JSONRPCClient, factory chain.AuthFactory, printStatus bool,
) (ids.ID, error) {
) error {
parser, err := tcli.Parser(ctx)
if err != nil {
return ids.Empty, err
return err
}
_, tx, _, err := cli.GenerateTransaction(ctx, parser, action, factory)
if err != nil {
return ids.Empty, err
return err
}

if err := scli.RegisterTx(tx); err != nil {
return ids.Empty, err
return err
}
var res *chain.Result
for {
txID, dErr, result, err := scli.ListenTx(ctx)
if dErr != nil {
return ids.Empty, dErr
return dErr
}
if err != nil {
return ids.Empty, err
return err
}
if txID == tx.ID() {
res = result
Expand All @@ -54,7 +54,7 @@ func sendAndWait(
if printStatus {
handler.Root().PrintStatus(tx.ID(), res.Success)
}
return tx.ID(), nil
return nil
}

func handleTx(c *trpc.JSONRPCClient, tx *chain.Transaction, result *chain.Result) {
Expand Down
8 changes: 0 additions & 8 deletions vm/resolutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,6 @@ func (vm *VM) GetAuthBatchVerifier(authTypeID uint8, cores int, count int) (chai
return bv.GetBatchVerifier(cores, count), ok
}

func (vm *VM) cacheAuth(auth chain.Auth) {
bv, ok := vm.authEngine[auth.GetTypeID()]
if !ok {
return
}
bv.Cache(auth)
}

func (vm *VM) RecordBlockVerify(t time.Duration) {
vm.metrics.blockVerify.Observe(float64(t))
}
Expand Down

0 comments on commit 77fb107

Please sign in to comment.