diff options
author | Jhih-Ming Huang <jm.huang@cobinhood.com> | 2019-04-01 15:05:56 +0800 |
---|---|---|
committer | Jhih-Ming Huang <jm@dexon.org> | 2019-04-03 15:22:28 +0800 |
commit | af4fb11367d92522cae16e1746ef822cacd561e9 (patch) | |
tree | 50b7c5d7dce7823134378b511a5c25d1b9d2a786 /core/vm/sqlvm/runtime/instructions.go | |
parent | 3fef64cc5c864117996b2ae6c85cff49ca1edfa1 (diff) | |
download | dexon-af4fb11367d92522cae16e1746ef822cacd561e9.tar dexon-af4fb11367d92522cae16e1746ef822cacd561e9.tar.gz dexon-af4fb11367d92522cae16e1746ef822cacd561e9.tar.bz2 dexon-af4fb11367d92522cae16e1746ef822cacd561e9.tar.lz dexon-af4fb11367d92522cae16e1746ef822cacd561e9.tar.xz dexon-af4fb11367d92522cae16e1746ef822cacd561e9.tar.zst dexon-af4fb11367d92522cae16e1746ef822cacd561e9.zip |
core: vm: sqlvm: runtime: opLoad load fixed bytes and address in bytes
To satisfy the latest spec, the data of type of address and fixed bytes will
be stored in bytes instead of decimal value.
Diffstat (limited to 'core/vm/sqlvm/runtime/instructions.go')
-rw-r--r-- | core/vm/sqlvm/runtime/instructions.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/vm/sqlvm/runtime/instructions.go b/core/vm/sqlvm/runtime/instructions.go index a1c992988..d1bfa8a17 100644 --- a/core/vm/sqlvm/runtime/instructions.go +++ b/core/vm/sqlvm/runtime/instructions.go @@ -146,9 +146,9 @@ func decode(ctx *common.Context, dt ast.DataType, slot dexCommon.Hash, bytes []b switch major { case ast.DataTypeMajorDynamicBytes: rVal.Bytes = ctx.Storage.DecodeDByteBySlot(ctx.Contract.Address(), slot) - case ast.DataTypeMajorFixedBytes, ast.DataTypeMajorBool, - ast.DataTypeMajorAddress, ast.DataTypeMajorInt, - ast.DataTypeMajorUint: + case ast.DataTypeMajorFixedBytes, ast.DataTypeMajorAddress: + rVal.Bytes = bytes + case ast.DataTypeMajorBool, ast.DataTypeMajorInt, ast.DataTypeMajorUint: d, err := ast.DecimalDecode(dt, bytes) if err != nil { return nil, err |