Skip to content

Commit

Permalink
add sponsored value and check emission of events
Browse files Browse the repository at this point in the history
  • Loading branch information
gfournieriExec committed Apr 30, 2024
1 parent c57eee2 commit c8ea51e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/beacon/Voucher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ describe('Voucher', function () {
});
describe('Match orders boost', async function () {
it('Should match orders boost with full sponsored amount', async () => {
const sponsoredValue = BigInt(appPrice + datasetPrice + workerpoolPrice);
for (const asset of [app, dataset, workerpool]) {
await voucherHubWithAssetEligibilityManagerSigner
.addEligibleAsset(voucherType, asset)
Expand All @@ -419,7 +420,6 @@ describe('Voucher', function () {
const voucherInitialCreditBalance = await voucher.getBalance();
const voucherInitialSrlcBalance = await getVoucherBalanceOnIexecPoco();
const requesterInitialSrlcBalance = await getRequesterBalanceOnIexecPoco();

expect(
await voucherWithOwnerSigner.matchOrdersBoost.staticCall(
appOrder,
Expand All @@ -437,7 +437,11 @@ describe('Voucher', function () {
),
)
.to.emit(voucher, 'OrdersBoostMatchedWithVoucher')
.withArgs(dealId);
.withArgs(dealId)
.to.emit(voucherHub, 'VoucherDebited')
.withArgs(await voucher.getAddress(), sponsoredValue)
.to.emit(voucherHub, 'Transfer')
.withArgs(await voucher.getAddress(), ethers.ZeroAddress, sponsoredValue);
expect(await voucher.getBalance())
.to.be.equal(voucherInitialCreditBalance - dealPrice)
.to.be.equal(await getVoucherBalanceOnIexecPoco())
Expand Down

0 comments on commit c8ea51e

Please sign in to comment.