Skip to content

feat: partial tx facade #408

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

Merged
merged 26 commits into from
Sep 14, 2022
Merged

feat: partial tx facade #408

merged 26 commits into from
Sep 14, 2022

Conversation

r4mmer
Copy link
Member

@r4mmer r4mmer commented Aug 23, 2022

Acceptance Criteria

  • Changes requested for the new atomic-swap api.
  • Create a method to calculate the token balance for a wallet on a partial tx.

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@r4mmer r4mmer self-assigned this Aug 23, 2022
@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Merging #408 (d3f1133) into dev (cb7c96b) will increase coverage by 1.46%.
The diff coverage is 82.97%.

@@            Coverage Diff             @@
##              dev     #408      +/-   ##
==========================================
+ Coverage   55.21%   56.68%   +1.46%     
==========================================
  Files          55       55              
  Lines        4551     4603      +52     
  Branches      846      879      +33     
==========================================
+ Hits         2513     2609      +96     
+ Misses       1848     1804      -44     
  Partials      190      190              
Impacted Files Coverage Δ
src/new/wallet.js 13.62% <0.00%> (ø)
src/utils/transaction.ts 75.00% <14.28%> (-25.00%) ⬇️
src/models/partial_tx.ts 93.95% <93.93%> (-0.90%) ⬇️
src/wallet/partialTxProposal.ts 80.95% <97.87%> (+80.95%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@r4mmer r4mmer marked this pull request as ready for review August 26, 2022 20:18
@r4mmer r4mmer requested a review from pedroferreira1 as a code owner August 26, 2022 20:18
@r4mmer r4mmer changed the title Feat/partial tx facade feat: partial tx facade Aug 26, 2022
@r4mmer r4mmer requested a review from tuliomir August 30, 2022 14:47
Copy link
Contributor

@tuliomir tuliomir left a comment

Choose a reason for hiding this comment

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

The only suggestions I made were about comment blocks and configs, so the code is approved already.

@@ -7,7 +7,7 @@ module.exports = {
modulePathIgnorePatterns: ["__fixtures__/*","integration/*"],
coverageThreshold: {
global: {
branches: 43,
branches: 45,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one! Always good to improve our coverage and update this config 👍

const token = tokenIndex === 0 ? HATHOR_TOKEN_CONFIG.uid : tx.tokens[tokenIndex-1];
let authorities = 0;
if (output.isMint()) {
authorities += 1;
Copy link
Member

Choose a reason for hiding this comment

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

You can use here TOKEN_MINT_MASK (this is meant also for the melt below)

Copy link
Member Author

Choose a reason for hiding this comment

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

The isMint already checks for TOKEN_AUTHORITY_MASK (on token data) and TOKEN_MINT_MASK (on value).

I think this seems more readable.
What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

The comment was to use authorities += TOKEN_MINT_MASK and authorities += TOKEN_MELT_MASK below, instead of the hardcoded += 1 and += 2

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@r4mmer r4mmer force-pushed the feat/partial-tx-facade branch from 224d0d8 to f821ef7 Compare September 12, 2022 14:20
@tuliomir tuliomir self-requested a review September 14, 2022 14:41
@r4mmer r4mmer merged commit 701a06c into dev Sep 14, 2022
@r4mmer r4mmer deleted the feat/partial-tx-facade branch September 14, 2022 18:36
r4mmer added a commit that referenced this pull request Sep 15, 2022
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.

3 participants