fix: eth_getTransactionByHash: return hash.
This commit is contained in:
parent
336a0e5b85
commit
7ed79fece6
@ -28,7 +28,9 @@ func TestDeployment(t *testing.T) {
|
|||||||
// He who writes the second test, shall do that.
|
// He who writes the second test, shall do that.
|
||||||
// kit.QuietMiningLogs()
|
// kit.QuietMiningLogs()
|
||||||
|
|
||||||
blockTime := 100 * time.Millisecond
|
// reasonable blocktime so that the tx sits in the mpool for a bit during the test.
|
||||||
|
// although this is non-deterministic...
|
||||||
|
blockTime := 1 * time.Second
|
||||||
client, _, ens := kit.EnsembleMinimal(
|
client, _, ens := kit.EnsembleMinimal(
|
||||||
t,
|
t,
|
||||||
kit.MockProofs(),
|
kit.MockProofs(),
|
||||||
@ -94,17 +96,21 @@ func TestDeployment(t *testing.T) {
|
|||||||
hash := client.EVM().SubmitTransaction(ctx, &tx)
|
hash := client.EVM().SubmitTransaction(ctx, &tx)
|
||||||
fmt.Println(hash)
|
fmt.Println(hash)
|
||||||
|
|
||||||
|
mpoolTx, err := client.EthGetTransactionByHash(ctx, &hash)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
// require that the hashes are identical
|
||||||
|
// TODO compare more fields
|
||||||
|
require.Equal(t, hash, mpoolTx.Hash)
|
||||||
|
|
||||||
changes, err := client.EthGetFilterChanges(ctx, pendingFilter)
|
changes, err := client.EthGetFilterChanges(ctx, pendingFilter)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, changes.Results, 1)
|
require.Len(t, changes.Results, 1)
|
||||||
require.Equal(t, hash.String(), changes.Results[0])
|
require.Equal(t, hash.String(), changes.Results[0])
|
||||||
|
|
||||||
time.Sleep(5 * time.Second)
|
|
||||||
|
|
||||||
var receipt *api.EthTxReceipt
|
var receipt *api.EthTxReceipt
|
||||||
for i := 0; i < 10000000000; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
receipt, err = client.EthGetTransactionReceipt(ctx, hash)
|
receipt, err = client.EthGetTransactionReceipt(ctx, hash)
|
||||||
fmt.Println(receipt, err)
|
|
||||||
if err != nil || receipt == nil {
|
if err != nil || receipt == nil {
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
continue
|
continue
|
||||||
|
@ -1480,7 +1480,13 @@ func newEthTxFromFilecoinMessage(ctx context.Context, smsg *types.SignedMessage,
|
|||||||
r, s, v = ethtypes.EthBigIntZero, ethtypes.EthBigIntZero, ethtypes.EthBigIntZero
|
r, s, v = ethtypes.EthBigIntZero, ethtypes.EthBigIntZero, ethtypes.EthBigIntZero
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hash, err := ethtypes.NewEthHashFromCid(smsg.Cid())
|
||||||
|
if err != nil {
|
||||||
|
return ethtypes.EthTx{}, err
|
||||||
|
}
|
||||||
|
|
||||||
tx := ethtypes.EthTx{
|
tx := ethtypes.EthTx{
|
||||||
|
Hash: hash,
|
||||||
ChainID: ethtypes.EthUint64(build.Eip155ChainId),
|
ChainID: ethtypes.EthUint64(build.Eip155ChainId),
|
||||||
From: fromEthAddr,
|
From: fromEthAddr,
|
||||||
To: toAddr,
|
To: toAddr,
|
||||||
|
Loading…
Reference in New Issue
Block a user