Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
eb8f0b85
Commit
eb8f0b85
authored
Apr 04, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed R & S to *big.Int
parent
59597d23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
transaction.go
core/types/transaction.go
+6
-6
No files found.
core/types/transaction.go
View file @
eb8f0b85
...
@@ -24,7 +24,7 @@ type Transaction struct {
...
@@ -24,7 +24,7 @@ type Transaction struct {
Amount
*
big
.
Int
Amount
*
big
.
Int
Payload
[]
byte
Payload
[]
byte
V
byte
V
byte
R
,
S
[]
byte
R
,
S
*
big
.
Int
}
}
func
NewContractCreationTx
(
amount
,
gasLimit
,
gasPrice
*
big
.
Int
,
data
[]
byte
)
*
Transaction
{
func
NewContractCreationTx
(
amount
,
gasLimit
,
gasPrice
*
big
.
Int
,
data
[]
byte
)
*
Transaction
{
...
@@ -94,8 +94,8 @@ func (tx *Transaction) To() *common.Address {
...
@@ -94,8 +94,8 @@ func (tx *Transaction) To() *common.Address {
func
(
tx
*
Transaction
)
Curve
()
(
v
byte
,
r
[]
byte
,
s
[]
byte
)
{
func
(
tx
*
Transaction
)
Curve
()
(
v
byte
,
r
[]
byte
,
s
[]
byte
)
{
v
=
byte
(
tx
.
V
)
v
=
byte
(
tx
.
V
)
r
=
common
.
LeftPadBytes
(
tx
.
R
,
32
)
r
=
common
.
LeftPadBytes
(
tx
.
R
.
Bytes
()
,
32
)
s
=
common
.
LeftPadBytes
(
tx
.
S
,
32
)
s
=
common
.
LeftPadBytes
(
tx
.
S
.
Bytes
()
,
32
)
return
return
}
}
...
@@ -118,8 +118,8 @@ func (tx *Transaction) PublicKey() []byte {
...
@@ -118,8 +118,8 @@ func (tx *Transaction) PublicKey() []byte {
}
}
func
(
tx
*
Transaction
)
SetSignatureValues
(
sig
[]
byte
)
error
{
func
(
tx
*
Transaction
)
SetSignatureValues
(
sig
[]
byte
)
error
{
tx
.
R
=
sig
[
:
32
]
tx
.
R
=
common
.
Bytes2Big
(
sig
[
:
32
])
tx
.
S
=
sig
[
32
:
64
]
tx
.
S
=
common
.
Bytes2Big
(
sig
[
32
:
64
])
tx
.
V
=
sig
[
64
]
+
27
tx
.
V
=
sig
[
64
]
+
27
return
nil
return
nil
}
}
...
@@ -137,7 +137,7 @@ func (tx *Transaction) SignECDSA(prv *ecdsa.PrivateKey) error {
...
@@ -137,7 +137,7 @@ func (tx *Transaction) SignECDSA(prv *ecdsa.PrivateKey) error {
// TODO: remove
// TODO: remove
func
(
tx
*
Transaction
)
RlpData
()
interface
{}
{
func
(
tx
*
Transaction
)
RlpData
()
interface
{}
{
data
:=
[]
interface
{}{
tx
.
AccountNonce
,
tx
.
Price
,
tx
.
GasLimit
,
tx
.
Recipient
,
tx
.
Amount
,
tx
.
Payload
}
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
{
func
(
tx
*
Transaction
)
String
()
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment