mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-27 05:38:55 +00:00
9ac88d11da
Former-commit-id: d22d05529bb0050b8a03053a28d876e3e458bbff [formerly 284a04699110aa285a42f5b0ad244ca9bd77d2df] Former-commit-id: 83cd9c8a48fb5ce9c57ff8ef6c2b1741a4d05130
24 lines
626 B
Go
24 lines
626 B
Go
// This package exists to convert Ethererum 2.0 types to go-ethereum or
|
|
// Ethereum 1.0 types.
|
|
package legacyutil
|
|
|
|
import (
|
|
"math/big"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
gethTypes "github.com/ethereum/go-ethereum/core/types"
|
|
pb "github.com/prysmaticlabs/geth-sharding/proto/sharding/v1"
|
|
)
|
|
|
|
// TransformTransaction of proto transaction to geth's transction.
|
|
func TransformTransaction(t *pb.Transaction) *gethTypes.Transaction {
|
|
return gethTypes.NewTransaction(
|
|
t.Nonce,
|
|
common.BytesToAddress(t.Recipient),
|
|
big.NewInt(0).SetUint64(t.Value),
|
|
t.GasLimit,
|
|
big.NewInt(0).SetUint64(t.GasPrice),
|
|
t.Input,
|
|
)
|
|
}
|