aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-05 03:32:24 +0800
committerobscuren <geffobscura@gmail.com>2015-04-05 03:32:24 +0800
commiteb8f0b85f750b7843bb3909116ea71f85a1988a6 (patch)
treef25d931e4a0f448ae7c233518bb848e7f2bb00ca
parent59597d23a5ee268c66df96b930f651256661b8c5 (diff)
downloadgo-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.tar
go-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.tar.gz
go-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.tar.bz2
go-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.tar.lz
go-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.tar.xz
go-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.tar.zst
go-tangerine-eb8f0b85f750b7843bb3909116ea71f85a1988a6.zip
Changed R & S to *big.Int
-rw-r--r--core/types/transaction.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 35e8f5ac8..f5aa89a15 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -24,7 +24,7 @@ type Transaction struct {
Amount *big.Int
Payload []byte
V byte
- R, S []byte
+ R, S *big.Int
}
func NewContractCreationTx(amount, gasLimit, gasPrice *big.Int, data []byte) *Transaction {
@@ -94,8 +94,8 @@ func (tx *Transaction) To() *common.Address {
func (tx *Transaction) Curve() (v byte, r []byte, s []byte) {
v = byte(tx.V)
- r = common.LeftPadBytes(tx.R, 32)
- s = common.LeftPadBytes(tx.S, 32)
+ r = common.LeftPadBytes(tx.R.Bytes(), 32)
+ s = common.LeftPadBytes(tx.S.Bytes(), 32)
return
}
@@ -118,8 +118,8 @@ func (tx *Transaction) PublicKey() []byte {
}
func (tx *Transaction) SetSignatureValues(sig []byte) error {
- tx.R = sig[:32]
- tx.S = sig[32:64]
+ tx.R = common.Bytes2Big(sig[:32])
+ tx.S = common.Bytes2Big(sig[32:64])
tx.V = sig[64] + 27
return nil
}
@@ -137,7 +137,7 @@ func (tx *Transaction) SignECDSA(prv *ecdsa.PrivateKey) error {
// TODO: remove
func (tx *Transaction) RlpData() interface{} {
data := []interface{}{tx.AccountNonce, tx.Price, tx.GasLimit, tx.Recipient, tx.Amount, tx.Payload}
- return append(data, tx.V, new(big.Int).SetBytes(tx.R).Bytes(), new(big.Int).SetBytes(tx.S).Bytes())
+ return append(data, tx.V, tx.R.Bytes(), tx.S.Bytes())
}
func (tx *Transaction) String() string {