Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decodeRawTransaction network addresses #359

Merged
merged 2 commits into from
Oct 7, 2020
Merged

Conversation

matthewjablack
Copy link
Contributor

@matthewjablack matthewjablack commented Oct 2, 2020

Description

This PR fixes decodeRawTransaction network addresses.

Submission Checklist 📝

  • Ensure decodeRawTransaction is passed network

@matthewjablack matthewjablack force-pushed the fix-decode-raw-tx-network branch 3 times, most recently from b536229 to daf7704 Compare October 6, 2020 01:25
Copy link
Collaborator

@monokh monokh left a comment

Choose a reason for hiding this comment

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

LGTM, could you change target to dev?

const { hex, fee } = await this._buildTransaction(transactions, feePerByte)
await this.getMethod('sendRawTransaction')(hex)
return normalizeTransactionObject(decodeRawTransaction(hex), fee)
return normalizeTransactionObject(decodeRawTransaction(hex, network), fee)
Copy link
Collaborator

Choose a reason for hiding this comment

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

would be clearer to just pass this._network here and avoid the reassignment

@@ -56,12 +57,14 @@ export default superclass => class BitcoinWalletProvider extends superclass {
}

async sendSweepTransaction (externalChangeAddress, feePerByte, outputs, fixedInputs) {
const network = this._network
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

}

async updateTransactionFee (tx, newFeePerByte) {
const network = this._network
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@@ -237,6 +240,7 @@ export default superclass => class BitcoinWalletProvider extends superclass {
}

async getInputsForAmount (_targets = [], _feePerByte, fixedInputs = [], numAddressPerCall = 100, sweep = false) {
const network = this._network
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@matthewjablack matthewjablack changed the base branch from sweep-transaction to dev October 7, 2020 17:51
@matthewjablack
Copy link
Contributor Author

Good point @monokh. Updated to use this._network to avoid reassignment

@monokh monokh merged commit 6b62685 into dev Oct 7, 2020
@kraikov kraikov deleted the fix-decode-raw-tx-network branch April 29, 2022 09:15
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.

2 participants