difftreelog
CORE-386 Fix names and tests
in: master
8 files changed
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -211,7 +211,7 @@
Ok(())
}
- #[solidity(rename_selector = "setNesting")]
+ #[solidity(rename_selector = "setCollectionNesting")]
fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result<void> {
check_is_owner_or_admin(caller, self)?;
let permissions = CollectionPermissions {
@@ -231,7 +231,7 @@
save(self)
}
- #[solidity(rename_selector = "setNesting")]
+ #[solidity(rename_selector = "setCollectionNesting")]
fn set_nesting(
&mut self,
caller: caller,
@@ -309,7 +309,7 @@
Ok(())
}
- fn set_mint_mode(&mut self, caller: caller, mode: bool) -> Result<void> {
+ fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result<void> {
check_is_owner_or_admin(caller, self)?;
let permissions = CollectionPermissions { mint_mode: Some(mode), .. Default::default() };
self.collection.permissions = <Pallet<T>>::clamp_permissions(
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -330,7 +330,7 @@
}
}
-// Selector: c0de6be0
+// Selector: 7d9262e6
contract Collection is Dummy, ERC165 {
// Selector: setCollectionProperty(string,bytes) 2f073f66
function setCollectionProperty(string memory key, bytes memory value)
@@ -427,15 +427,17 @@
dummy;
}
- // Selector: setNesting(bool) e8fc50dd
- function setNesting(bool enable) public {
+ // Selector: setCollectionNesting(bool) 112d4586
+ function setCollectionNesting(bool enable) public {
require(false, stub_error);
enable;
dummy = 0;
}
- // Selector: setNesting(bool,address[]) 7df12a9a
- function setNesting(bool enable, address[] memory collections) public {
+ // Selector: setCollectionNesting(bool,address[]) 64872396
+ function setCollectionNesting(bool enable, address[] memory collections)
+ public
+ {
require(false, stub_error);
enable;
collections;
@@ -463,8 +465,8 @@
dummy;
}
- // Selector: setMintMode(bool) 5dea9bd5
- function setMintMode(bool mode) public {
+ // Selector: setCollectionMintMode(bool) 00018e84
+ function setCollectionMintMode(bool mode) public {
require(false, stub_error);
mode;
dummy = 0;
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -191,7 +191,7 @@
function totalSupply() external view returns (uint256);
}
-// Selector: c0de6be0
+// Selector: 7d9262e6
interface Collection is Dummy, ERC165 {
// Selector: setCollectionProperty(string,bytes) 2f073f66
function setCollectionProperty(string memory key, bytes memory value)
@@ -235,11 +235,12 @@
// Selector: removeCollectionAdmin(address) fafd7b42
function removeCollectionAdmin(address admin) external view;
- // Selector: setNesting(bool) e8fc50dd
- function setNesting(bool enable) external;
+ // Selector: setCollectionNesting(bool) 112d4586
+ function setCollectionNesting(bool enable) external;
- // Selector: setNesting(bool,address[]) 7df12a9a
- function setNesting(bool enable, address[] memory collections) external;
+ // Selector: setCollectionNesting(bool,address[]) 64872396
+ function setCollectionNesting(bool enable, address[] memory collections)
+ external;
// Selector: setCollectionAccess(uint8) 41835d4c
function setCollectionAccess(uint8 mode) external;
@@ -250,8 +251,8 @@
// Selector: removeFromCollectionAllowList(address) 85c51acb
function removeFromCollectionAllowList(address user) external view;
- // Selector: setMintMode(bool) 5dea9bd5
- function setMintMode(bool mode) external;
+ // Selector: setCollectionMintMode(bool) 00018e84
+ function setCollectionMintMode(bool mode) external;
}
// Selector: d74d154f
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionAdmin.test.ts
+++ b/tests/src/eth/collectionAdmin.test.ts
@@ -25,8 +25,8 @@
} from './util/helpers';
describe('Add collection admins', () => {
- itWeb3('Add admin by owner', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('Add admin by owner', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -42,8 +42,8 @@
.to.be.eq(newAdmin.toLocaleLowerCase());
});
- itWeb3('Add substrate admin by owner', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('Add substrate admin by owner', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -60,8 +60,8 @@
.to.be.eq(newAdmin.address.toLocaleLowerCase());
});
- itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -69,7 +69,7 @@
.send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
- const admin = await createEthAccountWithBalance(api, web3);
+ const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdmin(admin).send();
@@ -83,8 +83,8 @@
.to.be.eq(admin.toLocaleLowerCase());
});
- itWeb3('(!negative tests!) Add admin by USER is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Add admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -92,7 +92,7 @@
.send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
- const notAdmin = await createEthAccountWithBalance(api, web3);
+ const notAdmin = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
const user = await createEthAccount(web3);
@@ -103,8 +103,8 @@
expect(adminList.length).to.be.eq(0);
});
- itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -112,7 +112,7 @@
.send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
- const admin = await createEthAccountWithBalance(api, web3);
+ const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdmin(admin).send();
@@ -126,8 +126,8 @@
.to.be.eq(admin.toLocaleLowerCase());
});
- itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -135,7 +135,7 @@
.send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
- const notAdmin0 = await createEthAccountWithBalance(api, web3);
+ const notAdmin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
const notAdmin1 = privateKey('//Alice');
await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0}))
@@ -147,8 +147,8 @@
});
describe('Remove collection admins', () => {
- itWeb3('Remove admin by owner', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('Remove admin by owner', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -171,8 +171,8 @@
expect(adminList.length).to.be.eq(0);
});
- itWeb3('Remove substrate admin by owner', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -194,8 +194,8 @@
expect(adminList.length).to.be.eq(0);
});
- itWeb3('(!negative tests!) Remove admin by ADMIN is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Remove admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -205,7 +205,7 @@
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
- const admin0 = await createEthAccountWithBalance(api, web3);
+ const admin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
await collectionEvm.methods.addCollectionAdmin(admin0).send();
const admin1 = await createEthAccount(web3);
await collectionEvm.methods.addCollectionAdmin(admin1).send();
@@ -221,8 +221,8 @@
}
});
- itWeb3('(!negative tests!) Remove admin by USER is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Remove admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -232,7 +232,7 @@
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
- const admin = await createEthAccountWithBalance(api, web3);
+ const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
await collectionEvm.methods.addCollectionAdmin(admin).send();
const notAdmin = await createEthAccount(web3);
@@ -246,8 +246,8 @@
}
});
- itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -258,7 +258,7 @@
const adminSub = privateKey('//Alice');
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();
- const adminEth = await createEthAccountWithBalance(api, web3);
+ const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
await collectionEvm.methods.addCollectionAdmin(adminEth).send();
await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth}))
@@ -271,8 +271,8 @@
.to.be.deep.contains(adminEth.toLocaleLowerCase());
});
- itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3}) => {
- const owner = await createEthAccountWithBalance(api, web3);
+ itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
@@ -283,7 +283,7 @@
const adminSub = privateKey('//Alice');
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send();
- const notAdminEth = await createEthAccountWithBalance(api, web3);
+ const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth}))
.to.be.rejectedWith('NoPermission');
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -250,7 +250,7 @@
await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});
await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner});
- await collectionEvm.methods.setMintMode(true).send({from: owner});
+ await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});
const newPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman();
expect(newPermissions.mintMode).to.be.true;
tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth1[2 {3 "anonymous": false,4 "inputs": [5 {6 "indexed": true,7 "internalType": "address",8 "name": "owner",9 "type": "address"10 },11 {12 "indexed": true,13 "internalType": "address",14 "name": "approved",15 "type": "address"16 },17 {18 "indexed": true,19 "internalType": "uint256",20 "name": "tokenId",21 "type": "uint256"22 }23 ],24 "name": "Approval",25 "type": "event"26 },27 {28 "anonymous": false,29 "inputs": [30 {31 "indexed": true,32 "internalType": "address",33 "name": "owner",34 "type": "address"35 },36 {37 "indexed": true,38 "internalType": "address",39 "name": "operator",40 "type": "address"41 },42 {43 "indexed": false,44 "internalType": "bool",45 "name": "approved",46 "type": "bool"47 }48 ],49 "name": "ApprovalForAll",50 "type": "event"51 },52 {53 "anonymous": false,54 "inputs": [],55 "name": "MintingFinished",56 "type": "event"57 },58 {59 "anonymous": false,60 "inputs": [61 {62 "indexed": true,63 "internalType": "address",64 "name": "from",65 "type": "address"66 },67 {68 "indexed": true,69 "internalType": "address",70 "name": "to",71 "type": "address"72 },73 {74 "indexed": true,75 "internalType": "uint256",76 "name": "tokenId",77 "type": "uint256"78 }79 ],80 "name": "Transfer",81 "type": "event"82 },83 {84 "inputs": [85 { "internalType": "address", "name": "newAdmin", "type": "address" }86 ],87 "name": "addCollectionAdmin",88 "outputs": [],89 "stateMutability": "view",90 "type": "function"91 },92 {93 "inputs": [94 { "internalType": "uint256", "name": "newAdmin", "type": "uint256" }95 ],96 "name": "addCollectionAdminSubstrate",97 "outputs": [],98 "stateMutability": "view",99 "type": "function"100 },101 {102 "inputs": [103 { "internalType": "address", "name": "user", "type": "address" }104 ],105 "name": "addToCollectionAllowList",106 "outputs": [],107 "stateMutability": "view",108 "type": "function"109 },110 {111 "inputs": [112 { "internalType": "address", "name": "approved", "type": "address" },113 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }114 ],115 "name": "approve",116 "outputs": [],117 "stateMutability": "nonpayable",118 "type": "function"119 },120 {121 "inputs": [122 { "internalType": "address", "name": "owner", "type": "address" }123 ],124 "name": "balanceOf",125 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],126 "stateMutability": "view",127 "type": "function"128 },129 {130 "inputs": [131 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }132 ],133 "name": "burn",134 "outputs": [],135 "stateMutability": "nonpayable",136 "type": "function"137 },138 {139 "inputs": [140 { "internalType": "address", "name": "from", "type": "address" },141 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }142 ],143 "name": "burnFrom",144 "outputs": [],145 "stateMutability": "nonpayable",146 "type": "function"147 },148 {149 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],150 "name": "collectionProperty",151 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],152 "stateMutability": "view",153 "type": "function"154 },155 {156 "inputs": [],157 "name": "confirmCollectionSponsorship",158 "outputs": [],159 "stateMutability": "nonpayable",160 "type": "function"161 },162 {163 "inputs": [],164 "name": "contractAddress",165 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],166 "stateMutability": "view",167 "type": "function"168 },169 {170 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],171 "name": "deleteCollectionProperty",172 "outputs": [],173 "stateMutability": "nonpayable",174 "type": "function"175 },176 {177 "inputs": [178 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },179 { "internalType": "string", "name": "key", "type": "string" }180 ],181 "name": "deleteProperty",182 "outputs": [],183 "stateMutability": "nonpayable",184 "type": "function"185 },186 {187 "inputs": [],188 "name": "finishMinting",189 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],190 "stateMutability": "nonpayable",191 "type": "function"192 },193 {194 "inputs": [195 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }196 ],197 "name": "getApproved",198 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],199 "stateMutability": "view",200 "type": "function"201 },202 {203 "inputs": [204 { "internalType": "address", "name": "owner", "type": "address" },205 { "internalType": "address", "name": "operator", "type": "address" }206 ],207 "name": "isApprovedForAll",208 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],209 "stateMutability": "view",210 "type": "function"211 },212 {213 "inputs": [214 { "internalType": "address", "name": "to", "type": "address" },215 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }216 ],217 "name": "mint",218 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],219 "stateMutability": "nonpayable",220 "type": "function"221 },222 {223 "inputs": [224 { "internalType": "address", "name": "to", "type": "address" },225 { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }226 ],227 "name": "mintBulk",228 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],229 "stateMutability": "nonpayable",230 "type": "function"231 },232 {233 "inputs": [234 { "internalType": "address", "name": "to", "type": "address" },235 {236 "components": [237 { "internalType": "uint256", "name": "field_0", "type": "uint256" },238 { "internalType": "string", "name": "field_1", "type": "string" }239 ],240 "internalType": "struct Tuple0[]",241 "name": "tokens",242 "type": "tuple[]"243 }244 ],245 "name": "mintBulkWithTokenURI",246 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],247 "stateMutability": "nonpayable",248 "type": "function"249 },250 {251 "inputs": [252 { "internalType": "address", "name": "to", "type": "address" },253 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },254 { "internalType": "string", "name": "tokenUri", "type": "string" }255 ],256 "name": "mintWithTokenURI",257 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],258 "stateMutability": "nonpayable",259 "type": "function"260 },261 {262 "inputs": [],263 "name": "mintingFinished",264 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],265 "stateMutability": "view",266 "type": "function"267 },268 {269 "inputs": [],270 "name": "name",271 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],272 "stateMutability": "view",273 "type": "function"274 },275 {276 "inputs": [],277 "name": "nextTokenId",278 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],279 "stateMutability": "view",280 "type": "function"281 },282 {283 "inputs": [284 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }285 ],286 "name": "ownerOf",287 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],288 "stateMutability": "view",289 "type": "function"290 },291 {292 "inputs": [293 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },294 { "internalType": "string", "name": "key", "type": "string" }295 ],296 "name": "property",297 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],298 "stateMutability": "view",299 "type": "function"300 },301 {302 "inputs": [303 { "internalType": "address", "name": "admin", "type": "address" }304 ],305 "name": "removeCollectionAdmin",306 "outputs": [],307 "stateMutability": "view",308 "type": "function"309 },310 {311 "inputs": [312 { "internalType": "uint256", "name": "newAdmin", "type": "uint256" }313 ],314 "name": "removeCollectionAdminSubstrate",315 "outputs": [],316 "stateMutability": "view",317 "type": "function"318 },319 {320 "inputs": [321 { "internalType": "address", "name": "user", "type": "address" }322 ],323 "name": "removeFromCollectionAllowList",324 "outputs": [],325 "stateMutability": "view",326 "type": "function"327 },328 {329 "inputs": [330 { "internalType": "address", "name": "from", "type": "address" },331 { "internalType": "address", "name": "to", "type": "address" },332 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }333 ],334 "name": "safeTransferFrom",335 "outputs": [],336 "stateMutability": "nonpayable",337 "type": "function"338 },339 {340 "inputs": [341 { "internalType": "address", "name": "from", "type": "address" },342 { "internalType": "address", "name": "to", "type": "address" },343 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },344 { "internalType": "bytes", "name": "data", "type": "bytes" }345 ],346 "name": "safeTransferFromWithData",347 "outputs": [],348 "stateMutability": "nonpayable",349 "type": "function"350 },351 {352 "inputs": [353 { "internalType": "address", "name": "operator", "type": "address" },354 { "internalType": "bool", "name": "approved", "type": "bool" }355 ],356 "name": "setApprovalForAll",357 "outputs": [],358 "stateMutability": "nonpayable",359 "type": "function"360 },361 {362 "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }],363 "name": "setCollectionAccess",364 "outputs": [],365 "stateMutability": "nonpayable",366 "type": "function"367 },368 {369 "inputs": [370 { "internalType": "string", "name": "limit", "type": "string" },371 { "internalType": "uint32", "name": "value", "type": "uint32" }372 ],373 "name": "setCollectionLimit",374 "outputs": [],375 "stateMutability": "nonpayable",376 "type": "function"377 },378 {379 "inputs": [380 { "internalType": "string", "name": "limit", "type": "string" },381 { "internalType": "bool", "name": "value", "type": "bool" }382 ],383 "name": "setCollectionLimit",384 "outputs": [],385 "stateMutability": "nonpayable",386 "type": "function"387 },388 {389 "inputs": [390 { "internalType": "string", "name": "key", "type": "string" },391 { "internalType": "bytes", "name": "value", "type": "bytes" }392 ],393 "name": "setCollectionProperty",394 "outputs": [],395 "stateMutability": "nonpayable",396 "type": "function"397 },398 {399 "inputs": [400 { "internalType": "address", "name": "sponsor", "type": "address" }401 ],402 "name": "setCollectionSponsor",403 "outputs": [],404 "stateMutability": "nonpayable",405 "type": "function"406 },407 {408 "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],409 "name": "setMintMode",410 "outputs": [],411 "stateMutability": "nonpayable",412 "type": "function"413 },414 {415 "inputs": [416 { "internalType": "bool", "name": "enable", "type": "bool" },417 {418 "internalType": "address[]",419 "name": "collections",420 "type": "address[]"421 }422 ],423 "name": "setNesting",424 "outputs": [],425 "stateMutability": "nonpayable",426 "type": "function"427 },428 {429 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],430 "name": "setNesting",431 "outputs": [],432 "stateMutability": "nonpayable",433 "type": "function"434 },435 {436 "inputs": [437 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },438 { "internalType": "string", "name": "key", "type": "string" },439 { "internalType": "bytes", "name": "value", "type": "bytes" }440 ],441 "name": "setProperty",442 "outputs": [],443 "stateMutability": "nonpayable",444 "type": "function"445 },446 {447 "inputs": [448 { "internalType": "string", "name": "key", "type": "string" },449 { "internalType": "bool", "name": "isMutable", "type": "bool" },450 { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },451 { "internalType": "bool", "name": "tokenOwner", "type": "bool" }452 ],453 "name": "setTokenPropertyPermission",454 "outputs": [],455 "stateMutability": "nonpayable",456 "type": "function"457 },458 {459 "inputs": [460 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }461 ],462 "name": "supportsInterface",463 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],464 "stateMutability": "view",465 "type": "function"466 },467 {468 "inputs": [],469 "name": "symbol",470 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],471 "stateMutability": "view",472 "type": "function"473 },474 {475 "inputs": [476 { "internalType": "uint256", "name": "index", "type": "uint256" }477 ],478 "name": "tokenByIndex",479 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],480 "stateMutability": "view",481 "type": "function"482 },483 {484 "inputs": [485 { "internalType": "address", "name": "owner", "type": "address" },486 { "internalType": "uint256", "name": "index", "type": "uint256" }487 ],488 "name": "tokenOfOwnerByIndex",489 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],490 "stateMutability": "view",491 "type": "function"492 },493 {494 "inputs": [495 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }496 ],497 "name": "tokenURI",498 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],499 "stateMutability": "view",500 "type": "function"501 },502 {503 "inputs": [],504 "name": "totalSupply",505 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],506 "stateMutability": "view",507 "type": "function"508 },509 {510 "inputs": [511 { "internalType": "address", "name": "to", "type": "address" },512 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }513 ],514 "name": "transfer",515 "outputs": [],516 "stateMutability": "nonpayable",517 "type": "function"518 },519 {520 "inputs": [521 { "internalType": "address", "name": "from", "type": "address" },522 { "internalType": "address", "name": "to", "type": "address" },523 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }524 ],525 "name": "transferFrom",526 "outputs": [],527 "stateMutability": "nonpayable",528 "type": "function"529 }530]1[2 {3 "anonymous": false,4 "inputs": [5 {6 "indexed": true,7 "internalType": "address",8 "name": "owner",9 "type": "address"10 },11 {12 "indexed": true,13 "internalType": "address",14 "name": "approved",15 "type": "address"16 },17 {18 "indexed": true,19 "internalType": "uint256",20 "name": "tokenId",21 "type": "uint256"22 }23 ],24 "name": "Approval",25 "type": "event"26 },27 {28 "anonymous": false,29 "inputs": [30 {31 "indexed": true,32 "internalType": "address",33 "name": "owner",34 "type": "address"35 },36 {37 "indexed": true,38 "internalType": "address",39 "name": "operator",40 "type": "address"41 },42 {43 "indexed": false,44 "internalType": "bool",45 "name": "approved",46 "type": "bool"47 }48 ],49 "name": "ApprovalForAll",50 "type": "event"51 },52 {53 "anonymous": false,54 "inputs": [],55 "name": "MintingFinished",56 "type": "event"57 },58 {59 "anonymous": false,60 "inputs": [61 {62 "indexed": true,63 "internalType": "address",64 "name": "from",65 "type": "address"66 },67 {68 "indexed": true,69 "internalType": "address",70 "name": "to",71 "type": "address"72 },73 {74 "indexed": true,75 "internalType": "uint256",76 "name": "tokenId",77 "type": "uint256"78 }79 ],80 "name": "Transfer",81 "type": "event"82 },83 {84 "inputs": [85 { "internalType": "address", "name": "newAdmin", "type": "address" }86 ],87 "name": "addCollectionAdmin",88 "outputs": [],89 "stateMutability": "view",90 "type": "function"91 },92 {93 "inputs": [94 { "internalType": "uint256", "name": "newAdmin", "type": "uint256" }95 ],96 "name": "addCollectionAdminSubstrate",97 "outputs": [],98 "stateMutability": "view",99 "type": "function"100 },101 {102 "inputs": [103 { "internalType": "address", "name": "user", "type": "address" }104 ],105 "name": "addToCollectionAllowList",106 "outputs": [],107 "stateMutability": "view",108 "type": "function"109 },110 {111 "inputs": [112 { "internalType": "address", "name": "approved", "type": "address" },113 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }114 ],115 "name": "approve",116 "outputs": [],117 "stateMutability": "nonpayable",118 "type": "function"119 },120 {121 "inputs": [122 { "internalType": "address", "name": "owner", "type": "address" }123 ],124 "name": "balanceOf",125 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],126 "stateMutability": "view",127 "type": "function"128 },129 {130 "inputs": [131 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }132 ],133 "name": "burn",134 "outputs": [],135 "stateMutability": "nonpayable",136 "type": "function"137 },138 {139 "inputs": [140 { "internalType": "address", "name": "from", "type": "address" },141 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }142 ],143 "name": "burnFrom",144 "outputs": [],145 "stateMutability": "nonpayable",146 "type": "function"147 },148 {149 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],150 "name": "collectionProperty",151 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],152 "stateMutability": "view",153 "type": "function"154 },155 {156 "inputs": [],157 "name": "confirmCollectionSponsorship",158 "outputs": [],159 "stateMutability": "nonpayable",160 "type": "function"161 },162 {163 "inputs": [],164 "name": "contractAddress",165 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],166 "stateMutability": "view",167 "type": "function"168 },169 {170 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],171 "name": "deleteCollectionProperty",172 "outputs": [],173 "stateMutability": "nonpayable",174 "type": "function"175 },176 {177 "inputs": [178 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },179 { "internalType": "string", "name": "key", "type": "string" }180 ],181 "name": "deleteProperty",182 "outputs": [],183 "stateMutability": "nonpayable",184 "type": "function"185 },186 {187 "inputs": [],188 "name": "finishMinting",189 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],190 "stateMutability": "nonpayable",191 "type": "function"192 },193 {194 "inputs": [195 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }196 ],197 "name": "getApproved",198 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],199 "stateMutability": "view",200 "type": "function"201 },202 {203 "inputs": [204 { "internalType": "address", "name": "owner", "type": "address" },205 { "internalType": "address", "name": "operator", "type": "address" }206 ],207 "name": "isApprovedForAll",208 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],209 "stateMutability": "view",210 "type": "function"211 },212 {213 "inputs": [214 { "internalType": "address", "name": "to", "type": "address" },215 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }216 ],217 "name": "mint",218 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],219 "stateMutability": "nonpayable",220 "type": "function"221 },222 {223 "inputs": [224 { "internalType": "address", "name": "to", "type": "address" },225 { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" }226 ],227 "name": "mintBulk",228 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],229 "stateMutability": "nonpayable",230 "type": "function"231 },232 {233 "inputs": [234 { "internalType": "address", "name": "to", "type": "address" },235 {236 "components": [237 { "internalType": "uint256", "name": "field_0", "type": "uint256" },238 { "internalType": "string", "name": "field_1", "type": "string" }239 ],240 "internalType": "struct Tuple0[]",241 "name": "tokens",242 "type": "tuple[]"243 }244 ],245 "name": "mintBulkWithTokenURI",246 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],247 "stateMutability": "nonpayable",248 "type": "function"249 },250 {251 "inputs": [252 { "internalType": "address", "name": "to", "type": "address" },253 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },254 { "internalType": "string", "name": "tokenUri", "type": "string" }255 ],256 "name": "mintWithTokenURI",257 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],258 "stateMutability": "nonpayable",259 "type": "function"260 },261 {262 "inputs": [],263 "name": "mintingFinished",264 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],265 "stateMutability": "view",266 "type": "function"267 },268 {269 "inputs": [],270 "name": "name",271 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],272 "stateMutability": "view",273 "type": "function"274 },275 {276 "inputs": [],277 "name": "nextTokenId",278 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],279 "stateMutability": "view",280 "type": "function"281 },282 {283 "inputs": [284 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }285 ],286 "name": "ownerOf",287 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],288 "stateMutability": "view",289 "type": "function"290 },291 {292 "inputs": [293 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },294 { "internalType": "string", "name": "key", "type": "string" }295 ],296 "name": "property",297 "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],298 "stateMutability": "view",299 "type": "function"300 },301 {302 "inputs": [303 { "internalType": "address", "name": "admin", "type": "address" }304 ],305 "name": "removeCollectionAdmin",306 "outputs": [],307 "stateMutability": "view",308 "type": "function"309 },310 {311 "inputs": [312 { "internalType": "uint256", "name": "newAdmin", "type": "uint256" }313 ],314 "name": "removeCollectionAdminSubstrate",315 "outputs": [],316 "stateMutability": "view",317 "type": "function"318 },319 {320 "inputs": [321 { "internalType": "address", "name": "user", "type": "address" }322 ],323 "name": "removeFromCollectionAllowList",324 "outputs": [],325 "stateMutability": "view",326 "type": "function"327 },328 {329 "inputs": [330 { "internalType": "address", "name": "from", "type": "address" },331 { "internalType": "address", "name": "to", "type": "address" },332 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }333 ],334 "name": "safeTransferFrom",335 "outputs": [],336 "stateMutability": "nonpayable",337 "type": "function"338 },339 {340 "inputs": [341 { "internalType": "address", "name": "from", "type": "address" },342 { "internalType": "address", "name": "to", "type": "address" },343 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },344 { "internalType": "bytes", "name": "data", "type": "bytes" }345 ],346 "name": "safeTransferFromWithData",347 "outputs": [],348 "stateMutability": "nonpayable",349 "type": "function"350 },351 {352 "inputs": [353 { "internalType": "address", "name": "operator", "type": "address" },354 { "internalType": "bool", "name": "approved", "type": "bool" }355 ],356 "name": "setApprovalForAll",357 "outputs": [],358 "stateMutability": "nonpayable",359 "type": "function"360 },361 {362 "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }],363 "name": "setCollectionAccess",364 "outputs": [],365 "stateMutability": "nonpayable",366 "type": "function"367 },368 {369 "inputs": [370 { "internalType": "string", "name": "limit", "type": "string" },371 { "internalType": "uint32", "name": "value", "type": "uint32" }372 ],373 "name": "setCollectionLimit",374 "outputs": [],375 "stateMutability": "nonpayable",376 "type": "function"377 },378 {379 "inputs": [380 { "internalType": "string", "name": "limit", "type": "string" },381 { "internalType": "bool", "name": "value", "type": "bool" }382 ],383 "name": "setCollectionLimit",384 "outputs": [],385 "stateMutability": "nonpayable",386 "type": "function"387 },388 {389 "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],390 "name": "setCollectionMintMode",391 "outputs": [],392 "stateMutability": "nonpayable",393 "type": "function"394 },395 {396 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],397 "name": "setCollectionNesting",398 "outputs": [],399 "stateMutability": "nonpayable",400 "type": "function"401 },402 {403 "inputs": [404 { "internalType": "bool", "name": "enable", "type": "bool" },405 {406 "internalType": "address[]",407 "name": "collections",408 "type": "address[]"409 }410 ],411 "name": "setCollectionNesting",412 "outputs": [],413 "stateMutability": "nonpayable",414 "type": "function"415 },416 {417 "inputs": [418 { "internalType": "string", "name": "key", "type": "string" },419 { "internalType": "bytes", "name": "value", "type": "bytes" }420 ],421 "name": "setCollectionProperty",422 "outputs": [],423 "stateMutability": "nonpayable",424 "type": "function"425 },426 {427 "inputs": [428 { "internalType": "address", "name": "sponsor", "type": "address" }429 ],430 "name": "setCollectionSponsor",431 "outputs": [],432 "stateMutability": "nonpayable",433 "type": "function"434 },435 {436 "inputs": [437 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },438 { "internalType": "string", "name": "key", "type": "string" },439 { "internalType": "bytes", "name": "value", "type": "bytes" }440 ],441 "name": "setProperty",442 "outputs": [],443 "stateMutability": "nonpayable",444 "type": "function"445 },446 {447 "inputs": [448 { "internalType": "string", "name": "key", "type": "string" },449 { "internalType": "bool", "name": "isMutable", "type": "bool" },450 { "internalType": "bool", "name": "collectionAdmin", "type": "bool" },451 { "internalType": "bool", "name": "tokenOwner", "type": "bool" }452 ],453 "name": "setTokenPropertyPermission",454 "outputs": [],455 "stateMutability": "nonpayable",456 "type": "function"457 },458 {459 "inputs": [460 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }461 ],462 "name": "supportsInterface",463 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],464 "stateMutability": "view",465 "type": "function"466 },467 {468 "inputs": [],469 "name": "symbol",470 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],471 "stateMutability": "view",472 "type": "function"473 },474 {475 "inputs": [476 { "internalType": "uint256", "name": "index", "type": "uint256" }477 ],478 "name": "tokenByIndex",479 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],480 "stateMutability": "view",481 "type": "function"482 },483 {484 "inputs": [485 { "internalType": "address", "name": "owner", "type": "address" },486 { "internalType": "uint256", "name": "index", "type": "uint256" }487 ],488 "name": "tokenOfOwnerByIndex",489 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],490 "stateMutability": "view",491 "type": "function"492 },493 {494 "inputs": [495 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }496 ],497 "name": "tokenURI",498 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],499 "stateMutability": "view",500 "type": "function"501 },502 {503 "inputs": [],504 "name": "totalSupply",505 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],506 "stateMutability": "view",507 "type": "function"508 },509 {510 "inputs": [511 { "internalType": "address", "name": "to", "type": "address" },512 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }513 ],514 "name": "transfer",515 "outputs": [],516 "stateMutability": "nonpayable",517 "type": "function"518 },519 {520 "inputs": [521 { "internalType": "address", "name": "from", "type": "address" },522 { "internalType": "address", "name": "to", "type": "address" },523 { "internalType": "uint256", "name": "tokenId", "type": "uint256" }524 ],525 "name": "transferFrom",526 "outputs": [],527 "stateMutability": "nonpayable",528 "type": "function"529 }530]tests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/removeCollectionAdmin.test.ts
+++ b/tests/src/removeCollectionAdmin.test.ts
@@ -111,18 +111,24 @@
});
});
- it('Admin can\'t remove collection admin.', async () => {
+ it.only('Admin can\'t remove collection admin.', async () => {
await usingApi(async (api, privateKeyWrapper) => {
const collectionId = await createCollectionExpectSuccess();
const alice = privateKeyWrapper('//Alice');
const bob = privateKeyWrapper('//Bob');
const charlie = privateKeyWrapper('//Charlie');
+ const addBobAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address));
+ await submitTransactionAsync(alice, addBobAdminTx);
+ const addCharlieAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(charlie.address));
+ await submitTransactionAsync(alice, addCharlieAdminTx);
+
const adminListAfterAddAdmin = await getAdminList(api, collectionId);
expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(bob.address));
+ expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(charlie.address));
const removeAdminTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address));
- await expect(submitTransactionAsync(charlie, removeAdminTx)).to.be.rejected;
+ await expect(submitTransactionExpectFailAsync(charlie, removeAdminTx)).to.be.rejected;
const adminListAfterRemoveAdmin = await getAdminList(api, collectionId);
expect(adminListAfterRemoveAdmin).to.be.deep.contains(normalizeAccountId(bob.address));