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

sdk: option to allow mint to specific address with mintFor #1910

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

andrevmatos
Copy link
Contributor

Needed for _testing's mint functionality of #1692

Short description
Add an optional param to specificy the beneficiary of the mint transaction.

Definition of Done

  • Steps to manually test the change have been documented
  • Acceptance criteria are met
  • Change has been manually tested by the reviewer (dApp)

Steps to manually test the change (dApp)

@andrevmatos andrevmatos self-assigned this Jul 15, 2020
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #1910 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1910   +/-   ##
=======================================
  Coverage   95.61%   95.61%           
=======================================
  Files         155      155           
  Lines        5793     5796    +3     
  Branches     1089     1089           
=======================================
+ Hits         5539     5542    +3     
  Misses        196      196           
  Partials       58       58           
Flag Coverage Δ
#dapp 91.76% <ø> (ø)
#sdk 97.21% <100.00%> (+<0.01%) ⬆️
#sdk_e2e 65.49% <100.00%> (+0.04%) ⬆️
#sdk_unit 86.44% <0.00%> (-0.07%) ⬇️
Impacted Files Coverage Δ
raiden-ts/src/raiden.ts 91.48% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36efe62...0874921. Read the comment docs.

Copy link
Contributor

@weilbith weilbith left a comment

Choose a reason for hiding this comment

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

Stone by stone. You did a lot of coding yesterday. Thanks for your hard work! 💪

const receipt = await callAndWaitMined(
customTokenContract,
'mint',
[decode(UInt(32), amount)],
'mintFor',
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm the docs say that the token contract can either define mint(address, uint256), mintFor(uint256, address) or increaseSupply(uint256, address). The last seem to be not relevant. But from the first two: what is the difference in behavior except the signature? Is there definition exclusive? Should we maybe check for both? Or is mintFor the only one that does what we want now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't support all these interfaces. If you look into the source of the CustomToken contract, you'll see it supports just 2 minting methods: mint(uint256), which mints for self, and mintFor(uint256, address), which allows minting for a 3rd party. This is a _testing function, used only on our testnets, and these are always deployed with this contract. It'd be hard for the SDK to support multiple contracts interfaces, so we went with what is actually used.

raiden-ts/src/raiden.ts Outdated Show resolved Hide resolved
@andrevmatos andrevmatos merged commit 2f37eae into master Jul 16, 2020
@andrevmatos andrevmatos deleted the feature/mint_3rdp branch July 16, 2020 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants