difftreelog
fix `set_token_properties`
in: master
5 files changed
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -155,7 +155,7 @@
&caller,
TokenId(token_id),
properties.into_iter(),
- <Pallet<T>>::token_exists(&self, TokenId(token_id)),
+ false,
&nesting_budget,
)
.map_err(dispatch_to_evm::<T>)
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -157,7 +157,7 @@
&caller,
TokenId(token_id),
properties.into_iter(),
- <Pallet<T>>::token_exists(&self, TokenId(token_id)),
+ false,
&nesting_budget,
)
.map_err(dispatch_to_evm::<T>)
tests/src/eth/abi/nonFungibleDeprecated.jsondiffbeforeafterboth99 "outputs": [],99 "outputs": [],100 "stateMutability": "nonpayable",100 "stateMutability": "nonpayable",101 "type": "function"101 "type": "function"102 }102 },103 {104 "inputs": [105 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },106 { "internalType": "string", "name": "key", "type": "string" }107 ],108 "name": "deleteProperty",109 "outputs": [],110 "stateMutability": "nonpayable",111 "type": "function"112 }103]113]104114tests/src/eth/abi/reFungibleDeprecated.jsondiffbeforeafterboth--- a/tests/src/eth/abi/reFungibleDeprecated.json
+++ b/tests/src/eth/abi/reFungibleDeprecated.json
@@ -88,5 +88,15 @@
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
+ { "internalType": "string", "name": "key", "type": "string" }
+ ],
+ "name": "deleteProperty",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
}
]
tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -273,12 +273,12 @@
{method: 'deleteProperty', methodParams: ['testKey_2']}, // FIXME: the method is gone?
{method: 'deleteProperties', methodParams: [['testKey_2']]},
].map(testCase =>
- itEth('Cannot delete properties of non-owned collection', async ({helper}) => {
+ itEth(`[${testCase.method}] Cannot delete properties of non-owned collection`, async ({helper}) => {
caller = await helper.eth.createAccountWithBalance(donor);
- collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, true);
+ collectionEvm = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(aliceCollection.collectionId), 'nft', caller, testCase.method == 'deleteProperty');
// Caller not an owner and not an admin, so he cannot set properties:
// FIXME: non owner and non admin can deleteProperties
- await helper.collection.addAdmin(alice, aliceCollection.collectionId, {Ethereum: caller});
+ // await helper.collection.addAdmin(alice, aliceCollection.collectionId, {Ethereum: caller});
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).call({from: caller})).to.be.rejectedWith('NoPermission');
await expect(collectionEvm.methods[testCase.method](token.tokenId, ...testCase.methodParams).send({from: caller})).to.be.rejected;