eth-erc721

ERC-721 'NFT' token interface with example developer badge token contract
Log | Files | Refs | LICENSE

commit 370fc51c8f65d8791081734d3fe442e2a67e9200
parent 58ccd6022e6f4e2aab80a159ac4825562e56e541
Author: lash <dev@holbrook.no>
Date:   Fri,  3 Mar 2023 23:09:20 +0000

Fix block height test in mint unittest

Diffstat:
Mpython/eth_badgetoken/token.py | 1-
Mpython/eth_erc721/unittest/base.py | 13++++++++++++-
Mpython/setup.cfg | 2+-
3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/python/eth_badgetoken/token.py b/python/eth_badgetoken/token.py @@ -85,7 +85,6 @@ class BadgeToken(ERC721): return tx - def minted_at(self, contract_address, token_id, sender_address=ZERO_ADDRESS, id_generator=None): j = JSONRPCRequest(id_generator) o = j.template() diff --git a/python/eth_erc721/unittest/base.py b/python/eth_erc721/unittest/base.py @@ -1,13 +1,20 @@ +# standard imports +import logging + # external imports from hexathon import strip_0x from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.tx import receipt from chainlib.eth.constant import ZERO_ADDRESS +from chainlib.eth.block import block_latest from chainlib.jsonrpc import JSONRPCException # local imports from eth_badgetoken import BadgeToken +logg = logging.getLogger(__name__) + + class TestInterface: def _mint(self, recipient, token_id): @@ -67,6 +74,10 @@ class TestInterface: self.assertEqual(strip_0x(self.accounts[4]), owner_address) def test_mint(self): + o = block_latest() + r = self.rpc.do(o) + block_start = int(r) + self.backend.mine_blocks(42) token_bytes = b'\xee' * 32 @@ -86,7 +97,7 @@ class TestInterface: r = self.rpc.do(o) height = c.parse_minted_at(r) - self.assertEqual(height, 44) + self.assertEqual(height, block_start + 42 + 1) def test_approve(self): diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-erc721 -version = 0.1.0 +version = 0.1.1 description = ERC721 interface and simple contract with deployment script providing arbitrary minting of NFTs with freely settable tokenids author = Louis Holbrook author_email = dev@holbrook.no