diff --git a/integration_tests/helpers/transactionBuilder.js b/integration_tests/helpers/transactionBuilder.js index 36a95b3157..2fc83dbc04 100644 --- a/integration_tests/helpers/transactionBuilder.js +++ b/integration_tests/helpers/transactionBuilder.js @@ -8,6 +8,7 @@ const { littleEndianHexStringToBigEndianHexString, combineTwoTariKeys, } = require("../helpers/util"); +const { OutputType } = require("./types"); class TransactionBuilder { recovery_byte_key; @@ -59,7 +60,7 @@ class TransactionBuilder { // version Buffer.from([OUTPUT_FEATURES_VERSION]), Buffer.from([parseInt(features.maturity || 0)]), - toLittleEndian(features.flags, 16), + Buffer.from([features.output_type]), OUTPUT_FEATURES_VERSION === 0x00 ? Buffer.from([]) : Buffer.from([features.recovery_byte]), @@ -265,7 +266,7 @@ class TransactionBuilder { ); const recoveryByte = this.create_unique_recovery_byte(commitment); const outputFeatures = Object.assign({ - flags: 0, + output_type: OutputType.STANDARD, maturity: 0, recovery_byte: recoveryByte, metadata: [], @@ -459,7 +460,7 @@ class TransactionBuilder { ); const recoveryByte = this.create_unique_recovery_byte(commitment); let outputFeatures = { - flags: 1, + output_type: OutputType.COINBASE, maturity: lockHeight, recovery_byte: recoveryByte, metadata: [], diff --git a/integration_tests/helpers/types.js b/integration_tests/helpers/types.js index 8c6a5ce4b4..19391724e5 100644 --- a/integration_tests/helpers/types.js +++ b/integration_tests/helpers/types.js @@ -34,4 +34,8 @@ const PaymentType = { ONE_SIDED: 1, }; -module.exports = { PowAlgo, ConnectivityStatus, PaymentType }; +const OutputType = { + STANDARD: 0, + COINBASE: 1, +}; +module.exports = { PowAlgo, ConnectivityStatus, PaymentType, OutputType }; diff --git a/integration_tests/helpers/util.js b/integration_tests/helpers/util.js index d478128277..a88f911b10 100644 --- a/integration_tests/helpers/util.js +++ b/integration_tests/helpers/util.js @@ -252,8 +252,8 @@ const getTransactionOutputHash = function (output) { Buffer.from([0]), // features.maturity Buffer.from([parseInt(output.features.maturity)]), - // features.flags - Buffer.from(toLittleEndian(output.features.flags, 16)), + // features.output_type + Buffer.from([output.features.output_type]), ]); // features.parent_public_key features = Buffer.concat([ diff --git a/integration_tests/helpers/walletProcess.js b/integration_tests/helpers/walletProcess.js index dc2dbadc9d..b916a3223b 100644 --- a/integration_tests/helpers/walletProcess.js +++ b/integration_tests/helpers/walletProcess.js @@ -10,7 +10,8 @@ const { expect } = require("chai"); const { createEnv } = require("./config"); const WalletClient = require("./walletClient"); const csvParser = require("csv-parser"); -var tari_crypto = require("tari_crypto"); +const tari_crypto = require("tari_crypto"); +const { OutputType } = require("./types"); let outputProcess; @@ -398,7 +399,7 @@ class WalletProcess { value: parseInt(row.value), spending_key: Buffer.from(row.spending_key, "hex"), features: { - flags: 0, + output_type: OutputType.STANDARD, maturity: parseInt(row.maturity) || 0, recovery_byte: parseInt(row.recovery_byte), },