Skip to content

Refactor rpc so all methods async, sendRawTransaction handles arrays#2520

Merged
matiu merged 1 commit into
bitpay:masterfrom
micahriggan:refactor/broadcast-rpc-calls
Nov 8, 2019
Merged

Refactor rpc so all methods async, sendRawTransaction handles arrays#2520
matiu merged 1 commit into
bitpay:masterfrom
micahriggan:refactor/broadcast-rpc-calls

Conversation

@micahriggan
Copy link
Copy Markdown
Contributor

No description provided.

});
});
const txids = new Array<string>();
const txs = typeof rawTx === 'string' ? [rawTx] : rawTx;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rawTxs

@micahriggan micahriggan force-pushed the refactor/broadcast-rpc-calls branch from 6faf6db to 79daa33 Compare November 7, 2019 19:16
@justinkook
Copy link
Copy Markdown
Contributor

justinkook commented Nov 7, 2019

Tested local bitcore-node with ETH multi-send. Works fine 👍

Screen Shot 2019-11-07 at 2 35 56 PM

cmgustavo
cmgustavo previously approved these changes Nov 7, 2019
Copy link
Copy Markdown
Member

@cmgustavo cmgustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const txids = new Array<string>();
const rawTxs = typeof rawTx === 'string' ? [rawTx] : rawTx;
for (const tx of rawTxs) {
const txid = await this.getRPC(chain, network).sendTransaction(tx);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs error handling try catch or .catch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for bitcoin, so I actually want it to throw if it fails

@justinkook justinkook mentioned this pull request Nov 7, 2019
@justinkook
Copy link
Copy Markdown
Contributor

This MR fixes:

[warn] ERROR: 500 - "Returned error: Invalid params: invalid type: sequence, expected a 0x-prefixed, hex-encoded vector of bytes." 

@matiu matiu merged commit e0cfd53 into bitpay:master Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants