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

difftreelog

Update acceptance doc - module name

Greg Zaitsev2020-05-07parent: #e747f80.patch.diff
in: master

1 file changed

modifieddoc/demo_milestone1-2.mddiffbeforeafterboth
123Execute extrinsic `nft`.`createItem` from ALICE account. Set properties to `0x01`. Now if you read the chain state `nft`.`balance(<Collection ID>, ALICE)`, it will be equal to 1. Also, you can read chain state `nft`.`itemList(<Collection ID>, 1)`, and it will return data for the token 1:123Execute extrinsic `nft`.`createItem` from ALICE account. Set properties to `0x01`. Now if you read the chain state `nft`.`balance(<Collection ID>, ALICE)`, it will be equal to 1. Also, you can read chain state `nft`.`itemList(<Collection ID>, 1)`, and it will return data for the token 1:
124124
125```125```
126templateModule.itemList: NftItemType126nft.itemList: NftItemType
127{127{
128 Collection: 1,128 Collection: 1,
129 Owner: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,129 Owner: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,
134#### GetOwner134#### GetOwner
135Reading the ownership is done by reading chainstate `nft`.`itemList(<Collection ID>, 1)`. One of the returned fields is Owner:135Reading the ownership is done by reading chainstate `nft`.`itemList(<Collection ID>, 1)`. One of the returned fields is Owner:
136```136```
137templateModule.itemList: NftItemType137nft.itemList: NftItemType
138{138{
139 Collection: 1,139 Collection: 1,
140 Owner: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,140 Owner: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,
145#### Transfer145#### Transfer
146Execute `nft`.`transfer` from ALICE address to transfer token 1 to BOB and check the ownership again:146Execute `nft`.`transfer` from ALICE address to transfer token 1 to BOB and check the ownership again:
147```147```
148templateModule.itemList: NftItemType148nft.itemList: NftItemType
149{149{
150 Collection: 1,150 Collection: 1,
151 Owner: 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty,151 Owner: 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty,
159159
160Read the chain state `nft`.`balance` for ALICE address and see that she owns 1 token:160Read the chain state `nft`.`balance` for ALICE address and see that she owns 1 token:
161```161```
162templateModule.balance: u64162nft.balance: u64
16311631
164```164```
165165
166#### AddCollectionAdmin166#### AddCollectionAdmin
167Execute `nft`.`AddCollectionAdmin` from ALICE account and let CHARLIE be an admin. Now you can see that CHARLIE can transfer ALICE's token from ALICE's account to EVE and back. Also, you can read admin list from chain state and see that it is not empty:167Execute `nft`.`AddCollectionAdmin` from ALICE account and let CHARLIE be an admin. Now you can see that CHARLIE can transfer ALICE's token from ALICE's account to EVE and back. Also, you can read admin list from chain state and see that it is not empty:
168168
169```169```
170templateModule.adminList: Vec<AccountId>170nft.adminList: Vec<AccountId>
171[171[
172 5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y172 5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y
173]173]
177Execute `nft`.`RemoveCollectionAdmin` from ALICE account to remove CHARLIE from admins. Now you can see that CHARLIE cannot transfer ALICE's tokens anymore. If you read the chan state `nft`.`adminList`, the response will be empty:177Execute `nft`.`RemoveCollectionAdmin` from ALICE account to remove CHARLIE from admins. Now you can see that CHARLIE cannot transfer ALICE's tokens anymore. If you read the chan state `nft`.`adminList`, the response will be empty:
178178
179```179```
180templateModule.adminList: Vec<AccountId>180nft.adminList: Vec<AccountId>
181[]181[]
182```182```
183183
184#### BurnItem184#### BurnItem
185Execute `nft`.`burnItem` from ALICE account to burn token 1, and then read the chain state `nft`.`itemList(<Collection ID>, 1)`. This time the chain state returns default values in fields because token does not exist anymore. You can also check ALICE balance in chain state, now it is equal 0 again.185Execute `nft`.`burnItem` from ALICE account to burn token 1, and then read the chain state `nft`.`itemList(<Collection ID>, 1)`. This time the chain state returns default values in fields because token does not exist anymore. You can also check ALICE balance in chain state, now it is equal 0 again.
186```186```
187templateModule.itemList: NftItemType187nft.itemList: NftItemType
188{188{
189 Collection: 0,189 Collection: 0,
190 Owner: 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM,190 Owner: 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM,