Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Add additional methods to BitcoinHelper #58

Merged
merged 3 commits into from
Jul 29, 2020

Conversation

lukasz-zimnoch
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch commented Jul 28, 2020

Refs: keep-network/tbtc#703

Implemented some additional methods exposed by the Electrum Client which will be needed by the end-to-end test script for testnet: keep-network/local-setup#20

Implemented some additional methods exposed
by the Electrum Client which will be needed
by the end-to-end test script for testnet.
*
* @param {string} bitcoinAddress Bitcoin address to check.
*
* @return {Promise<Number>} A promise to the confirmed balance as satoshis.
Copy link
Contributor

Choose a reason for hiding this comment

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

in satoshis*

*/
estimateFeePerKb: async function(includeWithinBlocks) {
return BitcoinHelpers.withElectrumClient(async electrumClient => {
const feePerKb = await electrumClient.getFeeEstimate(includeWithinBlocks || 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth noting, this was always returning 0 in my deposit submitter experiments, which is why I ended up always using the minimum relay fee in the other PR's implementation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I have the same. I thought there will be a difference if I use it against BTC testnet but nope. I will remove this method and use the default ones or the minimum relay fee in my test script.

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Some teensy notes, but I'm good here. Will probably merge at EOD if there are no updates.

EDIT: Whoops, I see we're still in draft 😬

@Shadowfiend Shadowfiend self-assigned this Jul 28, 2020
@lukasz-zimnoch
Copy link
Member Author

lukasz-zimnoch commented Jul 28, 2020

Thanks for a turbo review @Shadowfiend!. Yep, it's a draft because I'm still testing everything and there is a possibility I will change something. Once I'm done with testing I'll make it ready for review and ping you.

@lukasz-zimnoch lukasz-zimnoch marked this pull request as ready for review July 29, 2020 11:48
@lukasz-zimnoch
Copy link
Member Author

@Shadowfiend I'm ready here.


return feePerKb
})
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm definitely interested in making this work in the future, btw. Need to see what about our node is making the server side of this fall over.

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Let's 🎸

@Shadowfiend Shadowfiend merged commit 126e3e9 into master Jul 29, 2020
@Shadowfiend Shadowfiend deleted the additional-bitcoin-methods branch July 29, 2020 13:11
r-czajkowski added a commit that referenced this pull request Jul 29, 2020
Fix JS linter errors

Repair some linter errors introduced by #58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants