Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Aug 1, 2023
1 parent 423970f commit cfb3d3e
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion tests/grant-fund.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ describe("Grant Fund assertions", () => {
"transfer(address,uint256)",
"transfer(address,uint256)",
];

// use hardcoded output of encode("transfer(address,uint256)")
// as assembly script doesn't support encodeWithSelector
// 0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000
// ==
// (0xc91f4871cfDd1947DF6C23771F230853E0e27407, 1000 * 1e18)
const calldatas = [
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000"),
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000")
Expand Down Expand Up @@ -282,6 +288,12 @@ describe("Grant Fund assertions", () => {
"transfer(address,uint256)",
"transfer(address,uint256)",
];

// use hardcoded output of encode("transfer(address,uint256)")
// as assembly script doesn't support encodeWithSelector
// 0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000
// ==
// (0xc91f4871cfDd1947DF6C23771F230853E0e27407, 1000 * 1e18)
const calldatas = [
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000"),
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000")
Expand Down Expand Up @@ -400,6 +412,12 @@ describe("Grant Fund assertions", () => {
"transfer(address,uint256)",
"transfer(address,uint256)",
];

// use hardcoded output of encode("transfer(address,uint256)")
// as assembly script doesn't support encodeWithSelector
// 0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000
// ==
// (0xc91f4871cfDd1947DF6C23771F230853E0e27407, 1000 * 1e18)
const calldatas = [
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000"),
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000")
Expand Down Expand Up @@ -506,6 +524,12 @@ describe("Grant Fund assertions", () => {
"transfer(address,uint256)",
"transfer(address,uint256)",
];

// use hardcoded output of encode("transfer(address,uint256)")
// as assembly script doesn't support encodeWithSelector
// 0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000
// ==
// (0xc91f4871cfDd1947DF6C23771F230853E0e27407, 1000 * 1e18)
const calldatas = [
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000"),
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000")
Expand Down Expand Up @@ -703,10 +727,17 @@ describe("Grant Fund assertions", () => {
"transfer(address,uint256)",
"transfer(address,uint256)",
];

// use hardcoded output of encode("transfer(address,uint256)")
// as assembly script doesn't support encodeWithSelector
// 0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000
// ==
// (0xc91f4871cfDd1947DF6C23771F230853E0e27407, 1000 * 1e18)
const calldatas = [
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000"),
Bytes.fromHexString("0xa9059cbb000000000000000000000000c91f4871cfdd1947df6c23771f230853e0e2740700000000000000000000000000000000000000000000003635c9adc5dea00000")
];

const distributionId = ONE_BI;
const startBlock = ONE_BI;
const endBlock = startBlock.plus(DISTRIBUTION_PERIOD_LENGTH);
Expand Down Expand Up @@ -748,7 +779,6 @@ describe("Grant Fund assertions", () => {
const votesCast = BigInt.fromString("-234000000000000000000")
const reason = ""

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

mockGetVotesFunding(grantFundAddress, distributionId, voter, fundingVotingPower);
Expand Down

0 comments on commit cfb3d3e

Please sign in to comment.