|
|
@ -23,6 +23,7 @@ type RPCTransaction struct { |
|
|
|
BlockHash common.Hash `json:"blockHash"` |
|
|
|
BlockHash common.Hash `json:"blockHash"` |
|
|
|
BlockNumber *hexutil.Big `json:"blockNumber"` |
|
|
|
BlockNumber *hexutil.Big `json:"blockNumber"` |
|
|
|
From string `json:"from"` |
|
|
|
From string `json:"from"` |
|
|
|
|
|
|
|
Timestamp hexutil.Uint64 `json:"timestamp"` |
|
|
|
Gas hexutil.Uint64 `json:"gas"` |
|
|
|
Gas hexutil.Uint64 `json:"gas"` |
|
|
|
GasPrice *hexutil.Big `json:"gasPrice"` |
|
|
|
GasPrice *hexutil.Big `json:"gasPrice"` |
|
|
|
Hash common.Hash `json:"hash"` |
|
|
|
Hash common.Hash `json:"hash"` |
|
|
@ -43,6 +44,7 @@ type RPCStakingTransaction struct { |
|
|
|
BlockHash common.Hash `json:"blockHash"` |
|
|
|
BlockHash common.Hash `json:"blockHash"` |
|
|
|
BlockNumber *hexutil.Big `json:"blockNumber"` |
|
|
|
BlockNumber *hexutil.Big `json:"blockNumber"` |
|
|
|
From string `json:"from"` |
|
|
|
From string `json:"from"` |
|
|
|
|
|
|
|
Timestamp hexutil.Uint64 `json:"timestamp"` |
|
|
|
Gas hexutil.Uint64 `json:"gas"` |
|
|
|
Gas hexutil.Uint64 `json:"gas"` |
|
|
|
GasPrice *hexutil.Big `json:"gasPrice"` |
|
|
|
GasPrice *hexutil.Big `json:"gasPrice"` |
|
|
|
Hash common.Hash `json:"hash"` |
|
|
|
Hash common.Hash `json:"hash"` |
|
|
@ -192,7 +194,7 @@ func newRPCValidator(validator *types2.Validator) *RPCValidator { |
|
|
|
|
|
|
|
|
|
|
|
// newRPCTransaction returns a transaction that will serialize to the RPC
|
|
|
|
// newRPCTransaction returns a transaction that will serialize to the RPC
|
|
|
|
// representation, with the given location metadata set (if available).
|
|
|
|
// representation, with the given location metadata set (if available).
|
|
|
|
func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction { |
|
|
|
func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, timestamp uint64, uinindex uint64) *RPCTransaction { |
|
|
|
var signer types.Signer = types.FrontierSigner{} |
|
|
|
var signer types.Signer = types.FrontierSigner{} |
|
|
|
if tx.Protected() { |
|
|
|
if tx.Protected() { |
|
|
|
signer = types.NewEIP155Signer(tx.ChainID()) |
|
|
|
signer = types.NewEIP155Signer(tx.ChainID()) |
|
|
@ -208,6 +210,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber |
|
|
|
Value: (*hexutil.Big)(tx.Value()), |
|
|
|
Value: (*hexutil.Big)(tx.Value()), |
|
|
|
ShardID: tx.ShardID(), |
|
|
|
ShardID: tx.ShardID(), |
|
|
|
ToShardID: tx.ToShardID(), |
|
|
|
ToShardID: tx.ToShardID(), |
|
|
|
|
|
|
|
Timestamp: hexutil.Uint64(timestamp), |
|
|
|
V: (*hexutil.Big)(v), |
|
|
|
V: (*hexutil.Big)(v), |
|
|
|
R: (*hexutil.Big)(r), |
|
|
|
R: (*hexutil.Big)(r), |
|
|
|
S: (*hexutil.Big)(s), |
|
|
|
S: (*hexutil.Big)(s), |
|
|
@ -239,7 +242,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber |
|
|
|
|
|
|
|
|
|
|
|
// newRPCStakingTransaction returns a transaction that will serialize to the RPC
|
|
|
|
// newRPCStakingTransaction returns a transaction that will serialize to the RPC
|
|
|
|
// representation, with the given location metadata set (if available).
|
|
|
|
// representation, with the given location metadata set (if available).
|
|
|
|
func newRPCStakingTransaction(tx *types2.StakingTransaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCStakingTransaction { |
|
|
|
func newRPCStakingTransaction(tx *types2.StakingTransaction, blockHash common.Hash, blockNumber uint64, timestamp uint64, index uint64) *RPCStakingTransaction { |
|
|
|
from, _ := tx.SenderAddress() |
|
|
|
from, _ := tx.SenderAddress() |
|
|
|
v, r, s := tx.RawSignatureValues() |
|
|
|
v, r, s := tx.RawSignatureValues() |
|
|
|
|
|
|
|
|
|
|
@ -306,6 +309,7 @@ func newRPCStakingTransaction(tx *types2.StakingTransaction, blockHash common.Ha |
|
|
|
GasPrice: (*hexutil.Big)(tx.Price()), |
|
|
|
GasPrice: (*hexutil.Big)(tx.Price()), |
|
|
|
Hash: tx.Hash(), |
|
|
|
Hash: tx.Hash(), |
|
|
|
Nonce: hexutil.Uint64(tx.Nonce()), |
|
|
|
Nonce: hexutil.Uint64(tx.Nonce()), |
|
|
|
|
|
|
|
Timestamp: hexutil.Uint64(timestamp), |
|
|
|
V: (*hexutil.Big)(v), |
|
|
|
V: (*hexutil.Big)(v), |
|
|
|
R: (*hexutil.Big)(r), |
|
|
|
R: (*hexutil.Big)(r), |
|
|
|
S: (*hexutil.Big)(s), |
|
|
|
S: (*hexutil.Big)(s), |
|
|
@ -448,7 +452,7 @@ func newRPCTransactionFromBlockIndex(b *types.Block, index uint64) *RPCTransacti |
|
|
|
if index >= uint64(len(txs)) { |
|
|
|
if index >= uint64(len(txs)) { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
return newRPCTransaction(txs[index], b.Hash(), b.NumberU64(), index) |
|
|
|
return newRPCTransaction(txs[index], b.Hash(), b.NumberU64(), b.Time().Uint64(), index) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// newRPCStakingTransactionFromBlockHash returns a transaction that will serialize to the RPC representation.
|
|
|
|
// newRPCStakingTransactionFromBlockHash returns a transaction that will serialize to the RPC representation.
|
|
|
@ -467,7 +471,7 @@ func newRPCStakingTransactionFromBlockIndex(b *types.Block, index uint64) *RPCSt |
|
|
|
if index >= uint64(len(txs)) { |
|
|
|
if index >= uint64(len(txs)) { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
return newRPCStakingTransaction(txs[index], b.Hash(), b.NumberU64(), index) |
|
|
|
return newRPCStakingTransaction(txs[index], b.Hash(), b.NumberU64(), b.Time().Uint64(), index) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CallArgs represents the arguments for a call.
|
|
|
|
// CallArgs represents the arguments for a call.
|
|
|
|