Commit 8587b02d authored by duanjinfei's avatar duanjinfei

add recovertx struct

parent eeb84b49
...@@ -14,8 +14,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t ...@@ -14,8 +14,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI=
github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/deckarep/golang-set/v2 v2.2.0 h1:2pMQd3Soi6qfw7E5MMKaEh5W5ES18bW3AbFFnGl6LgQ= github.com/deckarep/golang-set/v2 v2.2.0 h1:2pMQd3Soi6qfw7E5MMKaEh5W5ES18bW3AbFFnGl6LgQ=
github.com/deckarep/golang-set/v2 v2.2.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/deckarep/golang-set/v2 v2.2.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
......
...@@ -245,20 +245,24 @@ func BatchRecoverTxHandler(tranArr []*types.Transaction, cfg *tool.Config) error ...@@ -245,20 +245,24 @@ func BatchRecoverTxHandler(tranArr []*types.Transaction, cfg *tool.Config) error
startTime := time.Now() startTime := time.Now()
for i := 0; i < int(allSignedTxCount); i++ { for i := 0; i < int(allSignedTxCount); i++ {
tran := tranArr[i] tran := tranArr[i]
v, r, _ := tran.RawSignatureValues() v, r, s := tran.RawSignatureValues()
rawTxArr := make([]*v1.MetaTxBase, 0) rawTxArr := make([]*v1.MetaTxBase, 0)
toaddr := metatypes.BytesToAddress(tran.To().Bytes())
hash := metatypes.HexToHash(tran.Hash().Hex())
rawTx := v1.MetaTxBase{ rawTx := v1.MetaTxBase{
TxType: uint32(tran.Type()), TxType: uint32(tran.Type()),
ChainId: metatypes.NewBigInt(tran.ChainId().Int64()), ChainId: metatypes.NewBigInt(tran.ChainId().Int64()),
Nonce: tran.Nonce(), Nonce: tran.Nonce(),
GasPrice: metatypes.NewBigInt(tran.GasPrice().Int64()), GasPrice: metatypes.NewBigInt(tran.GasPrice().Int64()),
Gas: tran.Gas(), Gas: tran.Gas(),
To: nil, To: &toaddr,
Value: metatypes.NewBigInt(tran.Value().Int64()), Value: metatypes.NewBigInt(tran.Value().Int64()),
Data: tran.Data(), Data: tran.Data(),
AccessList: nil, AccessList: nil,
V: metatypes.NewBigInt(v.Int64()), V: metatypes.NewBigInt(v.Int64()),
R: metatypes.NewBigInt(r.Int64()), R: metatypes.NewBigInt(r.Int64()),
S: metatypes.NewBigInt(s.Int64()),
TxHash: &hash,
} }
rawTxArr = append(rawTxArr, &rawTx) rawTxArr = append(rawTxArr, &rawTx)
req := crypterv1.BatchRecoverTxRequest{ req := crypterv1.BatchRecoverTxRequest{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment