Skip to content

Commit

Permalink
Added error handling for the denali release
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed May 30, 2020
1 parent addb553 commit 8038787
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions plugin/evm/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ type Block struct {
func (b *Block) ID() ids.ID { return b.id }

// Accept implements the snowman.Block interface
func (b *Block) Accept() {
func (b *Block) Accept() error {
b.vm.ctx.Log.Verbo("Block %s is accepted", b.ID())
b.vm.updateStatus(b.ID(), choices.Accepted)
return nil
}

// Reject implements the snowman.Block interface
func (b *Block) Reject() {
func (b *Block) Reject() error {
b.vm.ctx.Log.Verbo("Block %s is rejected", b.ID())
b.vm.updateStatus(b.ID(), choices.Rejected)
return nil
}

// Status implements the snowman.Block interface
Expand Down
5 changes: 3 additions & 2 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,14 @@ func (vm *VM) Initialize(
}

// Shutdown implements the snowman.ChainVM interface
func (vm *VM) Shutdown() {
func (vm *VM) Shutdown() error {
if vm.ctx == nil {
return
return nil
}

vm.writeBackMetadata()
vm.chain.Stop()
return nil
}

// BuildBlock implements the snowman.ChainVM interface
Expand Down

0 comments on commit 8038787

Please sign in to comment.