Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Fix for failing sendWithdrawal() call #19

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/api/dapps.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Dapps.prototype.getGenesis = function (cb) {
* @param opts.secret - Secret of account to withdrawal
* @param opts.amount - Amount to withdrawal
* @param opts.recipientId - Recipient of withdrawal
* @param opts.dappId - id of the dapp account
* @param opts.transactionId - Transaction id of request to withdrawal.
* @param opts.secondSecret - Second secret to withdrawal (optional).
* @param opts.publicKey - Public key of account (optional).
Expand Down
5 changes: 4 additions & 1 deletion modules/blockchain/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ Accounts.prototype.getExecutor = function (cb) {
var keypair = modules.api.crypto.keypair(process.argv[2]);
modules.api.dapps.getGenesis(function (err, res) {
var address = self.generateAddressByPublicKey(keypair.publicKey.toString("hex"));
var parts = process.argv[1].split('/'); // /path/to/the/dapps/dappId/index.js
var dappId = parts[parts.length-2];
private.executor = {
address: address,
keypair: keypair,
secret: process.argv[2],
isAuthor: res.authorId == address
isAuthor: res.authorId == address,
dappId: dappId
}
cb(err, private.executor);
});
Expand Down
1 change: 1 addition & 0 deletions modules/system/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ private.withdrawalSync = function (cb) {
secret: executor.secret,
amount: transaction.amount,
recipientId: address,
dappId: executor.dappId,
transactionId: transaction.id,
multisigAccountPublicKey: executor.keypair.publicKey.toString("hex")
}, cb);
Expand Down