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: {