diff options
author | StephenButtolph <[email protected]> | 2020-08-20 01:09:43 -0400 |
---|---|---|
committer | StephenButtolph <[email protected]> | 2020-08-20 01:09:43 -0400 |
commit | 1c078567367ef45884da079cecc09a71d1761b01 (patch) | |
tree | fbb989e9cc64d34056ee0ddb8f634e29dc8cd766 /plugin/evm/block.go | |
parent | 5fc26bb832c715cfd2628585d41bb82209ecdfe4 (diff) |
Added first pass of importTx verification
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r-- | plugin/evm/block.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go index d75ea1d..b3412a0 100644 --- a/plugin/evm/block.go +++ b/plugin/evm/block.go @@ -27,9 +27,18 @@ func (b *Block) ID() ids.ID { return b.id } // Accept implements the snowman.Block interface 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 + vm := b.vm + + vm.ctx.Log.Verbo("Block %s is accepted", b.ID()) + vm.updateStatus(b.ID(), choices.Accepted) + + tx := vm.getAtomicTx(b.ethBlock) + utx, ok := tx.UnsignedTx.(UnsignedAtomicTx) + if !ok { + return errors.New("unknown atomic tx type") + } + + return utx.Accept(vm.ctx, nil) } // Reject implements the snowman.Block interface |