aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/block.go
diff options
context:
space:
mode:
authorStephenButtolph <[email protected]>2020-08-20 01:09:43 -0400
committerStephenButtolph <[email protected]>2020-08-20 01:09:43 -0400
commit1c078567367ef45884da079cecc09a71d1761b01 (patch)
treefbb989e9cc64d34056ee0ddb8f634e29dc8cd766 /plugin/evm/block.go
parent5fc26bb832c715cfd2628585d41bb82209ecdfe4 (diff)
Added first pass of importTx verification
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r--plugin/evm/block.go15
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