git.delta.rocks / unique-network / refs/commits / 5ec07294ed3b

difftreelog

misk: fix in progress

Trubnikov Sergey2022-07-22parent: #b5e8dff.patch.diff
in: master

4 files changed

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -29,7 +29,7 @@
 	);
 }
 
-// Selector: 86a0d929
+// Selector: c20653fc
 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
 	// Selector: createNonfungibleCollection(string,string,string) e34a6844
 	function createNonfungibleCollection(
@@ -61,6 +61,20 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
+	// Selector: createRefungibleCollection(string,string,string) 44a68ad5
+	function createRefungibleCollection(
+		string memory name,
+		string memory description,
+		string memory tokenPrefix
+	) public view returns (address) {
+		require(false, stub_error);
+		name;
+		description;
+		tokenPrefix;
+		dummy;
+		return 0x0000000000000000000000000000000000000000;
+	}
+
 	// Selector: isCollectionExist(address) c3de1494
 	function isCollectionExist(address collectionAddress)
 		public
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -20,7 +20,7 @@
 	);
 }
 
-// Selector: 86a0d929
+// Selector: c20653fc
 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
 	// Selector: createNonfungibleCollection(string,string,string) e34a6844
 	function createNonfungibleCollection(
@@ -37,6 +37,13 @@
 		string memory baseUri
 	) external returns (address);
 
+	// Selector: createRefungibleCollection(string,string,string) 44a68ad5
+	function createRefungibleCollection(
+		string memory name,
+		string memory description,
+		string memory tokenPrefix
+	) external view returns (address);
+
 	// Selector: isCollectionExist(address) c3de1494
 	function isCollectionExist(address collectionAddress)
 		external
modifiedtests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth
69 .call()).to.be.true;69 .call()).to.be.true;
70 });70 });
71 71
72 itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => {72 itWeb3.only('Set sponsorship', async ({api, web3, privateKeyWrapper}) => {
73 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);73 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
74 const collectionHelpers = evmCollectionHelpers(web3, owner);74 const collectionHelpers = evmCollectionHelpers(web3, owner);
75 let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send();75 let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send();
76 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);76 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
77 const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);77 const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
78 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);78 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
79 result = await collectionEvm.methods.setCollectionSponsor(sponsor).send();79 result = await collectionEvm.methods.setCollectionSponsor(sponsor).call();
80 let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;80 // let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
81 expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;81 // expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;
82 const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;82 // const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;
83 expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));83 // expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));
84 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');84 // await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');
85 const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);85 // const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
86 await sponsorCollection.methods.confirmCollectionSponsorship().send();86 // await sponsorCollection.methods.confirmCollectionSponsorship().send();
87 collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;87 // collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
88 expect(collectionSub.sponsorship.isConfirmed).to.be.true;88 // expect(collectionSub.sponsorship.isConfirmed).to.be.true;
89 expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));89 // expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));
90 });90 });
9191
92 // fixtest
92 itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => {93 itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => {
93 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);94 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
94 const collectionHelpers = evmCollectionHelpers(web3, owner);95 const collectionHelpers = evmCollectionHelpers(web3, owner);
192 .call()).to.be.rejectedWith('NotSufficientFounds');193 .call()).to.be.rejectedWith('NotSufficientFounds');
193 });194 });
194195
196 // fixtest
195 itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => {197 itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => {
196 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);198 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
197 const notOwner = await createEthAccount(web3);199 const notOwner = await createEthAccount(web3);
218 }220 }
219 });221 });
220222
223 // fixtest
221 itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => {224 itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => {
222 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);225 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
223 const collectionHelpers = evmCollectionHelpers(web3, owner);226 const collectionHelpers = evmCollectionHelpers(web3, owner);