diff --git a/actions/rollup_register.go b/actions/rollup_register.go index 2fefe3b..29b6f6c 100644 --- a/actions/rollup_register.go +++ b/actions/rollup_register.go @@ -65,7 +65,7 @@ func (r *RollupRegistration) Execute( namespaces, err := storage.GetRollupRegistry(ctx, mu) if err != nil { - return nil, fmt.Errorf("unable to get namespaces: %w", err.Error()) + return nil, fmt.Errorf("unable to get namespaces: %w", err) } switch r.OpCode { @@ -78,17 +78,17 @@ func (r *RollupRegistration) Execute( } namespaces = append(namespaces, r.Namespace) if err := storage.SetRollupInfo(ctx, mu, r.Namespace, &r.Info); err != nil { - return nil, fmt.Errorf("unable to set rollup info(CREATE): %w", err.Error()) + return nil, fmt.Errorf("unable to set rollup info(CREATE): %w", err) } case UpdateRollup: // only allow modifing informations that are not related to ExitEpoch or StartEpoch if err := authorizationChecks(ctx, actor, namespaces, r.Namespace, mu); err != nil { - return nil, fmt.Errorf("authorization failed(UPDATE): %w", err.Error()) + return nil, fmt.Errorf("authorization failed(UPDATE): %w", err) } rollupInfoExists, err := storage.GetRollupInfo(ctx, mu, r.Namespace) if err != nil { - return nil, fmt.Errorf("unable to get existing rollup info(UPDATE): %w", err.Error()) + return nil, fmt.Errorf("unable to get existing rollup info(UPDATE): %w", err) } // rewrite epoch info @@ -96,15 +96,15 @@ func (r *RollupRegistration) Execute( r.Info.StartEpoch = rollupInfoExists.StartEpoch if err := storage.SetRollupInfo(ctx, mu, r.Namespace, &r.Info); err != nil { - return nil, fmt.Errorf("unable to set rollup info(UPDATE): %w", err.Error()) + return nil, fmt.Errorf("unable to set rollup info(UPDATE): %w", err) } case ExitRollup: if err := authorizationChecks(ctx, actor, namespaces, r.Namespace, mu); err != nil { - return nil, fmt.Errorf("unable to set rollup info(EXIT): %w", err.Error()) + return nil, fmt.Errorf("unable to set rollup info(EXIT): %w", err) } rollupInfoExists, err := storage.GetRollupInfo(ctx, mu, r.Namespace) if err != nil { - return nil, fmt.Errorf("unable to get existing rollup info(UPDATE): %w", err.Error()) + return nil, fmt.Errorf("unable to get existing rollup info(UPDATE): %w", err) } if r.Info.ExitEpoch < rollupInfoExists.StartEpoch || r.Info.ExitEpoch < Epoch(hght, rules.GetEpochLength())+2 { return nil, fmt.Errorf("(EXIT)epoch number is not valid, minimum: %d, actual: %d, start: %d", Epoch(hght, rules.GetEpochLength())+2, r.Info.ExitEpoch, rollupInfoExists.StartEpoch) @@ -114,7 +114,7 @@ func (r *RollupRegistration) Execute( r.Info.StartEpoch = rollupInfoExists.StartEpoch if err := storage.SetRollupInfo(ctx, mu, r.Namespace, &r.Info); err != nil { - return nil, fmt.Errorf("unable to set rollup info(EXIT): %w", err.Error()) + return nil, fmt.Errorf("unable to set rollup info(EXIT): %w", err) } default: return nil, fmt.Errorf("op code(%d) not supported", r.OpCode) diff --git a/controller/controller.go b/controller/controller.go index 0296ef5..3d93c19 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -225,7 +225,7 @@ func (c *Controller) Accepted(ctx context.Context, blk *chain.StatelessBlock) er } if result.Success { for _, act := range tx.Actions { - switch act.(type) { + switch act.(type) { //nolint:gocritic case *actions.Transfer: c.metrics.transfer.Inc() case *actions.SequencerMsg: @@ -233,12 +233,11 @@ func (c *Controller) Accepted(ctx context.Context, blk *chain.StatelessBlock) er case *actions.Auction: c.metrics.auction.Inc() case *actions.RollupRegistration: - reg := act.(*actions.RollupRegistration) + reg := act.(*actions.RollupRegistration) //nolint:gosimple rollups = append(rollups, ®.Info) c.metrics.rollupRegister.Inc() case *actions.EpochExit: c.metrics.epochExit.Inc() - } } } diff --git a/scripts/run.sh b/scripts/run.sh index 5759366..1d2f2b5 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -135,7 +135,7 @@ find "${TMPDIR}"/avalanchego-"${VERSION}" # Make sure to replace this address with your own address # if you are starting your own devnet (otherwise anyone can access # funds using the included demo.pk) -# total stake can allocate: 10000000000000000000, make sure it is below this or genesis won't load +# Sum of balances should be less than max uint64. echo "creating allocations file" cat < "${TMPDIR}"/allocations.json [ diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 5b1e332..137e7ed 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -44,7 +44,7 @@ import ( ) const ( - startAmount = uint64(10000000000000000000) + startAmount = uint64(1000000000000000000) sendAmount = uint64(5000) healthPollInterval = 10 * time.Second @@ -903,6 +903,14 @@ var _ = ginkgo.Describe("[Test]", func() { err = instances[0].wsCli.RegisterTx(tx) require.NoError(err) + err = instances[1].wsCli.RegisterTx(tx) + require.NoError(err) + err = instances[2].wsCli.RegisterTx(tx) + require.NoError(err) + err = instances[3].wsCli.RegisterTx(tx) + require.NoError(err) + err = instances[4].wsCli.RegisterTx(tx) + require.NoError(err) txID, txErr, result, err := instances[0].wsCli.ListenTx(ctx) require.Equal(tx.ID(), txID) require.NoError(err)