Skip to content

Commit

Permalink
fix: sponsoring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigoriy Simonov authored and CertainLach committed Jul 11, 2023
1 parent 83d67e5 commit 83605d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/src/eth/marketplace-v2/marketplace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,13 @@ describe('Market V2 Contract', () => {
const buyerBalance = await helper.balance.getSubstrate(buyer.address);
expect(buyerBalance).to.be.eq(600n * ONE_TOKEN);
}
const buyerMirror = helper.address.substrateToEth(buyer.address);
const buyerCross = helper.ethCrossAccount.fromKeyringPair(buyer);
await helper.eth.transferBalanceFromSubstrate(donor, buyerMirror, PRICE, false);

const buyerBalanceBefore = await helper.balance.getSubstrate(buyer.address);
await helper.eth.sendEVM(buyer, market.options.address, market.methods.buy(collectionId, tokenId, 1, buyerCross).encodeABI(), PRICE.toString());
const buyerBalanceAfter = await helper.balance.getSubstrate(buyer.address);
// Buyer balance not changed: transaction is sponsored
expect(buyerBalanceBefore).to.be.eq(buyerBalanceAfter);
expect(buyerBalanceBefore).to.be.eq(buyerBalanceAfter + PRICE);

const sellerBalanceAfterBuy = BigInt(await helper.balance.getSubstrate(seller.address));
ownerCross = await collection.methods.ownerOfCross(tokenId).call();
Expand Down

0 comments on commit 83605d4

Please sign in to comment.