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

Touchups #13

Merged
merged 3 commits into from
Mar 31, 2020
Merged

Touchups #13

merged 3 commits into from
Mar 31, 2020

Conversation

liamzebedee
Copy link
Contributor

@liamzebedee liamzebedee commented Mar 26, 2020

Add getSignerFee helper to Deposit.

This line in tbtc-dapp fails with the new web3 tbtc.js. The new method call would be deposit.methods.signerFee().call(), although the line above uses a helper - I figure we should use one here too.

Convert redemptionCost BN to string

I found this while investigating our Discord bug. I didn't test this less-travelled code path of redemption.

*/
async getSignerFee() {
return toBN(await this.contract.methods.signerFee().call())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

src/Deposit.js Outdated
* Get the signer fee, to be paid at redemption.
* @return {Promise<BN>} A promise to the signer fee for this deposit, in TBTC.
*/
async getSignerFee() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Although please include the unit in this method name, now that I think about it (getSatoshiSignerFee or similar).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Almost Hungarian. 😉

Observation - the naming styles are a bit diverse across the board, we seem to prefer lowercase Tbtc for getters, and uppercase for minting.

  • getSatoshiLotSize
  • getSignerFee
  • lotSizeTbtc
  • auctionTBTCAmount

Copy link
Contributor

Choose a reason for hiding this comment

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

It's all a mess.

It's clearer to denominate the fee in the method name itself.
@liamzebedee liamzebedee changed the title [WIP] Touchups Touchups Mar 31, 2020
@liamzebedee liamzebedee marked this pull request as ready for review March 31, 2020 11:49
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.

This PR looks good 👍

@Shadowfiend Shadowfiend merged commit 72e4699 into master Mar 31, 2020
@Shadowfiend Shadowfiend deleted the helpers branch March 31, 2020 12:01
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