--- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -152,7 +152,7 @@ spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 918000, + spec_version: 918001, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -152,7 +152,7 @@ spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 918000, + spec_version: 918001, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -151,7 +151,7 @@ spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 918000, + spec_version: 918001, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, --- /dev/null +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -0,0 +1,43 @@ +import privateKey from '../substrate/privateKey'; +import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, setCollectionSponsorExpectSuccess} from '../util/helpers'; +import {itWeb3, transferBalanceToEth, subToEth, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents} from './util/helpers'; +import nonFungibleAbi from './nonFungibleAbi.json'; +import {expect} from 'chai'; + +describe('evm collection sponsoring', () => { + itWeb3('sponsors mint transactions', async ({api, web3}) => { + const alice = privateKey('//Alice'); + + const collection = await createCollectionExpectSuccess(); + await setCollectionSponsorExpectSuccess(collection, alice.address); + await confirmSponsorshipExpectSuccess(collection); + + // Wouldn't be needed after CORE-300 + await transferBalanceToEth(api, alice, subToEth(alice.address)); + + const minter = createEthAccount(web3); + expect(await web3.eth.getBalance(minter)).to.equal('0'); + + const address = collectionIdToAddress(collection); + const contract = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection), {from: minter, ...GAS_ARGS}); + + await enablePublicMintingExpectSuccess(alice, collection); + await addToAllowListExpectSuccess(alice, collection, {Ethereum: minter}); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.equal('1'); + const result = await contract.methods.mint(minter, nextTokenId).send(); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: minter, + tokenId: nextTokenId, + }, + }, + ]); + }); +});