示例#1
0
 def test_oep4_balance_of(self):
     hex_contract_address = '1ddbb682743e9d9e2b71ff419e97a9358c5c4ee9'
     func = InvokeFunction('balanceOf')
     self.assertEqual(bytearray(b'\x00\xc1\tbalanceOf'),
                      func.create_invoke_code())
     bytes_address = acct1.get_address().to_bytes()
     func.set_params_value(bytes_address)
     target = bytearray(
         b'\x14F\xb1\xa1\x8a\xf6\xb7\xc9\xf8\xa4`/\x9fs\xee\xb3\x03\x0f\x0c)\xb7Q\xc1\tbalanceOf'
     )
     self.assertEqual(target, func.create_invoke_code())
     result = sdk.rpc.send_neo_vm_tx_pre_exec(hex_contract_address, func)
     balance = result['Result']
     balance = Data.to_int(balance)
     self.assertGreater(balance, 100)
示例#2
0
 def test_oep4_symbol(self):
     hex_contract_address = '1ddbb682743e9d9e2b71ff419e97a9358c5c4ee9'
     func = InvokeFunction('symbol')
     self.assertEqual(bytearray(b'\x00\xc1\x06symbol'),
                      func.create_invoke_code())
     result = sdk.rpc.send_neo_vm_tx_pre_exec(hex_contract_address, func)
     symbol = result['Result']
     symbol = Data.to_utf8_str(symbol)
     self.assertEqual('DX', symbol)
示例#3
0
 def test_oep4_name(self):
     hex_contract_address = '1ddbb682743e9d9e2b71ff419e97a9358c5c4ee9'
     func = InvokeFunction('name')
     self.assertEqual(bytearray(b'\x00\xc1\x04name'),
                      func.create_invoke_code())
     result = sdk.rpc.send_neo_vm_tx_pre_exec(hex_contract_address, func)
     name = result['Result']
     name = Data.to_utf8_str(name)
     self.assertEqual('DXToken', name)