capsule-corp-ternoa / worker

SubstraTEE worker for SubstraTEE node
Apache License 2.0
0 stars 0 forks source link

[client] implement NFT pallet interaction #3

Closed brenzi closed 3 years ago

brenzi commented 3 years ago

according to calls regarding NFT defined in #1

interact with https://github.com/capsule-corp-ternoa/chain/tree/main/pallets/nfts

NFT properties are defined here: https://github.com/capsule-corp-ternoa/chain/blob/2a3085a4cb612c461f746ab09a4ef5a2714f44a0/pallets/nfts/src/types.rs#L13

The only changing field in the NFT for this demo is offchain_uri:

We just create a new NFT and listen for the created event to extract and return the NFTid https://github.com/capsule-corp-ternoa/chain/blob/2a3085a4cb612c461f746ab09a4ef5a2714f44a0/pallets/nfts/src/lib.rs#L200

echevrier commented 3 years ago

Create only works for one account, if the series_id is hardcoded to 1u32. A nfts.NotSeriesOwner error is sent when create is called by another account. If series_id is hardcoded to 0u32, this would work. Shall I change it?

brenzi commented 3 years ago

that is a question for @ETeissonniere I think.

echevrier commented 3 years ago

@ETeissonniere has confirmed. The default serie id is 0. I change the code according to it.