good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
fc52f2c0
Commit
fc52f2c0
authored
Jan 23, 2017
by
Felix Lange
Committed by
GitHub
Jan 23, 2017
Browse files
Options
Downloads
Patches
Plain Diff
core/types: make Transaction zero value printable (#3595)
parent
96778a1c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/types/transaction.go
+18
-14
18 additions, 14 deletions
core/types/transaction.go
with
18 additions
and
14 deletions
core/types/transaction.go
+
18
−
14
View file @
fc52f2c0
...
@@ -134,7 +134,7 @@ func (tx *Transaction) ChainId() *big.Int {
...
@@ -134,7 +134,7 @@ func (tx *Transaction) ChainId() *big.Int {
return
deriveChainId
(
tx
.
data
.
V
)
return
deriveChainId
(
tx
.
data
.
V
)
}
}
// Protected returns whether the transaction is pr
e
tected from replay protection
// Protected returns whether the transaction is pr
o
tected from replay protection
.
func
(
tx
*
Transaction
)
Protected
()
bool
{
func
(
tx
*
Transaction
)
Protected
()
bool
{
return
isProtectedV
(
tx
.
data
.
V
)
return
isProtectedV
(
tx
.
data
.
V
)
}
}
...
@@ -311,16 +311,20 @@ func (tx *Transaction) RawSignatureValues() (*big.Int, *big.Int, *big.Int) {
...
@@ -311,16 +311,20 @@ func (tx *Transaction) RawSignatureValues() (*big.Int, *big.Int, *big.Int) {
}
}
func
(
tx
*
Transaction
)
String
()
string
{
func
(
tx
*
Transaction
)
String
()
string
{
var
from
,
to
string
if
tx
.
data
.
V
!=
nil
{
// make a best guess about the signer and use that to derive
// make a best guess about the signer and use that to derive
// the sender.
// the sender.
signer
:=
deriveSigner
(
tx
.
data
.
V
)
signer
:=
deriveSigner
(
tx
.
data
.
V
)
var
from
,
to
string
if
f
,
err
:=
Sender
(
signer
,
tx
);
err
!=
nil
{
// derive but don't cache
if
f
,
err
:=
Sender
(
signer
,
tx
);
err
!=
nil
{
// derive but don't cache
from
=
"[invalid sender: invalid sig]"
from
=
"[invalid sender: invalid sig]"
}
else
{
}
else
{
from
=
fmt
.
Sprintf
(
"%x"
,
f
[
:
])
from
=
fmt
.
Sprintf
(
"%x"
,
f
[
:
])
}
}
}
else
{
from
=
"[invalid sender: nil V field]"
}
if
tx
.
data
.
Recipient
==
nil
{
if
tx
.
data
.
Recipient
==
nil
{
to
=
"[contract creation]"
to
=
"[contract creation]"
}
else
{
}
else
{
...
@@ -333,13 +337,13 @@ func (tx *Transaction) String() string {
...
@@ -333,13 +337,13 @@ func (tx *Transaction) String() string {
From: %s
From: %s
To: %s
To: %s
Nonce: %v
Nonce: %v
GasPrice: %
v
GasPrice: %
#x
GasLimit %
v
GasLimit %
#x
Value: %
v
Value: %
#x
Data: 0x%x
Data: 0x%x
V:
0x
%x
V: %
#
x
R:
0x
%x
R: %
#
x
S:
0x
%x
S: %
#
x
Hex: %x
Hex: %x
`
,
`
,
tx
.
Hash
(),
tx
.
Hash
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment