Skip to content

Commit

Permalink
Remove rejected from controller interface (#1140)
Browse files Browse the repository at this point in the history
* Remove rejected from controller interface

* Update mocks and remove unused mock_auth from mocks.mockgen.txt

---------

Co-authored-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
  • Loading branch information
aaronbuchwald and joshua-kim committed Jul 15, 2024
1 parent 9bda4d7 commit 73390f6
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 29 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ type Controller interface {
// Anything that the VM wishes to store outside of state or blocks must be
// recorded here
Accepted(ctx context.Context, blk *chain.StatelessBlock) error
Rejected(ctx context.Context, blk *chain.StatelessBlock) error

// Shutdown should be used by the [Controller] to terminate any async
// processes it may be running in the background. It is invoked when
Expand Down
4 changes: 0 additions & 4 deletions examples/morpheusvm/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ func (c *Controller) Accepted(ctx context.Context, blk *chain.StatelessBlock) er
return batch.Write()
}

func (*Controller) Rejected(context.Context, *chain.StatelessBlock) error {
return nil
}

func (*Controller) Shutdown(context.Context) error {
// Do not close any databases provided during initialization. The VM will
// close any databases your provided.
Expand Down
4 changes: 0 additions & 4 deletions examples/tokenvm/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ func (c *Controller) Accepted(ctx context.Context, blk *chain.StatelessBlock) er
return batch.Write()
}

func (*Controller) Rejected(context.Context, *chain.StatelessBlock) error {
return nil
}

func (*Controller) Shutdown(context.Context) error {
// Do not close any databases provided during initialization. The VM will
// close any databases your provided.
Expand Down
1 change: 0 additions & 1 deletion scripts/mocks.mockgen.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
github.com/ava-labs/hypersdk/chain=Auth=chain/mock_auth.go
github.com/ava-labs/hypersdk/chain=Rules=chain/mock_rules.go
github.com/ava-labs/hypersdk/vm=Controller=vm/mock_controller.go
1 change: 0 additions & 1 deletion vm/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ type Controller interface {
// Anything that the VM wishes to store outside of state or blocks must be
// recorded here
Accepted(ctx context.Context, blk *chain.StatelessBlock) error
Rejected(ctx context.Context, blk *chain.StatelessBlock) error

// Shutdown should be used by the [Controller] to terminate any async
// processes it may be running in the background. It is invoked when
Expand Down
14 changes: 0 additions & 14 deletions vm/mock_controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions vm/resolutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ func (vm *VM) Rejected(ctx context.Context, b *chain.StatelessBlock) {
vm.verifiedL.Unlock()
vm.mempool.Add(ctx, b.Txs)

if err := vm.c.Rejected(ctx, b); err != nil {
vm.Fatal("rejected processing failed", zap.Error(err))
}

// Ensure children of block are cleared, they may never be
// verified
vm.snowCtx.Log.Info("rejected block", zap.Stringer("id", b.ID()))
Expand Down

0 comments on commit 73390f6

Please sign in to comment.