aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/runtime
diff options
context:
space:
mode:
authorJhih-Ming Huang <jm.huang@cobinhood.com>2019-04-03 17:17:21 +0800
committerJhih-Ming Huang <jm.huang@cobinhood.com>2019-05-06 10:44:04 +0800
commit9b8e66235752d5334a10023f9e00218904d746e8 (patch)
treef27ce2212802d5fa075dfe76660b2670bb6077a2 /core/vm/sqlvm/runtime
parent66a6bea86c7c007562a51d3720a4f7667ce1b64e (diff)
downloaddexon-9b8e66235752d5334a10023f9e00218904d746e8.tar
dexon-9b8e66235752d5334a10023f9e00218904d746e8.tar.gz
dexon-9b8e66235752d5334a10023f9e00218904d746e8.tar.bz2
dexon-9b8e66235752d5334a10023f9e00218904d746e8.tar.lz
dexon-9b8e66235752d5334a10023f9e00218904d746e8.tar.xz
dexon-9b8e66235752d5334a10023f9e00218904d746e8.tar.zst
dexon-9b8e66235752d5334a10023f9e00218904d746e8.zip
core: vm: sqlvm: ast: decimal decode for bool
Diffstat (limited to 'core/vm/sqlvm/runtime')
-rw-r--r--core/vm/sqlvm/runtime/instructions_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/vm/sqlvm/runtime/instructions_test.go b/core/vm/sqlvm/runtime/instructions_test.go
index b679c366f..576a7783a 100644
--- a/core/vm/sqlvm/runtime/instructions_test.go
+++ b/core/vm/sqlvm/runtime/instructions_test.go
@@ -14,6 +14,7 @@ import (
"github.com/dexon-foundation/dexon/core/vm"
"github.com/dexon-foundation/dexon/core/vm/sqlvm/ast"
"github.com/dexon-foundation/dexon/core/vm/sqlvm/common"
+ dec "github.com/dexon-foundation/dexon/core/vm/sqlvm/common/decimal"
"github.com/dexon-foundation/dexon/core/vm/sqlvm/errors"
"github.com/dexon-foundation/dexon/core/vm/sqlvm/schema"
"github.com/dexon-foundation/dexon/crypto"
@@ -101,6 +102,16 @@ func setSlotDataInStateDB(head dexCommon.Hash, addr dexCommon.Address,
},
{
Raw: Raw{
+ Value: dec.False,
+ Bytes: nil,
+ },
+ slotShift: 0,
+ byteShift: 10,
+ major: ast.DataTypeMajorBool,
+ minor: ast.DataTypeMinor(0),
+ },
+ {
+ Raw: Raw{
Bytes: []byte("Hello, world!"),
},
slotShift: 1,
@@ -158,7 +169,7 @@ func setSlotDataInStateDB(head dexCommon.Hash, addr dexCommon.Address,
}
// set dynamic bytes data
- longDBytesLoc := 5
+ longDBytesLoc := 6
longRaw := raws[longDBytesLoc]
hash.SetBytes(longRaw.Bytes)
ptr = storage.ShiftHashUint64(head, uint64(longRaw.slotShift))