Skip to content
Snippets Groups Projects
Commit 1a57345a authored by Mahdi Yari's avatar Mahdi Yari
Browse files

move the replacement to the .send()

parent 312acaf4
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,10 @@ const hiveBroadcast = {}; ...@@ -27,6 +27,10 @@ const hiveBroadcast = {};
hiveBroadcast.send = function hiveBroadcast$send(tx, privKeys, callback) { hiveBroadcast.send = function hiveBroadcast$send(tx, privKeys, callback) {
const resultP = hiveBroadcast._prepareTransaction(tx) const resultP = hiveBroadcast._prepareTransaction(tx)
.then((transaction) => { .then((transaction) => {
if (config.get("address_prefix") === "TST") {
transaction.operations = JSON.parse(JSON.stringify(transaction.operations).replace(' HIVE', ' TESTS'))
transaction.operations = JSON.parse(JSON.stringify(transaction.operations).replace(' HBD', ' TBD'))
}
debug( debug(
'Signing transaction (transaction, transaction.operations)', 'Signing transaction (transaction, transaction.operations)',
transaction, transaction.operations transaction, transaction.operations
...@@ -88,10 +92,7 @@ operations.forEach((operation) => { ...@@ -88,10 +92,7 @@ operations.forEach((operation) => {
if (operation.roles && operation.roles.length) { if (operation.roles && operation.roles.length) {
keys[operation.roles[0]] = wif; // TODO - Automatically pick a role? Send all? keys[operation.roles[0]] = wif; // TODO - Automatically pick a role? Send all?
} }
if (config.get("address_prefix") !== "STM") {
options = JSON.parse(JSON.stringify(options).replace(' HIVE', ' TESTS'))
options = JSON.parse(JSON.stringify(options).replace(' HBD', ' TBD'))
}
return hiveBroadcast.send({ return hiveBroadcast.send({
extensions: [], extensions: [],
operations: [[operation.operation, Object.assign( operations: [[operation.operation, Object.assign(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment