git.delta.rocks / unique-network / refs/commits / c09c218e2bcd

difftreelog

Merge pull request #134 from usetech-llc/NFTPAR-384_approve_transfer_from_events

Greg Zaitsev2021-03-22parents: #e4dd4c0 #ec67731.patch.diff
in: master
Emit approve/transferFrom events

1 file changed

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
654 /// * amount: Always 1 for NFT654 /// * amount: Always 1 for NFT
655 Transfer(CollectionId, TokenId, AccountId, AccountId, u128),655 Transfer(CollectionId, TokenId, AccountId, AccountId, u128),
656
657 /// * collection_id
658 ///
659 /// * item_id
660 ///
661 /// * sender
662 ///
663 /// * spender
664 ///
665 /// * amount
666 Approved(CollectionId, TokenId, AccountId, AccountId, u128),
656 }667 }
657);668);
658669
1292 }1303 }
1293 <Allowances<T>>::insert(collection_id, (item_id, sender.clone(), spender.clone()), allowance);1304 <Allowances<T>>::insert(collection_id, (item_id, sender.clone(), spender.clone()), allowance);
12941305
1306 Self::deposit_event(RawEvent::Approved(target_collection.id, item_id, sender, spender, allowance));
1295 Ok(())1307 Ok(())
1296 }1308 }
1297 1309
13591371
1360 match target_collection.mode1372 match target_collection.mode
1361 {1373 {
1362 CollectionMode::NFT => Self::transfer_nft(&target_collection, item_id, from, recipient)?,1374 CollectionMode::NFT => Self::transfer_nft(&target_collection, item_id, from.clone(), recipient.clone())?,
1363 CollectionMode::Fungible(_) => Self::transfer_fungible(&target_collection, value, &from, &recipient)?,1375 CollectionMode::Fungible(_) => Self::transfer_fungible(&target_collection, value, &from, &recipient)?,
1364 CollectionMode::ReFungible => Self::transfer_refungible(&target_collection, item_id, value, from.clone(), recipient)?,1376 CollectionMode::ReFungible => Self::transfer_refungible(&target_collection, item_id, value, from.clone(), recipient.clone())?,
1365 _ => ()1377 _ => ()
1366 };1378 };
13671379
1380 Self::deposit_event(RawEvent::Transfer(target_collection.id, item_id, from, recipient, value));
1368 Ok(())1381 Ok(())
1369 }1382 }
13701383