From b93656f7c6f2d7d809b9b0e517a6371e89a0680e Mon Sep 17 00:00:00 2001 From: harsh vardhan Date: Wed, 29 Sep 2021 17:13:18 +0530 Subject: [PATCH] metadata info initialization and storage for token_metadata changed --- build/XToken.tz | 3 ++- src/storage.ligo | 5 ++++- test/helpers/token.js | 5 ++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/XToken.tz b/build/XToken.tz index a3905dc..e1043a1 100644 --- a/build/XToken.tz +++ b/build/XToken.tz @@ -13,7 +13,8 @@ (pair (pair (pair (big_map %admins address string) (big_map %ledger address (pair (map %allowances address nat) (nat %balance)))) (pair (big_map %lockingList address timestamp) (big_map %metadata string bytes))) - (pair (pair (address %owner) (big_map %token_metadata nat (pair nat (map string bytes)))) + (pair (pair (address %owner) + (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes)))) (pair (nat %totalSupply) (big_map %whitelist address string)))) ; code { LAMBDA (pair address diff --git a/src/storage.ligo b/src/storage.ligo index ef129eb..6ca5ae7 100644 --- a/src/storage.ligo +++ b/src/storage.ligo @@ -23,6 +23,8 @@ * * All storage variables can be found here. **************************************************************************************) +type token_info is map(string,bytes) +type token_id is nat type account is record balance : nat; @@ -37,5 +39,6 @@ type storage is record admins: big_map(address, string); lockingList: big_map(address, timestamp); metadata : big_map(string, bytes); - token_metadata : big_map(nat,(nat * map(string,bytes))); + token_metadata: big_map(nat, michelson_pair(token_id, "token_id", token_info, "token_info")); end + diff --git a/test/helpers/token.js b/test/helpers/token.js index ab4a0a2..bc1808b 100644 --- a/test/helpers/token.js +++ b/test/helpers/token.js @@ -42,11 +42,10 @@ const originate = async (owner) => { const tokenMetaDataFinal = MichelsonMap.fromLiteral({ 0: { - 0: 0, - 1: tokenMetaData + token_id: 0, + token_info: tokenMetaData } }) - const origination = await Tezos.contract.originate({ code, storage: {