eth-erc721

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

interface.py (884B)


      1 from chainlib.eth.block import block_latest
      2 
      3 # local imports
      4 from eth_erc721.unittest.enum import TestInterface as TestInterfaceBase
      5 
      6 
      7 class TestInterface(TestInterfaceBase):
      8 
      9     def test_minted_at(self):
     10         o = block_latest()
     11         r = self.rpc.do(o)
     12         block_start = int(r)
     13          
     14         self.backend.mine_blocks(42)
     15 
     16         token_bytes = b'\xee' * 32
     17         token_id = int.from_bytes(token_bytes, byteorder='big')
     18         c = self._mint(self.accounts[1], token_id)
     19 
     20         o = c.start_time(self.address, token_id, sender_address=self.accounts[0])
     21         r = self.rpc.do(o)
     22         height = c.parse_time(r)
     23         self.assertEqual(height, block_start + 42 + 1)
     24 
     25         o = c.create_time(self.address, token_id, sender_address=self.accounts[0])
     26         r = self.rpc.do(o)
     27         height = c.parse_time(r)
     28         self.assertEqual(height, block_start + 42 + 1)