fix: EthGetTransactionCount should not return error
This commit is contained in:
parent
b9ed239cf4
commit
ccbf57165f
@ -175,11 +175,11 @@ func (a *EthModule) EthGetTransactionByHash(ctx context.Context, txHash *api.Eth
|
|||||||
func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender api.EthAddress, blkParam string) (api.EthUint64, error) {
|
func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender api.EthAddress, blkParam string) (api.EthUint64, error) {
|
||||||
addr, err := sender.ToFilecoinAddress()
|
addr, err := sender.ToFilecoinAddress()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return api.EthUint64(0), err
|
return api.EthUint64(0), nil
|
||||||
}
|
}
|
||||||
nonce, err := a.Mpool.GetNonce(ctx, addr, types.EmptyTSK)
|
nonce, err := a.Mpool.GetNonce(ctx, addr, types.EmptyTSK)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return api.EthUint64(0), err
|
return api.EthUint64(0), nil
|
||||||
}
|
}
|
||||||
return api.EthUint64(nonce), nil
|
return api.EthUint64(nonce), nil
|
||||||
}
|
}
|
||||||
@ -415,17 +415,21 @@ func (a *EthModule) EthGasPrice(ctx context.Context) (api.EthBigInt, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx api.EthBytes) (api.EthHash, error) {
|
func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx api.EthBytes) (api.EthHash, error) {
|
||||||
|
fmt.Println(rawTx)
|
||||||
txArgs, err := api.ParseEthTxArgs(rawTx)
|
txArgs, err := api.ParseEthTxArgs(rawTx)
|
||||||
|
fmt.Println("txArgs", txArgs, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return api.EmptyEthHash, err
|
return api.EmptyEthHash, err
|
||||||
}
|
}
|
||||||
|
|
||||||
smsg, err := txArgs.ToSignedMessage()
|
smsg, err := txArgs.ToSignedMessage()
|
||||||
|
fmt.Println("smsg", smsg, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return api.EmptyEthHash, err
|
return api.EmptyEthHash, err
|
||||||
}
|
}
|
||||||
|
|
||||||
cid, err := a.MpoolAPI.MpoolPush(ctx, smsg)
|
cid, err := a.MpoolAPI.MpoolPush(ctx, smsg)
|
||||||
|
fmt.Println("cid", cid, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return api.EmptyEthHash, err
|
return api.EmptyEthHash, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user