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

Merge branch 'usetestnet-change-assets' into 'master'

Change assets when using testnet

Closes #24

See merge request !32
parents a78f5b52 1a57345a
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,6 +92,7 @@ operations.forEach((operation) => { ...@@ -88,6 +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?
} }
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