diff --git a/.env b/.env index efd643bfb9..5d9eca39cf 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -TAG=v3.0.0-rc.1 +TAG=v3.0.1 COMPILER_TAG=v3.0.0 diff --git a/es/tx/builder/helpers.js b/es/tx/builder/helpers.js index 0830705700..e133fe2447 100644 --- a/es/tx/builder/helpers.js +++ b/es/tx/builder/helpers.js @@ -20,7 +20,7 @@ import { BigNumber } from 'bignumber.js' export const createSalt = salt -const base64Types = ['tx', 'st', 'ss', 'pi', 'ov', 'or', 'cb', 'cs'] +const base64Types = ['tx', 'st', 'ss', 'pi', 'ov', 'or', 'cb', 'cs', 'ba'] /** * Build a contract public key diff --git a/es/tx/builder/index.js b/es/tx/builder/index.js index 2b15587aaf..577f806518 100644 --- a/es/tx/builder/index.js +++ b/es/tx/builder/index.js @@ -50,6 +50,8 @@ function deserializeField (value, type, prefix) { return encode(value, prefix) case FIELD_TYPES.string: return value.toString() + case FIELD_TYPES.payload: + return encode(value, 'ba') case FIELD_TYPES.pointers: return readPointers(value) case FIELD_TYPES.rlpBinary: @@ -95,6 +97,7 @@ function serializeField (value, type, prefix) { return Buffer.from(value, 'hex') case FIELD_TYPES.signatures: return value.map(Buffer.from) + case FIELD_TYPES.payload: case FIELD_TYPES.string: return toBytes(value) case FIELD_TYPES.pointers: diff --git a/es/tx/builder/schema.js b/es/tx/builder/schema.js index 89b97f0db3..44b8dfeab2 100644 --- a/es/tx/builder/schema.js +++ b/es/tx/builder/schema.js @@ -248,7 +248,8 @@ export const FIELD_TYPES = { proofOfInclusion: 'proofOfInclusion', mptree: 'mptree', callReturnType: 'callReturnType', - ctVersion: 'ctVersion' + ctVersion: 'ctVersion', + payload: 'payload' } // FEE CALCULATION @@ -341,7 +342,7 @@ const SPEND_TX = [ TX_FIELD('fee', FIELD_TYPES.int), TX_FIELD('ttl', FIELD_TYPES.int), TX_FIELD('nonce', FIELD_TYPES.int), - TX_FIELD('payload', FIELD_TYPES.string) + TX_FIELD('payload', FIELD_TYPES.payload) ] const SIGNED_TX = [ diff --git a/es/tx/validator.js b/es/tx/validator.js index 6f52989802..eccd2fb07e 100644 --- a/es/tx/validator.js +++ b/es/tx/validator.js @@ -133,7 +133,7 @@ async function unpackAndVerify (txHash, { networkId } = {}) { } const getOwnerPublicKey = (tx) => - tx[['senderId', 'accountId', 'ownerId', 'callerId', 'oracleId'].find(key => tx[key])].replace('ok_', 'ak_') + tx[['senderId', 'accountId', 'ownerId', 'callerId', 'oracleId', 'fromId'].find(key => tx[key])].replace('ok_', 'ak_') /** * Verify transaction (verify nonce, ttl, fee, signature, account balance)