mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-27 05:38:55 +00:00
92af8bc351
Former-commit-id: b7b8bbd10777012ae6f7d30eb6b05c3b1c3ec5d3 [formerly 06e1112fa0e1092a7137186d3a386972daa2effe] Former-commit-id: ff2bc760c9dafb6250f056606eb2cbf96b6afa5b
24 lines
618 B
Go
24 lines
618 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/prysm/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,
|
|
)
|
|
}
|