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
2697e44d
Unverified
Commit
2697e44d
authored
Jul 04, 2022
by
Seungbae.yu
Committed by
GitHub
Jul 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: change format `0x%x` to `%#x` (#25221)
parent
953a29f5
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
39 additions
and
39 deletions
+39
-39
securechannel.go
accounts/scwallet/securechannel.go
+2
-2
wallet.go
accounts/scwallet/wallet.go
+1
-1
snap.go
cmd/devp2p/internal/ethtest/snap.go
+2
-2
runner.go
cmd/evm/runner.go
+1
-1
dbcmd.go
cmd/geth/dbcmd.go
+6
-6
main.go
cmd/rlpdump/main.go
+1
-1
rlpdump_test.go
cmd/rlpdump/rlpdump_test.go
+1
-1
forks.go
consensus/misc/forks.go
+1
-1
asm.go
core/asm/asm.go
+2
-2
blockchain.go
core/blockchain.go
+1
-1
hashing_test.go
core/types/hashing_test.go
+1
-1
jump_table.go
core/vm/jump_table.go
+1
-1
opcodes.go
core/vm/opcodes.go
+1
-1
runtime_test.go
core/vm/runtime/runtime_test.go
+2
-2
api.go
eth/api.go
+1
-1
api_test.go
eth/api_test.go
+1
-1
api_test.go
eth/filters/api_test.go
+1
-1
logger.go
eth/tracers/logger/logger.go
+4
-4
api.go
internal/ethapi/api.go
+1
-1
types.go
mobile/types.go
+2
-2
types.go
signer/core/apitypes/types.go
+1
-1
signed_data.go
signer/core/signed_data.go
+2
-2
trie_fuzzer.go
tests/fuzzers/stacktrie/trie_fuzzer.go
+1
-1
trie-fuzzer.go
tests/fuzzers/trie/trie-fuzzer.go
+1
-1
trie_test.go
trie/trie_test.go
+1
-1
No files found.
accounts/scwallet/securechannel.go
View file @
2697e44d
...
@@ -178,7 +178,7 @@ func (s *SecureChannelSession) mutuallyAuthenticate() error {
...
@@ -178,7 +178,7 @@ func (s *SecureChannelSession) mutuallyAuthenticate() error {
return
err
return
err
}
}
if
response
.
Sw1
!=
0x90
||
response
.
Sw2
!=
0x00
{
if
response
.
Sw1
!=
0x90
||
response
.
Sw2
!=
0x00
{
return
fmt
.
Errorf
(
"got unexpected response from MUTUALLY_AUTHENTICATE:
0x%
x%x"
,
response
.
Sw1
,
response
.
Sw2
)
return
fmt
.
Errorf
(
"got unexpected response from MUTUALLY_AUTHENTICATE:
%#
x%x"
,
response
.
Sw1
,
response
.
Sw2
)
}
}
if
len
(
response
.
Data
)
!=
scSecretLength
{
if
len
(
response
.
Data
)
!=
scSecretLength
{
...
@@ -261,7 +261,7 @@ func (s *SecureChannelSession) transmitEncrypted(cla, ins, p1, p2 byte, data []b
...
@@ -261,7 +261,7 @@ func (s *SecureChannelSession) transmitEncrypted(cla, ins, p1, p2 byte, data []b
rapdu
.
deserialize
(
plainData
)
rapdu
.
deserialize
(
plainData
)
if
rapdu
.
Sw1
!=
sw1Ok
{
if
rapdu
.
Sw1
!=
sw1Ok
{
return
nil
,
fmt
.
Errorf
(
"unexpected response status Cla=
0x%x, Ins=0x%x, Sw=0x%
x%x"
,
cla
,
ins
,
rapdu
.
Sw1
,
rapdu
.
Sw2
)
return
nil
,
fmt
.
Errorf
(
"unexpected response status Cla=
%#x, Ins=%#x, Sw=%#
x%x"
,
cla
,
ins
,
rapdu
.
Sw1
,
rapdu
.
Sw2
)
}
}
return
rapdu
,
nil
return
rapdu
,
nil
...
...
accounts/scwallet/wallet.go
View file @
2697e44d
...
@@ -167,7 +167,7 @@ func transmit(card *pcsc.Card, command *commandAPDU) (*responseAPDU, error) {
...
@@ -167,7 +167,7 @@ func transmit(card *pcsc.Card, command *commandAPDU) (*responseAPDU, error) {
}
}
if
response
.
Sw1
!=
sw1Ok
{
if
response
.
Sw1
!=
sw1Ok
{
return
nil
,
fmt
.
Errorf
(
"unexpected insecure response status Cla=
0x%x, Ins=0x%x, Sw=0x%
x%x"
,
command
.
Cla
,
command
.
Ins
,
response
.
Sw1
,
response
.
Sw2
)
return
nil
,
fmt
.
Errorf
(
"unexpected insecure response status Cla=
%#x, Ins=%#x, Sw=%#
x%x"
,
command
.
Cla
,
command
.
Ins
,
response
.
Sw1
,
response
.
Sw2
)
}
}
return
response
,
nil
return
response
,
nil
...
...
cmd/devp2p/internal/ethtest/snap.go
View file @
2697e44d
...
@@ -496,10 +496,10 @@ func (s *Suite) snapGetAccountRange(t *utesting.T, tc *accRangeTest) error {
...
@@ -496,10 +496,10 @@ func (s *Suite) snapGetAccountRange(t *utesting.T, tc *accRangeTest) error {
}
}
if
len
(
hashes
)
>
0
{
if
len
(
hashes
)
>
0
{
if
exp
,
got
:=
tc
.
expFirst
,
res
.
Accounts
[
0
]
.
Hash
;
exp
!=
got
{
if
exp
,
got
:=
tc
.
expFirst
,
res
.
Accounts
[
0
]
.
Hash
;
exp
!=
got
{
return
fmt
.
Errorf
(
"expected first account
0x%x, got 0x%
x"
,
exp
,
got
)
return
fmt
.
Errorf
(
"expected first account
%#x, got %#
x"
,
exp
,
got
)
}
}
if
exp
,
got
:=
tc
.
expLast
,
res
.
Accounts
[
len
(
res
.
Accounts
)
-
1
]
.
Hash
;
exp
!=
got
{
if
exp
,
got
:=
tc
.
expLast
,
res
.
Accounts
[
len
(
res
.
Accounts
)
-
1
]
.
Hash
;
exp
!=
got
{
return
fmt
.
Errorf
(
"expected last account
0x%x, got 0x%
x"
,
exp
,
got
)
return
fmt
.
Errorf
(
"expected last account
%#x, got %#
x"
,
exp
,
got
)
}
}
}
}
// Reconstruct a partial trie from the response and verify it
// Reconstruct a partial trie from the response and verify it
...
...
cmd/evm/runner.go
View file @
2697e44d
...
@@ -309,7 +309,7 @@ allocated bytes: %d
...
@@ -309,7 +309,7 @@ allocated bytes: %d
`
,
initialGas
-
leftOverGas
,
stats
.
time
,
stats
.
allocs
,
stats
.
bytesAllocated
)
`
,
initialGas
-
leftOverGas
,
stats
.
time
,
stats
.
allocs
,
stats
.
bytesAllocated
)
}
}
if
tracer
==
nil
{
if
tracer
==
nil
{
fmt
.
Printf
(
"
0x%
x
\n
"
,
output
)
fmt
.
Printf
(
"
%#
x
\n
"
,
output
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
" error: %v
\n
"
,
err
)
fmt
.
Printf
(
" error: %v
\n
"
,
err
)
}
}
...
...
cmd/geth/dbcmd.go
View file @
2697e44d
...
@@ -337,9 +337,9 @@ func checkStateContent(ctx *cli.Context) error {
...
@@ -337,9 +337,9 @@ func checkStateContent(ctx *cli.Context) error {
hasher
.
Read
(
got
)
hasher
.
Read
(
got
)
if
!
bytes
.
Equal
(
k
,
got
)
{
if
!
bytes
.
Equal
(
k
,
got
)
{
errs
++
errs
++
fmt
.
Printf
(
"Error at
0x%
x
\n
"
,
k
)
fmt
.
Printf
(
"Error at
%#
x
\n
"
,
k
)
fmt
.
Printf
(
" Hash:
0x%
x
\n
"
,
got
)
fmt
.
Printf
(
" Hash:
%#
x
\n
"
,
got
)
fmt
.
Printf
(
" Data:
0x%
x
\n
"
,
v
)
fmt
.
Printf
(
" Data:
%#
x
\n
"
,
v
)
}
}
if
time
.
Since
(
lastLog
)
>
8
*
time
.
Second
{
if
time
.
Since
(
lastLog
)
>
8
*
time
.
Second
{
log
.
Info
(
"Iterating the database"
,
"at"
,
fmt
.
Sprintf
(
"%#x"
,
k
),
"elapsed"
,
common
.
PrettyDuration
(
time
.
Since
(
startTime
)))
log
.
Info
(
"Iterating the database"
,
"at"
,
fmt
.
Sprintf
(
"%#x"
,
k
),
"elapsed"
,
common
.
PrettyDuration
(
time
.
Since
(
startTime
)))
...
@@ -716,7 +716,7 @@ func showMetaData(ctx *cli.Context) error {
...
@@ -716,7 +716,7 @@ func showMetaData(ctx *cli.Context) error {
if
val
==
nil
{
if
val
==
nil
{
return
"<nil>"
return
"<nil>"
}
}
return
fmt
.
Sprintf
(
"%d (
0x%
x)"
,
*
val
,
*
val
)
return
fmt
.
Sprintf
(
"%d (
%#
x)"
,
*
val
,
*
val
)
}
}
data
:=
[][]
string
{
data
:=
[][]
string
{
{
"databaseVersion"
,
pp
(
rawdb
.
ReadDatabaseVersion
(
db
))},
{
"databaseVersion"
,
pp
(
rawdb
.
ReadDatabaseVersion
(
db
))},
...
@@ -726,7 +726,7 @@ func showMetaData(ctx *cli.Context) error {
...
@@ -726,7 +726,7 @@ func showMetaData(ctx *cli.Context) error {
if
b
:=
rawdb
.
ReadHeadBlock
(
db
);
b
!=
nil
{
if
b
:=
rawdb
.
ReadHeadBlock
(
db
);
b
!=
nil
{
data
=
append
(
data
,
[]
string
{
"headBlock.Hash"
,
fmt
.
Sprintf
(
"%v"
,
b
.
Hash
())})
data
=
append
(
data
,
[]
string
{
"headBlock.Hash"
,
fmt
.
Sprintf
(
"%v"
,
b
.
Hash
())})
data
=
append
(
data
,
[]
string
{
"headBlock.Root"
,
fmt
.
Sprintf
(
"%v"
,
b
.
Root
())})
data
=
append
(
data
,
[]
string
{
"headBlock.Root"
,
fmt
.
Sprintf
(
"%v"
,
b
.
Root
())})
data
=
append
(
data
,
[]
string
{
"headBlock.Number"
,
fmt
.
Sprintf
(
"%d (
0x%
x)"
,
b
.
Number
(),
b
.
Number
())})
data
=
append
(
data
,
[]
string
{
"headBlock.Number"
,
fmt
.
Sprintf
(
"%d (
%#
x)"
,
b
.
Number
(),
b
.
Number
())})
}
}
if
b
:=
rawdb
.
ReadSkeletonSyncStatus
(
db
);
b
!=
nil
{
if
b
:=
rawdb
.
ReadSkeletonSyncStatus
(
db
);
b
!=
nil
{
data
=
append
(
data
,
[]
string
{
"SkeletonSyncStatus"
,
string
(
b
)})
data
=
append
(
data
,
[]
string
{
"SkeletonSyncStatus"
,
string
(
b
)})
...
@@ -734,7 +734,7 @@ func showMetaData(ctx *cli.Context) error {
...
@@ -734,7 +734,7 @@ func showMetaData(ctx *cli.Context) error {
if
h
:=
rawdb
.
ReadHeadHeader
(
db
);
h
!=
nil
{
if
h
:=
rawdb
.
ReadHeadHeader
(
db
);
h
!=
nil
{
data
=
append
(
data
,
[]
string
{
"headHeader.Hash"
,
fmt
.
Sprintf
(
"%v"
,
h
.
Hash
())})
data
=
append
(
data
,
[]
string
{
"headHeader.Hash"
,
fmt
.
Sprintf
(
"%v"
,
h
.
Hash
())})
data
=
append
(
data
,
[]
string
{
"headHeader.Root"
,
fmt
.
Sprintf
(
"%v"
,
h
.
Root
)})
data
=
append
(
data
,
[]
string
{
"headHeader.Root"
,
fmt
.
Sprintf
(
"%v"
,
h
.
Root
)})
data
=
append
(
data
,
[]
string
{
"headHeader.Number"
,
fmt
.
Sprintf
(
"%d (
0x%
x)"
,
h
.
Number
,
h
.
Number
)})
data
=
append
(
data
,
[]
string
{
"headHeader.Number"
,
fmt
.
Sprintf
(
"%d (
%#
x)"
,
h
.
Number
,
h
.
Number
)})
}
}
data
=
append
(
data
,
[][]
string
{{
"frozen"
,
fmt
.
Sprintf
(
"%d items"
,
ancients
)},
data
=
append
(
data
,
[][]
string
{{
"frozen"
,
fmt
.
Sprintf
(
"%d items"
,
ancients
)},
{
"lastPivotNumber"
,
pp
(
rawdb
.
ReadLastPivotNumber
(
db
))},
{
"lastPivotNumber"
,
pp
(
rawdb
.
ReadLastPivotNumber
(
db
))},
...
...
cmd/rlpdump/main.go
View file @
2697e44d
...
@@ -83,7 +83,7 @@ func main() {
...
@@ -83,7 +83,7 @@ func main() {
if
err
!=
nil
{
if
err
!=
nil
{
die
(
err
)
die
(
err
)
}
}
fmt
.
Printf
(
"
0x%
x
\n
"
,
data
)
fmt
.
Printf
(
"
%#
x
\n
"
,
data
)
return
return
}
else
{
}
else
{
err
:=
rlpToText
(
r
,
out
)
err
:=
rlpToText
(
r
,
out
)
...
...
cmd/rlpdump/rlpdump_test.go
View file @
2697e44d
...
@@ -43,7 +43,7 @@ func TestRoundtrip(t *testing.T) {
...
@@ -43,7 +43,7 @@ func TestRoundtrip(t *testing.T) {
t
.
Errorf
(
"test %d: error %v"
,
i
,
err
)
t
.
Errorf
(
"test %d: error %v"
,
i
,
err
)
continue
continue
}
}
have
:=
fmt
.
Sprintf
(
"
0x%
x"
,
rlpBytes
)
have
:=
fmt
.
Sprintf
(
"
%#
x"
,
rlpBytes
)
if
have
!=
want
{
if
have
!=
want
{
t
.
Errorf
(
"test %d: have
\n
%v
\n
want:
\n
%v
\n
"
,
i
,
have
,
want
)
t
.
Errorf
(
"test %d: have
\n
%v
\n
want:
\n
%v
\n
"
,
i
,
have
,
want
)
}
}
...
...
consensus/misc/forks.go
View file @
2697e44d
...
@@ -35,7 +35,7 @@ func VerifyForkHashes(config *params.ChainConfig, header *types.Header, uncle bo
...
@@ -35,7 +35,7 @@ func VerifyForkHashes(config *params.ChainConfig, header *types.Header, uncle bo
// If the homestead reprice hash is set, validate it
// If the homestead reprice hash is set, validate it
if
config
.
EIP150Block
!=
nil
&&
config
.
EIP150Block
.
Cmp
(
header
.
Number
)
==
0
{
if
config
.
EIP150Block
!=
nil
&&
config
.
EIP150Block
.
Cmp
(
header
.
Number
)
==
0
{
if
config
.
EIP150Hash
!=
(
common
.
Hash
{})
&&
config
.
EIP150Hash
!=
header
.
Hash
()
{
if
config
.
EIP150Hash
!=
(
common
.
Hash
{})
&&
config
.
EIP150Hash
!=
header
.
Hash
()
{
return
fmt
.
Errorf
(
"homestead gas reprice fork: have
0x%x, want 0x%
x"
,
header
.
Hash
(),
config
.
EIP150Hash
)
return
fmt
.
Errorf
(
"homestead gas reprice fork: have
%#x, want %#
x"
,
header
.
Hash
(),
config
.
EIP150Hash
)
}
}
}
}
// All ok, return
// All ok, return
...
...
core/asm/asm.go
View file @
2697e44d
...
@@ -109,7 +109,7 @@ func PrintDisassembled(code string) error {
...
@@ -109,7 +109,7 @@ func PrintDisassembled(code string) error {
it
:=
NewInstructionIterator
(
script
)
it
:=
NewInstructionIterator
(
script
)
for
it
.
Next
()
{
for
it
.
Next
()
{
if
it
.
Arg
()
!=
nil
&&
0
<
len
(
it
.
Arg
())
{
if
it
.
Arg
()
!=
nil
&&
0
<
len
(
it
.
Arg
())
{
fmt
.
Printf
(
"%05x: %v
0x%
x
\n
"
,
it
.
PC
(),
it
.
Op
(),
it
.
Arg
())
fmt
.
Printf
(
"%05x: %v
%#
x
\n
"
,
it
.
PC
(),
it
.
Op
(),
it
.
Arg
())
}
else
{
}
else
{
fmt
.
Printf
(
"%05x: %v
\n
"
,
it
.
PC
(),
it
.
Op
())
fmt
.
Printf
(
"%05x: %v
\n
"
,
it
.
PC
(),
it
.
Op
())
}
}
...
@@ -124,7 +124,7 @@ func Disassemble(script []byte) ([]string, error) {
...
@@ -124,7 +124,7 @@ func Disassemble(script []byte) ([]string, error) {
it
:=
NewInstructionIterator
(
script
)
it
:=
NewInstructionIterator
(
script
)
for
it
.
Next
()
{
for
it
.
Next
()
{
if
it
.
Arg
()
!=
nil
&&
0
<
len
(
it
.
Arg
())
{
if
it
.
Arg
()
!=
nil
&&
0
<
len
(
it
.
Arg
())
{
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%05x: %v
0x%
x
\n
"
,
it
.
PC
(),
it
.
Op
(),
it
.
Arg
()))
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%05x: %v
%#
x
\n
"
,
it
.
PC
(),
it
.
Op
(),
it
.
Arg
()))
}
else
{
}
else
{
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%05x: %v
\n
"
,
it
.
PC
(),
it
.
Op
()))
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%05x: %v
\n
"
,
it
.
PC
(),
it
.
Op
()))
}
}
...
...
core/blockchain.go
View file @
2697e44d
...
@@ -2342,7 +2342,7 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e
...
@@ -2342,7 +2342,7 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e
Chain config: %v
Chain config: %v
Number: %v
Number: %v
Hash:
0x%
x
Hash:
%#
x
%v
%v
Error: %v
Error: %v
...
...
core/types/hashing_test.go
View file @
2697e44d
...
@@ -197,7 +197,7 @@ func printList(l types.DerivableList) {
...
@@ -197,7 +197,7 @@ func printList(l types.DerivableList) {
for
i
:=
0
;
i
<
l
.
Len
();
i
++
{
for
i
:=
0
;
i
<
l
.
Len
();
i
++
{
var
buf
bytes
.
Buffer
var
buf
bytes
.
Buffer
l
.
EncodeIndex
(
i
,
&
buf
)
l
.
EncodeIndex
(
i
,
&
buf
)
fmt
.
Printf
(
"
\"
0x%
x
\"
,
\n
"
,
buf
.
Bytes
())
fmt
.
Printf
(
"
\"
%#
x
\"
,
\n
"
,
buf
.
Bytes
())
}
}
fmt
.
Printf
(
"},
\n
"
)
fmt
.
Printf
(
"},
\n
"
)
}
}
...
...
core/vm/jump_table.go
View file @
2697e44d
...
@@ -63,7 +63,7 @@ type JumpTable [256]*operation
...
@@ -63,7 +63,7 @@ type JumpTable [256]*operation
func
validate
(
jt
JumpTable
)
JumpTable
{
func
validate
(
jt
JumpTable
)
JumpTable
{
for
i
,
op
:=
range
jt
{
for
i
,
op
:=
range
jt
{
if
op
==
nil
{
if
op
==
nil
{
panic
(
fmt
.
Sprintf
(
"op
0x%
x is not set"
,
i
))
panic
(
fmt
.
Sprintf
(
"op
%#
x is not set"
,
i
))
}
}
// The interpreter has an assumption that if the memorySize function is
// The interpreter has an assumption that if the memorySize function is
// set, then the dynamicGas function is also set. This is a somewhat
// set, then the dynamicGas function is also set. This is a somewhat
...
...
core/vm/opcodes.go
View file @
2697e44d
...
@@ -392,7 +392,7 @@ var opCodeToString = map[OpCode]string{
...
@@ -392,7 +392,7 @@ var opCodeToString = map[OpCode]string{
func
(
op
OpCode
)
String
()
string
{
func
(
op
OpCode
)
String
()
string
{
str
:=
opCodeToString
[
op
]
str
:=
opCodeToString
[
op
]
if
len
(
str
)
==
0
{
if
len
(
str
)
==
0
{
return
fmt
.
Sprintf
(
"opcode
0x%
x not defined"
,
int
(
op
))
return
fmt
.
Sprintf
(
"opcode
%#
x not defined"
,
int
(
op
))
}
}
return
str
return
str
...
...
core/vm/runtime/runtime_test.go
View file @
2697e44d
...
@@ -503,7 +503,7 @@ func TestEip2929Cases(t *testing.T) {
...
@@ -503,7 +503,7 @@ func TestEip2929Cases(t *testing.T) {
it
:=
asm
.
NewInstructionIterator
(
code
)
it
:=
asm
.
NewInstructionIterator
(
code
)
for
it
.
Next
()
{
for
it
.
Next
()
{
if
it
.
Arg
()
!=
nil
&&
0
<
len
(
it
.
Arg
())
{
if
it
.
Arg
()
!=
nil
&&
0
<
len
(
it
.
Arg
())
{
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%v
0x%
x"
,
it
.
Op
(),
it
.
Arg
()))
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%v
%#
x"
,
it
.
Op
(),
it
.
Arg
()))
}
else
{
}
else
{
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%v"
,
it
.
Op
()))
instrs
=
append
(
instrs
,
fmt
.
Sprintf
(
"%v"
,
it
.
Op
()))
}
}
...
@@ -511,7 +511,7 @@ func TestEip2929Cases(t *testing.T) {
...
@@ -511,7 +511,7 @@ func TestEip2929Cases(t *testing.T) {
ops
:=
strings
.
Join
(
instrs
,
", "
)
ops
:=
strings
.
Join
(
instrs
,
", "
)
fmt
.
Printf
(
"### Case %d
\n\n
"
,
id
)
fmt
.
Printf
(
"### Case %d
\n\n
"
,
id
)
id
++
id
++
fmt
.
Printf
(
"%v
\n\n
Bytecode:
\n
```
\n
0x%
x
\n
```
\n
Operations:
\n
```
\n
%v
\n
```
\n\n
"
,
fmt
.
Printf
(
"%v
\n\n
Bytecode:
\n
```
\n
%#
x
\n
```
\n
Operations:
\n
```
\n
%v
\n
```
\n\n
"
,
comment
,
comment
,
code
,
ops
)
code
,
ops
)
Execute
(
code
,
nil
,
&
Config
{
Execute
(
code
,
nil
,
&
Config
{
...
...
eth/api.go
View file @
2697e44d
...
@@ -316,7 +316,7 @@ func (api *DebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error)
...
@@ -316,7 +316,7 @@ func (api *DebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error)
if
rlpBytes
,
err
:=
rlp
.
EncodeToBytes
(
block
);
err
!=
nil
{
if
rlpBytes
,
err
:=
rlp
.
EncodeToBytes
(
block
);
err
!=
nil
{
blockRlp
=
err
.
Error
()
// Hacky, but hey, it works
blockRlp
=
err
.
Error
()
// Hacky, but hey, it works
}
else
{
}
else
{
blockRlp
=
fmt
.
Sprintf
(
"
0x%
x"
,
rlpBytes
)
blockRlp
=
fmt
.
Sprintf
(
"
%#
x"
,
rlpBytes
)
}
}
if
blockJSON
,
err
=
ethapi
.
RPCMarshalBlock
(
block
,
true
,
true
,
api
.
eth
.
APIBackend
.
ChainConfig
());
err
!=
nil
{
if
blockJSON
,
err
=
ethapi
.
RPCMarshalBlock
(
block
,
true
,
true
,
api
.
eth
.
APIBackend
.
ChainConfig
());
err
!=
nil
{
blockJSON
=
map
[
string
]
interface
{}{
"error"
:
err
.
Error
()}
blockJSON
=
map
[
string
]
interface
{}{
"error"
:
err
.
Error
()}
...
...
eth/api_test.go
View file @
2697e44d
...
@@ -213,7 +213,7 @@ func TestStorageRangeAt(t *testing.T) {
...
@@ -213,7 +213,7 @@ func TestStorageRangeAt(t *testing.T) {
t
.
Error
(
err
)
t
.
Error
(
err
)
}
}
if
!
reflect
.
DeepEqual
(
result
,
test
.
want
)
{
if
!
reflect
.
DeepEqual
(
result
,
test
.
want
)
{
t
.
Fatalf
(
"wrong result for range
0x%
x.., limit %d:
\n
got %s
\n
want %s"
,
t
.
Fatalf
(
"wrong result for range
%#
x.., limit %d:
\n
got %s
\n
want %s"
,
test
.
start
,
test
.
limit
,
dumper
.
Sdump
(
result
),
dumper
.
Sdump
(
&
test
.
want
))
test
.
start
,
test
.
limit
,
dumper
.
Sdump
(
result
),
dumper
.
Sdump
(
&
test
.
want
))
}
}
}
}
...
...
eth/filters/api_test.go
View file @
2697e44d
...
@@ -56,7 +56,7 @@ func TestUnmarshalJSONNewFilterArgs(t *testing.T) {
...
@@ -56,7 +56,7 @@ func TestUnmarshalJSONNewFilterArgs(t *testing.T) {
// from, to block number
// from, to block number
var
test1
FilterCriteria
var
test1
FilterCriteria
vector
:=
fmt
.
Sprintf
(
`{"fromBlock":"
0x%x","toBlock":"0x%
x"}`
,
fromBlock
,
toBlock
)
vector
:=
fmt
.
Sprintf
(
`{"fromBlock":"
%#x","toBlock":"%#
x"}`
,
fromBlock
,
toBlock
)
if
err
:=
json
.
Unmarshal
([]
byte
(
vector
),
&
test1
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
vector
),
&
test1
);
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
eth/tracers/logger/logger.go
View file @
2697e44d
...
@@ -224,7 +224,7 @@ func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration
...
@@ -224,7 +224,7 @@ func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration
l
.
output
=
output
l
.
output
=
output
l
.
err
=
err
l
.
err
=
err
if
l
.
cfg
.
Debug
{
if
l
.
cfg
.
Debug
{
fmt
.
Printf
(
"
0x%
x
\n
"
,
output
)
fmt
.
Printf
(
"
%#
x
\n
"
,
output
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
" error: %v
\n
"
,
err
)
fmt
.
Printf
(
" error: %v
\n
"
,
err
)
}
}
...
@@ -346,11 +346,11 @@ func NewMarkdownLogger(cfg *Config, writer io.Writer) *mdLogger {
...
@@ -346,11 +346,11 @@ func NewMarkdownLogger(cfg *Config, writer io.Writer) *mdLogger {
func
(
t
*
mdLogger
)
CaptureStart
(
env
*
vm
.
EVM
,
from
common
.
Address
,
to
common
.
Address
,
create
bool
,
input
[]
byte
,
gas
uint64
,
value
*
big
.
Int
)
{
func
(
t
*
mdLogger
)
CaptureStart
(
env
*
vm
.
EVM
,
from
common
.
Address
,
to
common
.
Address
,
create
bool
,
input
[]
byte
,
gas
uint64
,
value
*
big
.
Int
)
{
t
.
env
=
env
t
.
env
=
env
if
!
create
{
if
!
create
{
fmt
.
Fprintf
(
t
.
out
,
"From: `%v`
\n
To: `%v`
\n
Data: `
0x%
x`
\n
Gas: `%d`
\n
Value `%v` wei
\n
"
,
fmt
.
Fprintf
(
t
.
out
,
"From: `%v`
\n
To: `%v`
\n
Data: `
%#
x`
\n
Gas: `%d`
\n
Value `%v` wei
\n
"
,
from
.
String
(),
to
.
String
(),
from
.
String
(),
to
.
String
(),
input
,
gas
,
value
)
input
,
gas
,
value
)
}
else
{
}
else
{
fmt
.
Fprintf
(
t
.
out
,
"From: `%v`
\n
Create at: `%v`
\n
Data: `
0x%
x`
\n
Gas: `%d`
\n
Value `%v` wei
\n
"
,
fmt
.
Fprintf
(
t
.
out
,
"From: `%v`
\n
Create at: `%v`
\n
Data: `
%#
x`
\n
Gas: `%d`
\n
Value `%v` wei
\n
"
,
from
.
String
(),
to
.
String
(),
from
.
String
(),
to
.
String
(),
input
,
gas
,
value
)
input
,
gas
,
value
)
}
}
...
@@ -387,7 +387,7 @@ func (t *mdLogger) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope
...
@@ -387,7 +387,7 @@ func (t *mdLogger) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope
}
}
func
(
t
*
mdLogger
)
CaptureEnd
(
output
[]
byte
,
gasUsed
uint64
,
tm
time
.
Duration
,
err
error
)
{
func
(
t
*
mdLogger
)
CaptureEnd
(
output
[]
byte
,
gasUsed
uint64
,
tm
time
.
Duration
,
err
error
)
{
fmt
.
Fprintf
(
t
.
out
,
"
\n
Output: `
0x%
x`
\n
Consumed gas: `%d`
\n
Error: `%v`
\n
"
,
fmt
.
Fprintf
(
t
.
out
,
"
\n
Output: `
%#
x`
\n
Consumed gas: `%d`
\n
Error: `%v`
\n
"
,
output
,
gasUsed
,
err
)
output
,
gasUsed
,
err
)
}
}
...
...
internal/ethapi/api.go
View file @
2697e44d
...
@@ -1950,7 +1950,7 @@ func (api *DebugAPI) SeedHash(ctx context.Context, number uint64) (string, error
...
@@ -1950,7 +1950,7 @@ func (api *DebugAPI) SeedHash(ctx context.Context, number uint64) (string, error
if
block
==
nil
{
if
block
==
nil
{
return
""
,
fmt
.
Errorf
(
"block #%d not found"
,
number
)
return
""
,
fmt
.
Errorf
(
"block #%d not found"
,
number
)
}
}
return
fmt
.
Sprintf
(
"
0x%
x"
,
ethash
.
SeedHash
(
number
)),
nil
return
fmt
.
Sprintf
(
"
%#
x"
,
ethash
.
SeedHash
(
number
)),
nil
}
}
// ChaindbProperty returns leveldb properties of the key-value database.
// ChaindbProperty returns leveldb properties of the key-value database.
...
...
mobile/types.go
View file @
2697e44d
...
@@ -55,7 +55,7 @@ func (n *Nonce) GetBytes() []byte {
...
@@ -55,7 +55,7 @@ func (n *Nonce) GetBytes() []byte {
// GetHex retrieves the hex string representation of the block nonce.
// GetHex retrieves the hex string representation of the block nonce.
func
(
n
*
Nonce
)
GetHex
()
string
{
func
(
n
*
Nonce
)
GetHex
()
string
{
return
fmt
.
Sprintf
(
"
0x%
x"
,
n
.
nonce
[
:
])
return
fmt
.
Sprintf
(
"
%#
x"
,
n
.
nonce
[
:
])
}
}
// String returns a printable representation of the nonce.
// String returns a printable representation of the nonce.
...
@@ -75,7 +75,7 @@ func (b *Bloom) GetBytes() []byte {
...
@@ -75,7 +75,7 @@ func (b *Bloom) GetBytes() []byte {
// GetHex retrieves the hex string representation of the bloom filter.
// GetHex retrieves the hex string representation of the bloom filter.
func
(
b
*
Bloom
)
GetHex
()
string
{
func
(
b
*
Bloom
)
GetHex
()
string
{
return
fmt
.
Sprintf
(
"
0x%
x"
,
b
.
bloom
[
:
])
return
fmt
.
Sprintf
(
"
%#
x"
,
b
.
bloom
[
:
])
}
}
// String returns a printable representation of the bloom filter.
// String returns a printable representation of the bloom filter.
...
...
signer/core/apitypes/types.go
View file @
2697e44d
...
@@ -659,7 +659,7 @@ func formatPrimitiveValue(encType string, encValue interface{}) (string, error)
...
@@ -659,7 +659,7 @@ func formatPrimitiveValue(encType string, encValue interface{}) (string, error)
if
b
,
err
:=
parseInteger
(
encType
,
encValue
);
err
!=
nil
{
if
b
,
err
:=
parseInteger
(
encType
,
encValue
);
err
!=
nil
{
return
""
,
err
return
""
,
err
}
else
{
}
else
{
return
fmt
.
Sprintf
(
"%d (
0x%
x)"
,
b
,
b
),
nil
return
fmt
.
Sprintf
(
"%d (
%#
x)"
,
b
,
b
),
nil
}
}
}
}
return
""
,
fmt
.
Errorf
(
"unhandled type %v"
,
encType
)
return
""
,
fmt
.
Errorf
(
"unhandled type %v"
,
encType
)
...
...
signer/core/signed_data.go
View file @
2697e44d
...
@@ -129,7 +129,7 @@ func (api *SignerAPI) determineSignatureFormat(ctx context.Context, contentType
...
@@ -129,7 +129,7 @@ func (api *SignerAPI) determineSignatureFormat(ctx context.Context, contentType
{
{
Name
:
"Full message for signing"
,
Name
:
"Full message for signing"
,
Typ
:
"hexdata"
,
Typ
:
"hexdata"
,
Value
:
fmt
.
Sprintf
(
"
0x%
x"
,
msg
),
Value
:
fmt
.
Sprintf
(
"
%#
x"
,
msg
),
},
},
}
}
req
=
&
SignDataRequest
{
ContentType
:
mediaType
,
Rawdata
:
[]
byte
(
msg
),
Messages
:
messages
,
Hash
:
sighash
}
req
=
&
SignDataRequest
{
ContentType
:
mediaType
,
Rawdata
:
[]
byte
(
msg
),
Messages
:
messages
,
Hash
:
sighash
}
...
@@ -161,7 +161,7 @@ func (api *SignerAPI) determineSignatureFormat(ctx context.Context, contentType
...
@@ -161,7 +161,7 @@ func (api *SignerAPI) determineSignatureFormat(ctx context.Context, contentType
{
{
Name
:
"Clique header"
,
Name
:
"Clique header"
,
Typ
:
"clique"
,
Typ
:
"clique"
,
Value
:
fmt
.
Sprintf
(
"clique header %d [
0x%
x]"
,
header
.
Number
,
header
.
Hash
()),
Value
:
fmt
.
Sprintf
(
"clique header %d [
%#
x]"
,
header
.
Number
,
header
.
Hash
()),
},
},
}
}
// Clique uses V on the form 0 or 1
// Clique uses V on the form 0 or 1
...
...
tests/fuzzers/stacktrie/trie_fuzzer.go
View file @
2697e44d
...
@@ -185,7 +185,7 @@ func (f *fuzzer) fuzz() int {
...
@@ -185,7 +185,7 @@ func (f *fuzzer) fuzz() int {
sort
.
Sort
(
vals
)
sort
.
Sort
(
vals
)
for
_
,
kv
:=
range
vals
{
for
_
,
kv
:=
range
vals
{
if
f
.
debugging
{
if
f
.
debugging
{
fmt
.
Printf
(
"{
\"
0x%x
\"
,
\"
0x%
x
\"
} // stacktrie.Update
\n
"
,
kv
.
k
,
kv
.
v
)
fmt
.
Printf
(
"{
\"
%#x
\"
,
\"
%#
x
\"
} // stacktrie.Update
\n
"
,
kv
.
k
,
kv
.
v
)
}
}
trieB
.
Update
(
kv
.
k
,
kv
.
v
)
trieB
.
Update
(
kv
.
k
,
kv
.
v
)
}
}
...
...
tests/fuzzers/trie/trie-fuzzer.go
View file @
2697e44d
...
@@ -159,7 +159,7 @@ func runRandTest(rt randTest) error {
...
@@ -159,7 +159,7 @@ func runRandTest(rt randTest) error {
v
:=
tr
.
Get
(
step
.
key
)
v
:=
tr
.
Get
(
step
.
key
)
want
:=
values
[
string
(
step
.
key
)]
want
:=
values
[
string
(
step
.
key
)]
if
string
(
v
)
!=
want
{
if
string
(
v
)
!=
want
{
rt
[
i
]
.
err
=
fmt
.
Errorf
(
"mismatch for key
0x%x, got 0x%x want 0x%
x"
,
step
.
key
,
v
,
want
)
rt
[
i
]
.
err
=
fmt
.
Errorf
(
"mismatch for key
%#x, got %#x want %#
x"
,
step
.
key
,
v
,
want
)
}
}
case
opCommit
:
case
opCommit
:
_
,
_
,
rt
[
i
]
.
err
=
tr
.
Commit
(
nil
)
_
,
_
,
rt
[
i
]
.
err
=
tr
.
Commit
(
nil
)
...
...
trie/trie_test.go
View file @
2697e44d
...
@@ -432,7 +432,7 @@ func runRandTest(rt randTest) bool {
...
@@ -432,7 +432,7 @@ func runRandTest(rt randTest) bool {
v
:=
tr
.
Get
(
step
.
key
)
v
:=
tr
.
Get
(
step
.
key
)
want
:=
values
[
string
(
step
.
key
)]
want
:=
values
[
string
(
step
.
key
)]
if
string
(
v
)
!=
want
{
if
string
(
v
)
!=
want
{
rt
[
i
]
.
err
=
fmt
.
Errorf
(
"mismatch for key
0x%x, got 0x%x want 0x%
x"
,
step
.
key
,
v
,
want
)
rt
[
i
]
.
err
=
fmt
.
Errorf
(
"mismatch for key
%#x, got %#x want %#
x"
,
step
.
key
,
v
,
want
)
}
}
case
opCommit
:
case
opCommit
:
_
,
_
,
rt
[
i
]
.
err
=
tr
.
Commit
(
nil
)
_
,
_
,
rt
[
i
]
.
err
=
tr
.
Commit
(
nil
)
...
...
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