Skip to content

Commit

Permalink
update params in testFundedSlate
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Jul 27, 2023
1 parent 4e9be34 commit 4aeed14
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/grant-fund.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ describe("Grant Fund assertions", () => {
];
const paramsArray: Array<ethereum.Value> = [
ethereum.Value.fromAddress(proposer),
ethereum.Value.fromUnsignedBigInt(ONE_BI),
ethereum.Value.fromUnsignedBigInt(BigInt.fromString("1000000000000000000000")), // 1000 * 1e18
];
const params = changetype<ethereum.Tuple>(paramsArray)
const encodedparamsOne = ethereum.encode(ethereum.Value.fromTuple(params))!;
Expand Down Expand Up @@ -780,15 +780,14 @@ describe("Grant Fund assertions", () => {

// mock parameters
const voter = Address.fromString("0x0000000000000000000000000000000000000050");
let votesCast = BigInt.fromI32(-234);
const votesCast = BigInt.fromString("-234000000000000000000")
const reason = ""

// TODO: need to convert back from WAD
const fundingVotingPower = votesCast.times(votesCast);

mockGetVotesFunding(grantFundAddress, distributionId, voter, fundingVotingPower);

votesCast = BigInt.fromI32(-234);
const fundingVoteCastEvent = createVoteCastEvent(voter, proposalId, 0, votesCast, reason, startBlock.plus(SCREENING_PERIOD_LENGTH).plus(BigInt.fromI32(1)), BigInt.fromI32(1));
handleVoteCast(fundingVoteCastEvent);

Expand All @@ -804,6 +803,8 @@ describe("Grant Fund assertions", () => {
const updateSlateEvent = createFundedSlateUpdatedEvent(distributionId, fundedSlateHash)
handleFundedSlateUpdated(updateSlateEvent);

logStore();

/********************/
/*** Assert State ***/
/********************/
Expand All @@ -829,7 +830,7 @@ describe("Grant Fund assertions", () => {
"FundedSlate",
`${fundedSlateHash.toHexString()}`,
"totalTokensRequested",
`${wadToDecimal(BigInt.fromI32(2))}`
`${wadToDecimal(BigInt.fromString("2000000000000000000000"))}` // 1000 * 1e18
);
});
});

0 comments on commit 4aeed14

Please sign in to comment.