From 803878756eafc3f3c86198ad9f5a8893a63cf7df Mon Sep 17 00:00:00 2001 From: StephenButtolph Date: Sat, 30 May 2020 14:31:33 -0400 Subject: Added error handling for the denali release --- plugin/evm/block.go | 6 ++++-- plugin/evm/vm.go | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin/evm/block.go b/plugin/evm/block.go index ec47490..eaa78a5 100644 --- a/plugin/evm/block.go +++ b/plugin/evm/block.go @@ -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 diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index a9011ea..2dd0dd8 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -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 -- cgit v1.2.3