craft-nft

A standalone NFT implementation for real-world arts and crafts assets
Log | Files | Refs | README

commit 0bc71c3815e9626428f5dbab45079f5d25429680
parent 828cbf7c03158abdbcb7c80cda576455f6f1ded8
Author: lash <dev@holbrook.no>
Date:   Sun, 18 Dec 2022 14:58:57 +0000

Fix stale batch index parse in dump tool

Diffstat:
Mjs/src/engine.js | 6+++---
Mpython/eth_craft_nft/nft.py | 4++--
Mpython/eth_craft_nft/runnable/dump.py | 1-
3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/js/src/engine.js b/js/src/engine.js @@ -91,9 +91,9 @@ async function getMintedToken(session, tokenId, batch) { } } o.sparse = token.sparse; - o.cap = token.count; - o.count = token.cursor; - if (token.cursor < token.count) { + o.cap = parseInt(token.count); + o.count = parseInt(token.cursor); + if (o.count < o.cap) { o.mintable = true; } return o; diff --git a/python/eth_craft_nft/nft.py b/python/eth_craft_nft/nft.py @@ -270,7 +270,7 @@ class CraftNFT(ERC721): return MintedToken(addr, token_id=token_id, batched=True, minted=True) o = MintedToken(addr, minted=True) - o.index = int(token_id[48:52], 16) - o.batch = int(token_id[52:64], 16) + o.batch = int(token_id[48:52], 16) + o.index = int(token_id[52:64], 16) o.token_id = token_id[:48] + v[2:18] return o diff --git a/python/eth_craft_nft/runnable/dump.py b/python/eth_craft_nft/runnable/dump.py @@ -100,7 +100,6 @@ def render_token_mint(c, conn, token_address, token_id, w=sys.stdout): o = c.get_token(token_address, token_id) r = conn.do(o) token = c.parse_token(r, token_id) - logg.info('specccc {} {}'.format(token_id, token)) if token.minted: w.write('token {}\n'.format(token))