difftreelog
fix sponsoring tests
in: master
1 file changed
tests/src/eth/marketplace-v2/marketplace.test.tsdiffbeforeafterboth221 const buyerBalance = await helper.balance.getSubstrate(buyer.address);221 const buyerBalance = await helper.balance.getSubstrate(buyer.address);222 expect(buyerBalance).to.be.eq(600n * ONE_TOKEN);222 expect(buyerBalance).to.be.eq(600n * ONE_TOKEN);223 }223 }224 const buyerMirror = helper.address.substrateToEth(buyer.address);225 const buyerCross = helper.ethCrossAccount.fromKeyringPair(buyer);224 const buyerCross = helper.ethCrossAccount.fromKeyringPair(buyer);226 await helper.eth.transferBalanceFromSubstrate(donor, buyerMirror, PRICE, false);227225228 const buyerBalanceBefore = await helper.balance.getSubstrate(buyer.address);226 const buyerBalanceBefore = await helper.balance.getSubstrate(buyer.address);229 await helper.eth.sendEVM(buyer, market.options.address, market.methods.buy(collectionId, tokenId, 1, buyerCross).encodeABI(), PRICE.toString());227 await helper.eth.sendEVM(buyer, market.options.address, market.methods.buy(collectionId, tokenId, 1, buyerCross).encodeABI(), PRICE.toString());230 const buyerBalanceAfter = await helper.balance.getSubstrate(buyer.address);228 const buyerBalanceAfter = await helper.balance.getSubstrate(buyer.address);231 // Buyer balance not changed: transaction is sponsored229 // Buyer balance not changed: transaction is sponsored232 expect(buyerBalanceBefore).to.be.eq(buyerBalanceAfter);230 expect(buyerBalanceBefore).to.be.eq(buyerBalanceAfter + PRICE);233231234 const sellerBalanceAfterBuy = BigInt(await helper.balance.getSubstrate(seller.address));232 const sellerBalanceAfterBuy = BigInt(await helper.balance.getSubstrate(seller.address));235 ownerCross = await collection.methods.ownerOfCross(tokenId).call();233 ownerCross = await collection.methods.ownerOfCross(tokenId).call();