difftreelog
Merge branch 'develop' into feature/autoseal-every-n-secs
in: master
4 files changed
runtime/opal/src/lib.rsdiffbeforeafterboth152 spec_name: create_runtime_str!(RUNTIME_NAME),152 spec_name: create_runtime_str!(RUNTIME_NAME),153 impl_name: create_runtime_str!(RUNTIME_NAME),153 impl_name: create_runtime_str!(RUNTIME_NAME),154 authoring_version: 1,154 authoring_version: 1,155 spec_version: 918000,155 spec_version: 918001,156 impl_version: 0,156 impl_version: 0,157 apis: RUNTIME_API_VERSIONS,157 apis: RUNTIME_API_VERSIONS,158 transaction_version: 1,158 transaction_version: 1,runtime/quartz/src/lib.rsdiffbeforeafterboth--- 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,
runtime/unique/src/lib.rsdiffbeforeafterboth--- 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,
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- /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,
+ },
+ },
+ ]);
+ });
+});