Created
August 31, 2020 09:22
-
-
Save corbifex/efb7599dc58cbe0b58add7c5086d702f to your computer and use it in GitHub Desktop.
Calculate vote stake
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
public calculateVoteStake(investments: Array<Investment>): bigint { | |
let voteStake = BigInt(0); | |
investments.map(investment => { | |
if (investment.address === this.senderId) { | |
voteStake += BigInt(investment.amount); | |
} | |
}); | |
return voteStake; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment