0

我想做一些交易。喜欢这里提到的

sendRawTransaction 返回我交易的哈希值。但是没有任何交易。我的待处理事务计数为 0。当我使用该 hash 调用 getTransaction 方法时,结果是

{
   'blockHash': None, 
   'blockNumber': None, 
   'from': 'my address', 
   'gas': 118685, 
   'gasPrice': 1000000000, 
   'hash': HexBytes('some hash'), 
   'input': 'some long hash', 
   'nonce': 1254, 
   'r': HexBytes('...'), 
   's': HexBytes('...'), 
   'to': 'my contract address', 
   'transactionIndex': None, 
   'v': 42, 
   'value': 0
}

可能是什么原因?

4

1 回答 1

0

根据 的文档getTransaction它仅在交易被挖掘后才返回交易。waitForTransactionReceipt 您可以使用方法等待它被挖掘。

于 2021-02-20T14:50:24.977 回答