aboutsummaryrefslogtreecommitdiff
path: root/core/types
diff options
context:
space:
mode:
Diffstat (limited to 'core/types')
-rw-r--r--core/types/gen_tx_json.go12
-rw-r--r--core/types/transaction.go33
2 files changed, 6 insertions, 39 deletions
diff --git a/core/types/gen_tx_json.go b/core/types/gen_tx_json.go
index dd0d069..0410632 100644
--- a/core/types/gen_tx_json.go
+++ b/core/types/gen_tx_json.go
@@ -21,8 +21,6 @@ func (t txdata) MarshalJSON() ([]byte, error) {
GasLimit hexutil.Uint64 `json:"gas" gencodec:"required"`
Recipient *common.Address `json:"to" rlp:"nil"`
Amount *hexutil.Big `json:"value" gencodec:"required"`
- CoinID *common.Hash `json:"coinid" rlp:"nil"`
- Amount2 *hexutil.Big `json:"value2" rlp:"nil"`
Payload hexutil.Bytes `json:"input" gencodec:"required"`
V *hexutil.Big `json:"v" gencodec:"required"`
R *hexutil.Big `json:"r" gencodec:"required"`
@@ -35,8 +33,6 @@ func (t txdata) MarshalJSON() ([]byte, error) {
enc.GasLimit = hexutil.Uint64(t.GasLimit)
enc.Recipient = t.Recipient
enc.Amount = (*hexutil.Big)(t.Amount)
- enc.CoinID = t.CoinID
- enc.Amount2 = (*hexutil.Big)(t.Amount2)
enc.Payload = t.Payload
enc.V = (*hexutil.Big)(t.V)
enc.R = (*hexutil.Big)(t.R)
@@ -53,8 +49,6 @@ func (t *txdata) UnmarshalJSON(input []byte) error {
GasLimit *hexutil.Uint64 `json:"gas" gencodec:"required"`
Recipient *common.Address `json:"to" rlp:"nil"`
Amount *hexutil.Big `json:"value" gencodec:"required"`
- CoinID *common.Hash `json:"coinid" rlp:"nil"`
- Amount2 *hexutil.Big `json:"value2" rlp:"nil"`
Payload *hexutil.Bytes `json:"input" gencodec:"required"`
V *hexutil.Big `json:"v" gencodec:"required"`
R *hexutil.Big `json:"r" gencodec:"required"`
@@ -84,12 +78,6 @@ func (t *txdata) UnmarshalJSON(input []byte) error {
return errors.New("missing required field 'value' for txdata")
}
t.Amount = (*big.Int)(dec.Amount)
- if dec.CoinID != nil {
- t.CoinID = dec.CoinID
- }
- if dec.Amount2 != nil {
- t.Amount2 = (*big.Int)(dec.Amount2)
- }
if dec.Payload == nil {
return errors.New("missing required field 'input' for txdata")
}
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 858b443..d9ada38 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -49,8 +49,6 @@ type txdata struct {
GasLimit uint64 `json:"gas" gencodec:"required"`
Recipient *common.Address `json:"to" rlp:"nil"` // nil means contract creation
Amount *big.Int `json:"value" gencodec:"required"`
- CoinID *common.Hash `json:"coinid" rlp:"nil"`
- Amount2 *big.Int `json:"value2" rlp:"nil"`
Payload []byte `json:"input" gencodec:"required"`
// Signature values
@@ -67,8 +65,6 @@ type txdataMarshaling struct {
Price *hexutil.Big
GasLimit hexutil.Uint64
Amount *hexutil.Big
- CoinID *common.Hash
- Amount2 *hexutil.Big
Payload hexutil.Bytes
V *hexutil.Big
R *hexutil.Big
@@ -92,8 +88,6 @@ func newTransaction(nonce uint64, to *common.Address, amount *big.Int, gasLimit
Recipient: to,
Payload: data,
Amount: new(big.Int),
- CoinID: nil,
- Amount2: new(big.Int),
GasLimit: gasLimit,
Price: new(big.Int),
V: new(big.Int),
@@ -110,11 +104,6 @@ func newTransaction(nonce uint64, to *common.Address, amount *big.Int, gasLimit
return &Transaction{data: d}
}
-func (tx *Transaction) SetMultiCoinValue(coinID *common.Hash, amount *big.Int) {
- tx.data.CoinID = coinID
- tx.data.Amount2.Set(amount)
-}
-
// ChainId returns which chain id this transaction was signed for (if at all)
func (tx *Transaction) ChainId() *big.Int {
return deriveChainId(tx.data.V)
@@ -183,14 +172,12 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
return nil
}
-func (tx *Transaction) Data() []byte { return common.CopyBytes(tx.data.Payload) }
-func (tx *Transaction) Gas() uint64 { return tx.data.GasLimit }
-func (tx *Transaction) GasPrice() *big.Int { return new(big.Int).Set(tx.data.Price) }
-func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.data.Amount) }
-func (tx *Transaction) CoinID() *common.Hash { return tx.data.CoinID }
-func (tx *Transaction) Value2() *big.Int { return new(big.Int).Set(tx.data.Amount2) }
-func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce }
-func (tx *Transaction) CheckNonce() bool { return true }
+func (tx *Transaction) Data() []byte { return common.CopyBytes(tx.data.Payload) }
+func (tx *Transaction) Gas() uint64 { return tx.data.GasLimit }
+func (tx *Transaction) GasPrice() *big.Int { return new(big.Int).Set(tx.data.Price) }
+func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.data.Amount) }
+func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce }
+func (tx *Transaction) CheckNonce() bool { return true }
// To returns the recipient address of the transaction.
// It returns nil if the transaction is a contract creation.
@@ -237,8 +224,6 @@ func (tx *Transaction) AsMessage(s Signer) (Message, error) {
gasPrice: new(big.Int).Set(tx.data.Price),
to: tx.data.Recipient,
amount: tx.data.Amount,
- coinID: tx.data.CoinID,
- amount2: tx.data.Amount2,
data: tx.data.Payload,
checkNonce: true,
}
@@ -405,8 +390,6 @@ type Message struct {
from common.Address
nonce uint64
amount *big.Int
- coinID *common.Hash
- amount2 *big.Int
gasLimit uint64
gasPrice *big.Int
data []byte
@@ -419,8 +402,6 @@ func NewMessage(from common.Address, to *common.Address, nonce uint64, amount *b
to: to,
nonce: nonce,
amount: amount,
- coinID: nil,
- amount2: big.NewInt(0),
gasLimit: gasLimit,
gasPrice: gasPrice,
data: data,
@@ -432,8 +413,6 @@ func (m Message) From() common.Address { return m.from }
func (m Message) To() *common.Address { return m.to }
func (m Message) GasPrice() *big.Int { return m.gasPrice }
func (m Message) Value() *big.Int { return m.amount }
-func (m Message) CoinID() *common.Hash { return m.coinID }
-func (m Message) Value2() *big.Int { return m.amount2 }
func (m Message) Gas() uint64 { return m.gasLimit }
func (m Message) Nonce() uint64 { return m.nonce }
func (m Message) Data() []byte { return m.data }