From 3a510b9dad61e868f78f8e590c2caa957b3e9a79 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov <evgeniy@nspcc.ru> Date: Thu, 5 Mar 2020 11:51:19 +0300 Subject: [PATCH] core: allow transfer amount to be bytes VM can produce both big.Int and []byte because they are converted to each other on demand. --- pkg/core/blockchain.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index f9e930737..49ad24ef1 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -708,7 +708,11 @@ func (bc *Blockchain) storeBlock(block *block.Block) error { } amount, ok := arr[3].Value().(*big.Int) if !ok { - continue + bs, ok := arr[3].Value().([]byte) + if !ok { + continue + } + amount = emit.BytesToInt(bs) } // TODO: #498 _, _, _, _ = op, from, to, amount