Skip to content

Commit

Permalink
incorporate fees into calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
thesoftwarejedi committed Sep 30, 2021
1 parent 259b4f9 commit a6aebfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/reward-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ setProvider(provider);

describe('Multiuser Reward Pool', () => {

let EXPECTED_POOL_CREATE_COST = 12_551_920;
let EXPECTED_POOL_CREATE_COST = 12_546_920;

const rewardDuration = new anchor.BN(10);
const rewardDuration2 = new anchor.BN(30);
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('Multiuser Reward Pool', () => {
let endLamports = (await provider.connection.getBalance(funders[1].pubkey));
costInLamports = startLamports - endLamports;
console.log("Cost of creating a pool", (costInLamports / 1_000_000_000));
assert.equal(costInLamports, EXPECTED_POOL_CREATE_COST);
assert.equal(costInLamports, EXPECTED_POOL_CREATE_COST + 5_000); //5k tx fee

await funders[2].initializePool(poolKeypair3, rewardDuration3, true);
});
Expand Down Expand Up @@ -558,7 +558,7 @@ describe('Multiuser Reward Pool', () => {
let endLamports = (await provider.connection.getBalance(funders[1].pubkey));
let refundInLamports = endLamports - startLamports;
console.log("Refund when destroying a pool", (refundInLamports / 1_000_000_000));
assert.equal(refundInLamports, EXPECTED_POOL_CREATE_COST - 20_000); //20k in tx fees during test
assert.equal(refundInLamports, EXPECTED_POOL_CREATE_COST - 15_000); //15k in tx fees during close, unclear why not 10k


let pool = await provider.connection.getAccountInfo(funders[1].admin.poolKeypair.publicKey);
Expand Down

0 comments on commit a6aebfe

Please sign in to comment.