git.delta.rocks / unique-network / refs/commits / 59683d4fb2c6

difftreelog

feat add evm event `CollectionChanged` for sub events : `CollectionPropertySet`, `CollectionPropertyDeleted`, `PropertyPermissionSet`

Trubnikov Sergey2022-12-06parent: #6c3810b.patch.diff
in: master

7 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
58 #[indexed]58 #[indexed]
59 collection_id: address,59 collection_id: address,
60 },60 },
61 /// The collection has been changed.
62 CollectionChanged {
63 /// Collection ID.
64 #[indexed]
65 collection_id: address,
66 },
61}67}
6268
63/// Does not always represent a full collection, for RFT it is either69/// Does not always represent a full collection, for RFT it is either
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
1036 .map_err(<Error<T>>::from)?;1036 .map_err(<Error<T>>::from)?;
10371037
1038 Self::deposit_event(Event::CollectionPropertySet(collection.id, property.key));1038 Self::deposit_event(Event::CollectionPropertySet(collection.id, property.key));
1039 <PalletEvm<T>>::deposit_log(
1040 erc::CollectionHelpersEvents::CollectionChanged {
1041 collection_id: eth::collection_id_to_address(collection.id),
1042 }
1043 .to_log(T::ContractAddress::get()),
1044 );
10391045
1040 Ok(())1046 Ok(())
1041 }1047 }
1115 collection.id,1121 collection.id,
1116 property_key,1122 property_key,
1117 ));1123 ));
1124 <PalletEvm<T>>::deposit_log(
1125 erc::CollectionHelpersEvents::CollectionChanged {
1126 collection_id: eth::collection_id_to_address(collection.id),
1127 }
1128 .to_log(T::ContractAddress::get()),
1129 );
11181130
1119 Ok(())1131 Ok(())
1120 }1132 }
1209 collection.id,1221 collection.id,
1210 property_permission.key,1222 property_permission.key,
1211 ));1223 ));
1224 <PalletEvm<T>>::deposit_log(
1225 erc::CollectionHelpersEvents::CollectionChanged {
1226 collection_id: eth::collection_id_to_address(collection.id),
1227 }
1228 .to_log(T::ContractAddress::get()),
1229 );
12121230
1213 Ok(())1231 Ok(())
1214 }1232 }
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
21contract CollectionHelpersEvents {21contract CollectionHelpersEvents {
22 event CollectionCreated(address indexed owner, address indexed collectionId);22 event CollectionCreated(address indexed owner, address indexed collectionId);
23 event CollectionDestroyed(address indexed collectionId);23 event CollectionDestroyed(address indexed collectionId);
24 event CollectionChanged(address indexed collectionId);
24}25}
2526
26/// @title Contract, which allows users to operate with collections27/// @title Contract, which allows users to operate with collections
modifiedtests/src/eth/abi/collectionHelpers.jsondiffbeforeafterboth
1[1[
2 {
3 "anonymous": false,
4 "inputs": [
5 {
6 "indexed": true,
7 "internalType": "address",
8 "name": "collectionId",
9 "type": "address"
10 }
11 ],
12 "name": "CollectionChanged",
13 "type": "event"
14 },
2 {15 {
3 "anonymous": false,16 "anonymous": false,
4 "inputs": [17 "inputs": [
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
16interface CollectionHelpersEvents {16interface CollectionHelpersEvents {
17 event CollectionCreated(address indexed owner, address indexed collectionId);17 event CollectionCreated(address indexed owner, address indexed collectionId);
18 event CollectionDestroyed(address indexed collectionId);18 event CollectionDestroyed(address indexed collectionId);
19 event CollectionChanged(address indexed collectionId);
19}20}
2021
21/// @title Contract, which allows users to operate with collections22/// @title Contract, which allows users to operate with collections
addedtests/src/eth/events.test.tsdiffbeforeafterboth

no changes