Created
November 2, 2020 16:37
-
-
Save KasraAb/0cfcfa10e2c949132b3d31fff38f287b to your computer and use it in GitHub Desktop.
NewNash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//update recipient's account | |
const new_recipient_nash = (!recipient.asset.nash)? this.asset.amount | |
: new BigNum(recipient.asset.nash).add(this.asset.amount).toString(); | |
const updated_recipient = { ...recipient, asset: { ...recipient.asset, nash: new_recipient_nash} }; | |
store.account.set(updated_recipient.address, updated_recipient); | |
//update Manager's account | |
const new_supply = (!Manager.asset.nashSupply) ? this.asset.amount | |
: new BigNum(Manager.asset.nashSupply).add(this.asset.amount).toString(); | |
const updated_Manager = {...Manager,asset : {...Manager.asset, nashSupply: new_supply}}; | |
store.account.set(updated_Manager.address, updated_Manager); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment