From 8b072302b0a1c82942ac196f930a6ed4b5fa446b Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 25 Sep 2024 11:10:49 +0800 Subject: [PATCH] all: change format 0x%x to %#x (#25221) --- cmd/evm/runner.go | 4 +- consensus/misc/forks.go | 2 +- core/asm/asm.go | 4 +- core/blockchain.go | 2 +- core/types/transaction.go | 2 +- core/vm/instructions_test.go | 2 +- core/vm/logger.go | 8 +- core/vm/runtime/runtime_test.go | 4 +- eth/api_test.go | 5 +- eth/filters/api_test.go | 2 +- internal/ethapi/api.go | 2 +- mobile/types.go | 4 +- p2p/discover/database_test.go | 6 +- p2p/discv5/database_test.go | 6 +- rlp/rlpgen/gen.go | 2 +- test.txt | 801 ++++++++++++++++++++++++++++++++ tests/state_test.go | 2 +- trie/trie_test.go | 2 +- 18 files changed, 831 insertions(+), 29 deletions(-) create mode 100644 test.txt diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 101069aff4f7..3c9e7ac00f6e 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -76,7 +76,7 @@ func runCmd(ctx *cli.Context) error { log.Root().SetHandler(glogger) logconfig := &vm.LogConfig{ EnableMemory: !ctx.GlobalBool(DisableMemoryFlag.Name), - DisableStack: ctx.GlobalBool(DisableStackFlag.Name), + DisableStack: ctx.GlobalBool(DisableStackFlag.Name), } var ( @@ -238,7 +238,7 @@ Gas used: %d if tracer != nil { tracer.CaptureEnd(ret, initialGas-leftOverGas, execTime, err) } else { - fmt.Printf("0x%x\n", ret) + fmt.Printf("%#x\n", ret) if err != nil { fmt.Printf(" error: %v\n", err) } diff --git a/consensus/misc/forks.go b/consensus/misc/forks.go index 910ed620c545..b1e789f6013e 100644 --- a/consensus/misc/forks.go +++ b/consensus/misc/forks.go @@ -35,7 +35,7 @@ func VerifyForkHashes(config *params.ChainConfig, header *types.Header, uncle bo // If the homestead reprice hash is set, validate it if config.EIP150Block != nil && config.EIP150Block.Cmp(header.Number) == 0 { 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 diff --git a/core/asm/asm.go b/core/asm/asm.go index 79406aaf6024..33aa034e7120 100644 --- a/core/asm/asm.go +++ b/core/asm/asm.go @@ -109,7 +109,7 @@ func PrintDisassembled(code string) error { it := NewInstructionIterator(script) for it.Next() { if it.Arg() != nil && 0 < len(it.Arg()) { - fmt.Printf("%06v: %v 0x%x\n", it.PC(), it.Op(), it.Arg()) + fmt.Printf("%06v: %v %#x\n", it.PC(), it.Op(), it.Arg()) } else { fmt.Printf("%06v: %v\n", it.PC(), it.Op()) } @@ -124,7 +124,7 @@ func Disassemble(script []byte) ([]string, error) { it := NewInstructionIterator(script) for it.Next() { if it.Arg() != nil && 0 < len(it.Arg()) { - instrs = append(instrs, fmt.Sprintf("%06v: %v 0x%x\n", it.PC(), it.Op(), it.Arg())) + instrs = append(instrs, fmt.Sprintf("%06v: %v %#x\n", it.PC(), it.Op(), it.Arg())) } else { instrs = append(instrs, fmt.Sprintf("%06v: %v\n", it.PC(), it.Op())) } diff --git a/core/blockchain.go b/core/blockchain.go index 006e94fd0e05..fb98f45dab93 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2365,7 +2365,7 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e Chain config: %v Number: %v -Hash: 0x%x +Hash: %#x %v Round: %v diff --git a/core/types/transaction.go b/core/types/transaction.go index 1c02d70537c3..9549af34027d 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -539,7 +539,7 @@ func (tx *Transaction) String() string { GasPrice: %#x GasLimit %#x Value: %#x - Data: 0x%x + Data: %#x V: %#x R: %#x S: %#x diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index c4a631729382..000a22b2d8eb 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -654,7 +654,7 @@ func TestCreate2Addreses(t *testing.T) { stack.push(big.NewInt(0)) // memstart stack.push(big.NewInt(0)) // value gas, _ := gasCreate2(params.GasTable{}, nil, nil, stack, nil, 0) - fmt.Printf("Example %d\n* address `0x%x`\n* salt `0x%x`\n* init_code `0x%x`\n* gas (assuming no mem expansion): `%v`\n* result: `%s`\n\n", i,origin, salt, code, gas, address.String()) + fmt.Printf("Example %d\n* address `%#x`\n* salt `%#x`\n* init_code `%#x`\n* gas (assuming no mem expansion): `%v`\n* result: `%s`\n\n", i,origin, salt, code, gas, address.String()) */ expected := common.BytesToAddress(common.FromHex(tt.expected)) if !bytes.Equal(expected.Bytes(), address.Bytes()) { diff --git a/core/vm/logger.go b/core/vm/logger.go index e8294e3d674a..ce014b17fc1e 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -220,7 +220,7 @@ func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration l.output = output l.err = err if l.cfg.Debug { - fmt.Printf("0x%x\n", output) + fmt.Printf("%#x\n", output) if err != nil { fmt.Printf(" error: %v\n", err) } @@ -305,11 +305,11 @@ func NewMarkdownLogger(cfg *LogConfig, writer io.Writer) *mdLogger { func (t *mdLogger) CaptureStart(env *EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) { if !create { - fmt.Fprintf(t.out, "From: `%v`\nTo: `%v`\nData: `0x%x`\nGas: `%d`\nValue `%v` wei\n", + fmt.Fprintf(t.out, "From: `%v`\nTo: `%v`\nData: `%#x`\nGas: `%d`\nValue `%v` wei\n", from.String(), to.String(), input, gas, value) } else { - fmt.Fprintf(t.out, "From: `%v`\nCreate at: `%v`\nData: `0x%x`\nGas: `%d`\nValue `%v` wei\n", + fmt.Fprintf(t.out, "From: `%v`\nCreate at: `%v`\nData: `%#x`\nGas: `%d`\nValue `%v` wei\n", from.String(), to.String(), input, gas, value) } @@ -346,7 +346,7 @@ func (t *mdLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64 } func (t *mdLogger) CaptureEnd(output []byte, gasUsed uint64, tm time.Duration, err error) { - fmt.Fprintf(t.out, "\nOutput: `0x%x`\nConsumed gas: `%d`\nError: `%v`\n", + fmt.Fprintf(t.out, "\nOutput: `%#x`\nConsumed gas: `%d`\nError: `%v`\n", output, gasUsed, err) } diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index 826b431f48ad..21f5e1a57529 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -498,7 +498,7 @@ func TestEip2929Cases(t *testing.T) { it := asm.NewInstructionIterator(code) for it.Next() { 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 { instrs = append(instrs, fmt.Sprintf("%v", it.Op())) } @@ -506,7 +506,7 @@ func TestEip2929Cases(t *testing.T) { ops := strings.Join(instrs, ", ") fmt.Printf("### Case %d\n\n", id) id++ - fmt.Printf("%v\n\nBytecode: \n```\n0x%x\n```\nOperations: \n```\n%v\n```\n\n", + fmt.Printf("%v\n\nBytecode: \n```\n%#x\n```\nOperations: \n```\n%v\n```\n\n", comment, code, ops) Execute(code, nil, &Config{ diff --git a/eth/api_test.go b/eth/api_test.go index 37a16e8f790c..b7a6929b6ad1 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -17,10 +17,11 @@ package eth import ( - "github.com/XinFinOrg/XDPoSChain/core/rawdb" "reflect" "testing" + "github.com/XinFinOrg/XDPoSChain/core/rawdb" + "github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/core/state" "github.com/davecgh/go-spew/spew" @@ -84,7 +85,7 @@ func TestStorageRangeAt(t *testing.T) { t.Error(err) } if !reflect.DeepEqual(result, test.want) { - t.Fatalf("wrong result for range 0x%x.., limit %d:\ngot %s\nwant %s", + t.Fatalf("wrong result for range %#x.., limit %d:\ngot %s\nwant %s", test.start, test.limit, dumper.Sdump(result), dumper.Sdump(&test.want)) } } diff --git a/eth/filters/api_test.go b/eth/filters/api_test.go index f74c13e64390..ca0f0c60eb56 100644 --- a/eth/filters/api_test.go +++ b/eth/filters/api_test.go @@ -56,7 +56,7 @@ func TestUnmarshalJSONNewFilterArgs(t *testing.T) { // from, to block number 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 { t.Fatal(err) } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 62e0f101ece4..3ef8df9b30e2 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -3333,7 +3333,7 @@ func (api *PublicDebugAPI) SeedHash(ctx context.Context, number uint64) (string, if block == nil { 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 } // PrivateDebugAPI is the collection of Ethereum APIs exposed over the private diff --git a/mobile/types.go b/mobile/types.go index f577606e97a3..24ba9b4ddfc1 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -41,7 +41,7 @@ func (n *Nonce) GetBytes() []byte { // GetHex retrieves the hex string representation of the block nonce. func (n *Nonce) GetHex() string { - return fmt.Sprintf("0x%x", n.nonce[:]) + return fmt.Sprintf("%#x", n.nonce[:]) } // Bloom represents a 256 bit bloom filter. @@ -56,7 +56,7 @@ func (b *Bloom) GetBytes() []byte { // GetHex retrieves the hex string representation of the bloom filter. func (b *Bloom) GetHex() string { - return fmt.Sprintf("0x%x", b.bloom[:]) + return fmt.Sprintf("%#x", b.bloom[:]) } // Header represents a block header in the Ethereum blockchain. diff --git a/p2p/discover/database_test.go b/p2p/discover/database_test.go index 6f452a060ceb..d881c653377e 100644 --- a/p2p/discover/database_test.go +++ b/p2p/discover/database_test.go @@ -56,14 +56,14 @@ var nodeDBKeyTests = []struct { func TestNodeDBKeys(t *testing.T) { for i, tt := range nodeDBKeyTests { if key := makeKey(tt.id, tt.field); !bytes.Equal(key, tt.key) { - t.Errorf("make test %d: key mismatch: have 0x%x, want 0x%x", i, key, tt.key) + t.Errorf("make test %d: key mismatch: have %#x, want %#x", i, key, tt.key) } id, field := splitKey(tt.key) if !bytes.Equal(id[:], tt.id[:]) { - t.Errorf("split test %d: id mismatch: have 0x%x, want 0x%x", i, id, tt.id) + t.Errorf("split test %d: id mismatch: have %#x, want %#x", i, id, tt.id) } if field != tt.field { - t.Errorf("split test %d: field mismatch: have 0x%x, want 0x%x", i, field, tt.field) + t.Errorf("split test %d: field mismatch: have %#x, want %#x", i, field, tt.field) } } } diff --git a/p2p/discv5/database_test.go b/p2p/discv5/database_test.go index ff0bc1a174bc..73ee613a34fe 100644 --- a/p2p/discv5/database_test.go +++ b/p2p/discv5/database_test.go @@ -56,14 +56,14 @@ var nodeDBKeyTests = []struct { func TestNodeDBKeys(t *testing.T) { for i, tt := range nodeDBKeyTests { if key := makeKey(tt.id, tt.field); !bytes.Equal(key, tt.key) { - t.Errorf("make test %d: key mismatch: have 0x%x, want 0x%x", i, key, tt.key) + t.Errorf("make test %d: key mismatch: have %#x, want %#x", i, key, tt.key) } id, field := splitKey(tt.key) if !bytes.Equal(id[:], tt.id[:]) { - t.Errorf("split test %d: id mismatch: have 0x%x, want 0x%x", i, id, tt.id) + t.Errorf("split test %d: id mismatch: have %#x, want %#x", i, id, tt.id) } if field != tt.field { - t.Errorf("split test %d: field mismatch: have 0x%x, want 0x%x", i, field, tt.field) + t.Errorf("split test %d: field mismatch: have %#x, want %#x", i, field, tt.field) } } } diff --git a/rlp/rlpgen/gen.go b/rlp/rlpgen/gen.go index ed502c09a7e3..fb9b12e0a18b 100644 --- a/rlp/rlpgen/gen.go +++ b/rlp/rlpgen/gen.go @@ -440,7 +440,7 @@ func (op ptrOp) genWrite(ctx *genContext, v string) string { var b bytes.Buffer fmt.Fprintf(&b, "if %s == nil {\n", v) - fmt.Fprintf(&b, " w.Write([]byte{0x%X})\n", op.nilValue) + fmt.Fprintf(&b, " w.Write([]byte{%#X})\n", op.nilValue) fmt.Fprintf(&b, "} else {\n") fmt.Fprintf(&b, " %s", op.elem.genWrite(ctx, vv)) fmt.Fprintf(&b, "}\n") diff --git a/test.txt b/test.txt new file mode 100644 index 000000000000..f357fafea3ce --- /dev/null +++ b/test.txt @@ -0,0 +1,801 @@ +go run build/ci.go install +>>> /home/me/govm/golang/go-1.21.13/bin/go install -ldflags -X main.gitCommit=5be30c01a972daaea449fc1acb02180546f85557 -v ./... +# gopkg.in/olebedev/go-duktape.v3 +duk_logging.c: In function ‘duk__logger_prototype_log_shared’: +duk_logging.c:184:71: warning: ‘Z’ directive writing 1 byte into a region of size between 0 and 9 [-Wformat-overflow=] + 184 | sprintf((char *) date_buf, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", + | ^ +In file included from /usr/include/stdio.h:894, + from duk_logging.c:5: +/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output between 25 and 85 bytes into a destination of size 32 + 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 39 | __glibc_objsize (__s), __fmt, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 40 | __va_arg_pack ()); + | ~~~~~~~~~~~~~~~~~ +github.com/XinFinOrg/XDPoSChain/cmd/abigen +github.com/XinFinOrg/XDPoSChain/cmd/rlpdump +github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/deploy +github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/fee/lending +github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/fee/trading +github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/price +github.com/XinFinOrg/XDPoSChain/cmd/p2psim +github.com/XinFinOrg/XDPoSChain/cmd/XDC +github.com/XinFinOrg/XDPoSChain/cmd/bootnode +github.com/XinFinOrg/XDPoSChain/cmd/ethkey +github.com/XinFinOrg/XDPoSChain/cmd/evm +github.com/XinFinOrg/XDPoSChain/cmd/faucet +github.com/XinFinOrg/XDPoSChain/cmd/gc +github.com/XinFinOrg/XDPoSChain/cmd/puppeth +github.com/XinFinOrg/XDPoSChain/cmd/wnode +github.com/XinFinOrg/XDPoSChain/contracts/XDCx/testnet/deploy +github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation/deploy +github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation/test +github.com/XinFinOrg/XDPoSChain/p2p/simulations/examples +github.com/XinFinOrg/XDPoSChain/rlp/rlpgen +go run build/ci.go test +>>> /home/me/govm/golang/go-1.21.13/bin/go test -ldflags -X main.gitCommit=5be30c01a972daaea449fc1acb02180546f85557 -p 1 github.com/XinFinOrg/XDPoSChain github.com/XinFinOrg/XDPoSChain/XDCx github.com/XinFinOrg/XDPoSChain/XDCx/tradingstate github.com/XinFinOrg/XDPoSChain/XDCxDAO github.com/XinFinOrg/XDPoSChain/XDCxlending github.com/XinFinOrg/XDPoSChain/XDCxlending/lendingstate github.com/XinFinOrg/XDPoSChain/accounts github.com/XinFinOrg/XDPoSChain/accounts/abi github.com/XinFinOrg/XDPoSChain/accounts/abi/bind github.com/XinFinOrg/XDPoSChain/accounts/abi/bind/backends github.com/XinFinOrg/XDPoSChain/accounts/keystore github.com/XinFinOrg/XDPoSChain/accounts/usbwallet github.com/XinFinOrg/XDPoSChain/accounts/usbwallet/internal/trezor github.com/XinFinOrg/XDPoSChain/bmt github.com/XinFinOrg/XDPoSChain/cmd/XDC github.com/XinFinOrg/XDPoSChain/cmd/abigen github.com/XinFinOrg/XDPoSChain/cmd/bootnode github.com/XinFinOrg/XDPoSChain/cmd/ethkey github.com/XinFinOrg/XDPoSChain/cmd/evm github.com/XinFinOrg/XDPoSChain/cmd/evm/internal/compiler github.com/XinFinOrg/XDPoSChain/cmd/faucet github.com/XinFinOrg/XDPoSChain/cmd/gc github.com/XinFinOrg/XDPoSChain/cmd/internal/browser github.com/XinFinOrg/XDPoSChain/cmd/p2psim github.com/XinFinOrg/XDPoSChain/cmd/puppeth github.com/XinFinOrg/XDPoSChain/cmd/rlpdump github.com/XinFinOrg/XDPoSChain/cmd/utils github.com/XinFinOrg/XDPoSChain/cmd/wnode github.com/XinFinOrg/XDPoSChain/common github.com/XinFinOrg/XDPoSChain/common/bitutil github.com/XinFinOrg/XDPoSChain/common/compiler github.com/XinFinOrg/XDPoSChain/common/countdown github.com/XinFinOrg/XDPoSChain/common/fdlimit github.com/XinFinOrg/XDPoSChain/common/hexutil github.com/XinFinOrg/XDPoSChain/common/lru github.com/XinFinOrg/XDPoSChain/common/math github.com/XinFinOrg/XDPoSChain/common/mclock github.com/XinFinOrg/XDPoSChain/common/number github.com/XinFinOrg/XDPoSChain/common/prque github.com/XinFinOrg/XDPoSChain/common/sort github.com/XinFinOrg/XDPoSChain/compression/rle github.com/XinFinOrg/XDPoSChain/consensus github.com/XinFinOrg/XDPoSChain/consensus/XDPoS github.com/XinFinOrg/XDPoSChain/consensus/XDPoS/engines/engine_v1 github.com/XinFinOrg/XDPoSChain/consensus/XDPoS/engines/engine_v2 github.com/XinFinOrg/XDPoSChain/consensus/XDPoS/utils github.com/XinFinOrg/XDPoSChain/consensus/clique github.com/XinFinOrg/XDPoSChain/consensus/ethash github.com/XinFinOrg/XDPoSChain/consensus/misc github.com/XinFinOrg/XDPoSChain/consensus/tests github.com/XinFinOrg/XDPoSChain/consensus/tests/engine_v1_tests github.com/XinFinOrg/XDPoSChain/consensus/tests/engine_v2_tests github.com/XinFinOrg/XDPoSChain/console github.com/XinFinOrg/XDPoSChain/contracts github.com/XinFinOrg/XDPoSChain/contracts/XDCx github.com/XinFinOrg/XDPoSChain/contracts/XDCx/contract github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/deploy github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/fee/lending github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/fee/trading github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/price github.com/XinFinOrg/XDPoSChain/contracts/XDCx/testnet github.com/XinFinOrg/XDPoSChain/contracts/XDCx/testnet/deploy github.com/XinFinOrg/XDPoSChain/contracts/blocksigner github.com/XinFinOrg/XDPoSChain/contracts/blocksigner/contract github.com/XinFinOrg/XDPoSChain/contracts/ens github.com/XinFinOrg/XDPoSChain/contracts/ens/contract github.com/XinFinOrg/XDPoSChain/contracts/multisigwallet github.com/XinFinOrg/XDPoSChain/contracts/multisigwallet/contract github.com/XinFinOrg/XDPoSChain/contracts/randomize github.com/XinFinOrg/XDPoSChain/contracts/randomize/contract github.com/XinFinOrg/XDPoSChain/contracts/tests github.com/XinFinOrg/XDPoSChain/contracts/tests/contract github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/contract github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation/deploy github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation/test github.com/XinFinOrg/XDPoSChain/contracts/validator github.com/XinFinOrg/XDPoSChain/contracts/validator/contract github.com/XinFinOrg/XDPoSChain/core github.com/XinFinOrg/XDPoSChain/core/asm github.com/XinFinOrg/XDPoSChain/core/bloombits github.com/XinFinOrg/XDPoSChain/core/rawdb github.com/XinFinOrg/XDPoSChain/core/state github.com/XinFinOrg/XDPoSChain/core/types github.com/XinFinOrg/XDPoSChain/core/vm github.com/XinFinOrg/XDPoSChain/core/vm/privacy github.com/XinFinOrg/XDPoSChain/core/vm/runtime github.com/XinFinOrg/XDPoSChain/crypto github.com/XinFinOrg/XDPoSChain/crypto/blake2b github.com/XinFinOrg/XDPoSChain/crypto/bn256 github.com/XinFinOrg/XDPoSChain/crypto/bn256/cloudflare github.com/XinFinOrg/XDPoSChain/crypto/bn256/google github.com/XinFinOrg/XDPoSChain/crypto/ecies github.com/XinFinOrg/XDPoSChain/crypto/randentropy github.com/XinFinOrg/XDPoSChain/crypto/secp256k1 github.com/XinFinOrg/XDPoSChain/crypto/sha3 github.com/XinFinOrg/XDPoSChain/eth github.com/XinFinOrg/XDPoSChain/eth/bft github.com/XinFinOrg/XDPoSChain/eth/downloader github.com/XinFinOrg/XDPoSChain/eth/ethconfig github.com/XinFinOrg/XDPoSChain/eth/fetcher github.com/XinFinOrg/XDPoSChain/eth/filters github.com/XinFinOrg/XDPoSChain/eth/gasprice github.com/XinFinOrg/XDPoSChain/eth/hooks github.com/XinFinOrg/XDPoSChain/eth/tracers github.com/XinFinOrg/XDPoSChain/eth/tracers/internal/tracers github.com/XinFinOrg/XDPoSChain/eth/tracers/native github.com/XinFinOrg/XDPoSChain/eth/tracers/testing github.com/XinFinOrg/XDPoSChain/eth/util github.com/XinFinOrg/XDPoSChain/ethclient github.com/XinFinOrg/XDPoSChain/ethdb github.com/XinFinOrg/XDPoSChain/ethdb/dbtest github.com/XinFinOrg/XDPoSChain/ethdb/leveldb github.com/XinFinOrg/XDPoSChain/ethdb/memorydb github.com/XinFinOrg/XDPoSChain/ethstats github.com/XinFinOrg/XDPoSChain/event github.com/XinFinOrg/XDPoSChain/event/filter github.com/XinFinOrg/XDPoSChain/internal/build github.com/XinFinOrg/XDPoSChain/internal/cmdtest github.com/XinFinOrg/XDPoSChain/internal/debug github.com/XinFinOrg/XDPoSChain/internal/ethapi github.com/XinFinOrg/XDPoSChain/internal/guide github.com/XinFinOrg/XDPoSChain/internal/jsre github.com/XinFinOrg/XDPoSChain/internal/jsre/deps github.com/XinFinOrg/XDPoSChain/internal/web3ext github.com/XinFinOrg/XDPoSChain/les github.com/XinFinOrg/XDPoSChain/les/flowcontrol github.com/XinFinOrg/XDPoSChain/light github.com/XinFinOrg/XDPoSChain/log github.com/XinFinOrg/XDPoSChain/log/term github.com/XinFinOrg/XDPoSChain/metrics github.com/XinFinOrg/XDPoSChain/metrics/exp github.com/XinFinOrg/XDPoSChain/metrics/influxdb github.com/XinFinOrg/XDPoSChain/metrics/librato github.com/XinFinOrg/XDPoSChain/miner github.com/XinFinOrg/XDPoSChain/mobile github.com/XinFinOrg/XDPoSChain/node github.com/XinFinOrg/XDPoSChain/p2p github.com/XinFinOrg/XDPoSChain/p2p/discover github.com/XinFinOrg/XDPoSChain/p2p/discv5 github.com/XinFinOrg/XDPoSChain/p2p/enr github.com/XinFinOrg/XDPoSChain/p2p/nat github.com/XinFinOrg/XDPoSChain/p2p/netutil github.com/XinFinOrg/XDPoSChain/p2p/protocols github.com/XinFinOrg/XDPoSChain/p2p/simulations github.com/XinFinOrg/XDPoSChain/p2p/simulations/adapters github.com/XinFinOrg/XDPoSChain/p2p/simulations/examples github.com/XinFinOrg/XDPoSChain/p2p/testing github.com/XinFinOrg/XDPoSChain/params github.com/XinFinOrg/XDPoSChain/rlp github.com/XinFinOrg/XDPoSChain/rlp/internal/rlpstruct github.com/XinFinOrg/XDPoSChain/rlp/rlpgen github.com/XinFinOrg/XDPoSChain/rpc github.com/XinFinOrg/XDPoSChain/tests github.com/XinFinOrg/XDPoSChain/tests/fuzzers/bitutil github.com/XinFinOrg/XDPoSChain/tests/fuzzers/bn256 github.com/XinFinOrg/XDPoSChain/tests/fuzzers/runtime github.com/XinFinOrg/XDPoSChain/trie github.com/XinFinOrg/XDPoSChain/whisper/mailserver github.com/XinFinOrg/XDPoSChain/whisper/shhclient github.com/XinFinOrg/XDPoSChain/whisper/whisperv5 github.com/XinFinOrg/XDPoSChain/whisper/whisperv6 +? github.com/XinFinOrg/XDPoSChain [no test files] +ok github.com/XinFinOrg/XDPoSChain/XDCx (cached) +ok github.com/XinFinOrg/XDPoSChain/XDCx/tradingstate (cached) +? github.com/XinFinOrg/XDPoSChain/XDCxDAO [no test files] +ok github.com/XinFinOrg/XDPoSChain/XDCxlending (cached) +ok github.com/XinFinOrg/XDPoSChain/XDCxlending/lendingstate (cached) +ok github.com/XinFinOrg/XDPoSChain/accounts (cached) +ok github.com/XinFinOrg/XDPoSChain/accounts/abi (cached) +ok github.com/XinFinOrg/XDPoSChain/accounts/abi/bind 2.409s +? github.com/XinFinOrg/XDPoSChain/accounts/abi/bind/backends [no test files] +ok github.com/XinFinOrg/XDPoSChain/accounts/keystore 15.031s +? github.com/XinFinOrg/XDPoSChain/accounts/usbwallet [no test files] +? github.com/XinFinOrg/XDPoSChain/accounts/usbwallet/internal/trezor [no test files] +ok github.com/XinFinOrg/XDPoSChain/bmt (cached) +# gopkg.in/olebedev/go-duktape.v3 +duk_logging.c: In function ‘duk__logger_prototype_log_shared’: +duk_logging.c:184:71: warning: ‘Z’ directive writing 1 byte into a region of size between 0 and 9 [-Wformat-overflow=] + 184 | sprintf((char *) date_buf, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", + | ^ +In file included from /usr/include/stdio.h:894, + from duk_logging.c:5: +/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output between 25 and 85 bytes into a destination of size 32 + 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 39 | __glibc_objsize (__s), __fmt, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 40 | __va_arg_pack ()); + | ~~~~~~~~~~~~~~~~~ +ok github.com/XinFinOrg/XDPoSChain/cmd/XDC (cached) +? github.com/XinFinOrg/XDPoSChain/cmd/abigen [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/bootnode [no test files] +ok github.com/XinFinOrg/XDPoSChain/cmd/ethkey (cached) +? github.com/XinFinOrg/XDPoSChain/cmd/evm [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/evm/internal/compiler [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/faucet [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/gc [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/internal/browser [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/p2psim [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/puppeth [no test files] +? github.com/XinFinOrg/XDPoSChain/cmd/rlpdump [no test files] +ok github.com/XinFinOrg/XDPoSChain/cmd/utils (cached) +? github.com/XinFinOrg/XDPoSChain/cmd/wnode [no test files] +ok github.com/XinFinOrg/XDPoSChain/common (cached) +ok github.com/XinFinOrg/XDPoSChain/common/bitutil (cached) +ok github.com/XinFinOrg/XDPoSChain/common/compiler (cached) +ok github.com/XinFinOrg/XDPoSChain/common/countdown (cached) +ok github.com/XinFinOrg/XDPoSChain/common/fdlimit (cached) +ok github.com/XinFinOrg/XDPoSChain/common/hexutil (cached) +ok github.com/XinFinOrg/XDPoSChain/common/lru (cached) +ok github.com/XinFinOrg/XDPoSChain/common/math (cached) +ok github.com/XinFinOrg/XDPoSChain/common/mclock (cached) +ok github.com/XinFinOrg/XDPoSChain/common/number (cached) +ok github.com/XinFinOrg/XDPoSChain/common/prque (cached) +? github.com/XinFinOrg/XDPoSChain/common/sort [no test files] +ok github.com/XinFinOrg/XDPoSChain/compression/rle (cached) +? github.com/XinFinOrg/XDPoSChain/consensus [no test files] +ok github.com/XinFinOrg/XDPoSChain/consensus/XDPoS (cached) +ok github.com/XinFinOrg/XDPoSChain/consensus/XDPoS/engines/engine_v1 (cached) +ok github.com/XinFinOrg/XDPoSChain/consensus/XDPoS/engines/engine_v2 (cached) +ok github.com/XinFinOrg/XDPoSChain/consensus/XDPoS/utils (cached) +? github.com/XinFinOrg/XDPoSChain/consensus/clique [no test files] +ok github.com/XinFinOrg/XDPoSChain/consensus/ethash (cached) +? github.com/XinFinOrg/XDPoSChain/consensus/misc [no test files] +ok github.com/XinFinOrg/XDPoSChain/consensus/tests (cached) +ok github.com/XinFinOrg/XDPoSChain/consensus/tests/engine_v1_tests (cached) +ok github.com/XinFinOrg/XDPoSChain/consensus/tests/engine_v2_tests (cached) +ok github.com/XinFinOrg/XDPoSChain/console (cached) +ok github.com/XinFinOrg/XDPoSChain/contracts (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/contract [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/deploy [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/fee/lending [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/fee/trading [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/simulation/price [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/testnet [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/XDCx/testnet/deploy [no test files] +ok github.com/XinFinOrg/XDPoSChain/contracts/blocksigner (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/blocksigner/contract [no test files] +ok github.com/XinFinOrg/XDPoSChain/contracts/ens (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/ens/contract [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/multisigwallet [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/multisigwallet/contract [no test files] +ok github.com/XinFinOrg/XDPoSChain/contracts/randomize (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/randomize/contract [no test files] +ok github.com/XinFinOrg/XDPoSChain/contracts/tests (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/tests/contract [no test files] +ok github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/contract [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation/deploy [no test files] +? github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation/test [no test files] +ok github.com/XinFinOrg/XDPoSChain/contracts/validator (cached) +? github.com/XinFinOrg/XDPoSChain/contracts/validator/contract [no test files] +ok github.com/XinFinOrg/XDPoSChain/core (cached) +ok github.com/XinFinOrg/XDPoSChain/core/asm (cached) +ok github.com/XinFinOrg/XDPoSChain/core/bloombits (cached) +ok github.com/XinFinOrg/XDPoSChain/core/rawdb (cached) +ok github.com/XinFinOrg/XDPoSChain/core/state (cached) +ok github.com/XinFinOrg/XDPoSChain/core/types (cached) +ok github.com/XinFinOrg/XDPoSChain/core/vm (cached) +ok github.com/XinFinOrg/XDPoSChain/core/vm/privacy (cached) +ok github.com/XinFinOrg/XDPoSChain/core/vm/runtime (cached) +ok github.com/XinFinOrg/XDPoSChain/crypto (cached) +ok github.com/XinFinOrg/XDPoSChain/crypto/blake2b (cached) +? github.com/XinFinOrg/XDPoSChain/crypto/bn256 [no test files] +ok github.com/XinFinOrg/XDPoSChain/crypto/bn256/cloudflare (cached) +ok github.com/XinFinOrg/XDPoSChain/crypto/bn256/google (cached) +ok github.com/XinFinOrg/XDPoSChain/crypto/ecies (cached) +? github.com/XinFinOrg/XDPoSChain/crypto/randentropy [no test files] +ok github.com/XinFinOrg/XDPoSChain/crypto/secp256k1 (cached) +ok github.com/XinFinOrg/XDPoSChain/crypto/sha3 (cached) +ok github.com/XinFinOrg/XDPoSChain/eth (cached) +ok github.com/XinFinOrg/XDPoSChain/eth/bft (cached) +ok github.com/XinFinOrg/XDPoSChain/eth/downloader (cached) +? github.com/XinFinOrg/XDPoSChain/eth/ethconfig [no test files] +ok github.com/XinFinOrg/XDPoSChain/eth/fetcher (cached) +ok github.com/XinFinOrg/XDPoSChain/eth/filters (cached) +? github.com/XinFinOrg/XDPoSChain/eth/gasprice [no test files] +? github.com/XinFinOrg/XDPoSChain/eth/hooks [no test files] +ok github.com/XinFinOrg/XDPoSChain/eth/tracers (cached) +? github.com/XinFinOrg/XDPoSChain/eth/tracers/internal/tracers [no test files] +? github.com/XinFinOrg/XDPoSChain/eth/tracers/native [no test files] +ok github.com/XinFinOrg/XDPoSChain/eth/tracers/testing (cached) +? github.com/XinFinOrg/XDPoSChain/eth/util [no test files] +ok github.com/XinFinOrg/XDPoSChain/ethclient (cached) [no tests to run] +? github.com/XinFinOrg/XDPoSChain/ethdb [no test files] +? github.com/XinFinOrg/XDPoSChain/ethdb/dbtest [no test files] +ok github.com/XinFinOrg/XDPoSChain/ethdb/leveldb (cached) +ok github.com/XinFinOrg/XDPoSChain/ethdb/memorydb (cached) +? github.com/XinFinOrg/XDPoSChain/ethstats [no test files] +ok github.com/XinFinOrg/XDPoSChain/event (cached) +ok github.com/XinFinOrg/XDPoSChain/event/filter (cached) +? github.com/XinFinOrg/XDPoSChain/internal/build [no test files] +? github.com/XinFinOrg/XDPoSChain/internal/cmdtest [no test files] +? github.com/XinFinOrg/XDPoSChain/internal/debug [no test files] +ok github.com/XinFinOrg/XDPoSChain/internal/ethapi (cached) +ok github.com/XinFinOrg/XDPoSChain/internal/guide (cached) +ok github.com/XinFinOrg/XDPoSChain/internal/jsre (cached) +? github.com/XinFinOrg/XDPoSChain/internal/jsre/deps [no test files] +? github.com/XinFinOrg/XDPoSChain/internal/web3ext [no test files] +ok github.com/XinFinOrg/XDPoSChain/les (cached) +? github.com/XinFinOrg/XDPoSChain/les/flowcontrol [no test files] +ok github.com/XinFinOrg/XDPoSChain/light (cached) +? github.com/XinFinOrg/XDPoSChain/log [no test files] +? github.com/XinFinOrg/XDPoSChain/log/term [no test files] +ok github.com/XinFinOrg/XDPoSChain/metrics (cached) +? github.com/XinFinOrg/XDPoSChain/metrics/exp [no test files] +? github.com/XinFinOrg/XDPoSChain/metrics/influxdb [no test files] +? github.com/XinFinOrg/XDPoSChain/metrics/librato [no test files] +ok github.com/XinFinOrg/XDPoSChain/miner (cached) +ok github.com/XinFinOrg/XDPoSChain/mobile (cached) +ok github.com/XinFinOrg/XDPoSChain/node (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/discover (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/discv5 (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/enr (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/nat (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/netutil (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/protocols (cached) +ok github.com/XinFinOrg/XDPoSChain/p2p/simulations (cached) +? github.com/XinFinOrg/XDPoSChain/p2p/simulations/adapters [no test files] +? github.com/XinFinOrg/XDPoSChain/p2p/simulations/examples [no test files] +? github.com/XinFinOrg/XDPoSChain/p2p/testing [no test files] +ok github.com/XinFinOrg/XDPoSChain/params (cached) +ok github.com/XinFinOrg/XDPoSChain/rlp (cached) +? github.com/XinFinOrg/XDPoSChain/rlp/internal/rlpstruct [no test files] +--- FAIL: TestOutput (0.05s) + --- FAIL: TestOutput/nil (0.00s) + gen_test.go:78: output mismatch, want: package test + + import "github.com/XinFinOrg/XDPoSChain/rlp" + import "io" + + func (obj *Test) EncodeRLP(_w io.Writer) error { + w := rlp.NewEncoderBuffer(_w) + _tmp0 := w.List() + if obj.Uint8 == nil { + w.Write([]byte{0x80}) + } else { + w.WriteUint64(uint64((*obj.Uint8))) + } + if obj.Uint8List == nil { + w.Write([]byte{0xC0}) + } else { + w.WriteUint64(uint64((*obj.Uint8List))) + } + if obj.Uint32 == nil { + w.Write([]byte{0x80}) + } else { + w.WriteUint64(uint64((*obj.Uint32))) + } + if obj.Uint32List == nil { + w.Write([]byte{0xC0}) + } else { + w.WriteUint64(uint64((*obj.Uint32List))) + } + if obj.Uint64 == nil { + w.Write([]byte{0x80}) + } else { + w.WriteUint64((*obj.Uint64)) + } + if obj.Uint64List == nil { + w.Write([]byte{0xC0}) + } else { + w.WriteUint64((*obj.Uint64List)) + } + if obj.String == nil { + w.Write([]byte{0x80}) + } else { + w.WriteString((*obj.String)) + } + if obj.StringList == nil { + w.Write([]byte{0xC0}) + } else { + w.WriteString((*obj.StringList)) + } + if obj.ByteArray == nil { + w.Write([]byte{0x80}) + } else { + w.WriteBytes(obj.ByteArray[:]) + } + if obj.ByteArrayList == nil { + w.Write([]byte{0xC0}) + } else { + w.WriteBytes(obj.ByteArrayList[:]) + } + if obj.ByteSlice == nil { + w.Write([]byte{0x80}) + } else { + w.WriteBytes((*obj.ByteSlice)) + } + if obj.ByteSliceList == nil { + w.Write([]byte{0xC0}) + } else { + w.WriteBytes((*obj.ByteSliceList)) + } + if obj.Struct == nil { + w.Write([]byte{0xC0}) + } else { + _tmp1 := w.List() + w.WriteUint64(uint64(obj.Struct.A)) + w.ListEnd(_tmp1) + } + if obj.StructString == nil { + w.Write([]byte{0x80}) + } else { + _tmp2 := w.List() + w.WriteUint64(uint64(obj.StructString.A)) + w.ListEnd(_tmp2) + } + w.ListEnd(_tmp0) + return w.Flush() + } + + func (obj *Test) DecodeRLP(dec *rlp.Stream) error { + var _tmp0 Test + { + if _, err := dec.List(); err != nil { + return err + } + // Uint8: + var _tmp2 *byte + if _tmp3, _tmp4, err := dec.Kind(); err != nil { + return err + } else if _tmp4 != 0 || _tmp3 != rlp.String { + _tmp1, err := dec.Uint8() + if err != nil { + return err + } + _tmp2 = &_tmp1 + } + _tmp0.Uint8 = _tmp2 + // Uint8List: + var _tmp6 *byte + if _tmp7, _tmp8, err := dec.Kind(); err != nil { + return err + } else if _tmp8 != 0 || _tmp7 != rlp.List { + _tmp5, err := dec.Uint8() + if err != nil { + return err + } + _tmp6 = &_tmp5 + } + _tmp0.Uint8List = _tmp6 + // Uint32: + var _tmp10 *uint32 + if _tmp11, _tmp12, err := dec.Kind(); err != nil { + return err + } else if _tmp12 != 0 || _tmp11 != rlp.String { + _tmp9, err := dec.Uint32() + if err != nil { + return err + } + _tmp10 = &_tmp9 + } + _tmp0.Uint32 = _tmp10 + // Uint32List: + var _tmp14 *uint32 + if _tmp15, _tmp16, err := dec.Kind(); err != nil { + return err + } else if _tmp16 != 0 || _tmp15 != rlp.List { + _tmp13, err := dec.Uint32() + if err != nil { + return err + } + _tmp14 = &_tmp13 + } + _tmp0.Uint32List = _tmp14 + // Uint64: + var _tmp18 *uint64 + if _tmp19, _tmp20, err := dec.Kind(); err != nil { + return err + } else if _tmp20 != 0 || _tmp19 != rlp.String { + _tmp17, err := dec.Uint64() + if err != nil { + return err + } + _tmp18 = &_tmp17 + } + _tmp0.Uint64 = _tmp18 + // Uint64List: + var _tmp22 *uint64 + if _tmp23, _tmp24, err := dec.Kind(); err != nil { + return err + } else if _tmp24 != 0 || _tmp23 != rlp.List { + _tmp21, err := dec.Uint64() + if err != nil { + return err + } + _tmp22 = &_tmp21 + } + _tmp0.Uint64List = _tmp22 + // String: + var _tmp26 *string + if _tmp27, _tmp28, err := dec.Kind(); err != nil { + return err + } else if _tmp28 != 0 || _tmp27 != rlp.String { + _tmp25, err := dec.String() + if err != nil { + return err + } + _tmp26 = &_tmp25 + } + _tmp0.String = _tmp26 + // StringList: + var _tmp30 *string + if _tmp31, _tmp32, err := dec.Kind(); err != nil { + return err + } else if _tmp32 != 0 || _tmp31 != rlp.List { + _tmp29, err := dec.String() + if err != nil { + return err + } + _tmp30 = &_tmp29 + } + _tmp0.StringList = _tmp30 + // ByteArray: + var _tmp34 *[3]byte + if _tmp35, _tmp36, err := dec.Kind(); err != nil { + return err + } else if _tmp36 != 0 || _tmp35 != rlp.String { + var _tmp33 [3]byte + if err := dec.ReadBytes(_tmp33[:]); err != nil { + return err + } + _tmp34 = &_tmp33 + } + _tmp0.ByteArray = _tmp34 + // ByteArrayList: + var _tmp38 *[3]byte + if _tmp39, _tmp40, err := dec.Kind(); err != nil { + return err + } else if _tmp40 != 0 || _tmp39 != rlp.List { + var _tmp37 [3]byte + if err := dec.ReadBytes(_tmp37[:]); err != nil { + return err + } + _tmp38 = &_tmp37 + } + _tmp0.ByteArrayList = _tmp38 + // ByteSlice: + var _tmp42 *[]byte + if _tmp43, _tmp44, err := dec.Kind(); err != nil { + return err + } else if _tmp44 != 0 || _tmp43 != rlp.String { + _tmp41, err := dec.Bytes() + if err != nil { + return err + } + _tmp42 = &_tmp41 + } + _tmp0.ByteSlice = _tmp42 + // ByteSliceList: + var _tmp46 *[]byte + if _tmp47, _tmp48, err := dec.Kind(); err != nil { + return err + } else if _tmp48 != 0 || _tmp47 != rlp.List { + _tmp45, err := dec.Bytes() + if err != nil { + return err + } + _tmp46 = &_tmp45 + } + _tmp0.ByteSliceList = _tmp46 + // Struct: + var _tmp51 *Aux + if _tmp52, _tmp53, err := dec.Kind(); err != nil { + return err + } else if _tmp53 != 0 || _tmp52 != rlp.List { + var _tmp49 Aux + { + if _, err := dec.List(); err != nil { + return err + } + // A: + _tmp50, err := dec.Uint32() + if err != nil { + return err + } + _tmp49.A = _tmp50 + if err := dec.ListEnd(); err != nil { + return err + } + } + _tmp51 = &_tmp49 + } + _tmp0.Struct = _tmp51 + // StructString: + var _tmp56 *Aux + if _tmp57, _tmp58, err := dec.Kind(); err != nil { + return err + } else if _tmp58 != 0 || _tmp57 != rlp.String { + var _tmp54 Aux + { + if _, err := dec.List(); err != nil { + return err + } + // A: + _tmp55, err := dec.Uint32() + if err != nil { + return err + } + _tmp54.A = _tmp55 + if err := dec.ListEnd(); err != nil { + return err + } + } + _tmp56 = &_tmp54 + } + _tmp0.StructString = _tmp56 + if err := dec.ListEnd(); err != nil { + return err + } + } + *obj = _tmp0 + return nil + } + got package test + + import "github.com/XinFinOrg/XDPoSChain/rlp" + import "io" + + func (obj *Test) EncodeRLP(_w io.Writer) error { + w := rlp.NewEncoderBuffer(_w) + _tmp0 := w.List() + if obj.Uint8 == nil { + w.Write([]byte{0x80}) + } else { + w.WriteUint64(uint64((*obj.Uint8))) + } + if obj.Uint8List == nil { + w.Write([]byte{0xc0}) + } else { + w.WriteUint64(uint64((*obj.Uint8List))) + } + if obj.Uint32 == nil { + w.Write([]byte{0x80}) + } else { + w.WriteUint64(uint64((*obj.Uint32))) + } + if obj.Uint32List == nil { + w.Write([]byte{0xc0}) + } else { + w.WriteUint64(uint64((*obj.Uint32List))) + } + if obj.Uint64 == nil { + w.Write([]byte{0x80}) + } else { + w.WriteUint64((*obj.Uint64)) + } + if obj.Uint64List == nil { + w.Write([]byte{0xc0}) + } else { + w.WriteUint64((*obj.Uint64List)) + } + if obj.String == nil { + w.Write([]byte{0x80}) + } else { + w.WriteString((*obj.String)) + } + if obj.StringList == nil { + w.Write([]byte{0xc0}) + } else { + w.WriteString((*obj.StringList)) + } + if obj.ByteArray == nil { + w.Write([]byte{0x80}) + } else { + w.WriteBytes(obj.ByteArray[:]) + } + if obj.ByteArrayList == nil { + w.Write([]byte{0xc0}) + } else { + w.WriteBytes(obj.ByteArrayList[:]) + } + if obj.ByteSlice == nil { + w.Write([]byte{0x80}) + } else { + w.WriteBytes((*obj.ByteSlice)) + } + if obj.ByteSliceList == nil { + w.Write([]byte{0xc0}) + } else { + w.WriteBytes((*obj.ByteSliceList)) + } + if obj.Struct == nil { + w.Write([]byte{0xc0}) + } else { + _tmp1 := w.List() + w.WriteUint64(uint64(obj.Struct.A)) + w.ListEnd(_tmp1) + } + if obj.StructString == nil { + w.Write([]byte{0x80}) + } else { + _tmp2 := w.List() + w.WriteUint64(uint64(obj.StructString.A)) + w.ListEnd(_tmp2) + } + w.ListEnd(_tmp0) + return w.Flush() + } + + func (obj *Test) DecodeRLP(dec *rlp.Stream) error { + var _tmp0 Test + { + if _, err := dec.List(); err != nil { + return err + } + // Uint8: + var _tmp2 *byte + if _tmp3, _tmp4, err := dec.Kind(); err != nil { + return err + } else if _tmp4 != 0 || _tmp3 != rlp.String { + _tmp1, err := dec.Uint8() + if err != nil { + return err + } + _tmp2 = &_tmp1 + } + _tmp0.Uint8 = _tmp2 + // Uint8List: + var _tmp6 *byte + if _tmp7, _tmp8, err := dec.Kind(); err != nil { + return err + } else if _tmp8 != 0 || _tmp7 != rlp.List { + _tmp5, err := dec.Uint8() + if err != nil { + return err + } + _tmp6 = &_tmp5 + } + _tmp0.Uint8List = _tmp6 + // Uint32: + var _tmp10 *uint32 + if _tmp11, _tmp12, err := dec.Kind(); err != nil { + return err + } else if _tmp12 != 0 || _tmp11 != rlp.String { + _tmp9, err := dec.Uint32() + if err != nil { + return err + } + _tmp10 = &_tmp9 + } + _tmp0.Uint32 = _tmp10 + // Uint32List: + var _tmp14 *uint32 + if _tmp15, _tmp16, err := dec.Kind(); err != nil { + return err + } else if _tmp16 != 0 || _tmp15 != rlp.List { + _tmp13, err := dec.Uint32() + if err != nil { + return err + } + _tmp14 = &_tmp13 + } + _tmp0.Uint32List = _tmp14 + // Uint64: + var _tmp18 *uint64 + if _tmp19, _tmp20, err := dec.Kind(); err != nil { + return err + } else if _tmp20 != 0 || _tmp19 != rlp.String { + _tmp17, err := dec.Uint64() + if err != nil { + return err + } + _tmp18 = &_tmp17 + } + _tmp0.Uint64 = _tmp18 + // Uint64List: + var _tmp22 *uint64 + if _tmp23, _tmp24, err := dec.Kind(); err != nil { + return err + } else if _tmp24 != 0 || _tmp23 != rlp.List { + _tmp21, err := dec.Uint64() + if err != nil { + return err + } + _tmp22 = &_tmp21 + } + _tmp0.Uint64List = _tmp22 + // String: + var _tmp26 *string + if _tmp27, _tmp28, err := dec.Kind(); err != nil { + return err + } else if _tmp28 != 0 || _tmp27 != rlp.String { + _tmp25, err := dec.String() + if err != nil { + return err + } + _tmp26 = &_tmp25 + } + _tmp0.String = _tmp26 + // StringList: + var _tmp30 *string + if _tmp31, _tmp32, err := dec.Kind(); err != nil { + return err + } else if _tmp32 != 0 || _tmp31 != rlp.List { + _tmp29, err := dec.String() + if err != nil { + return err + } + _tmp30 = &_tmp29 + } + _tmp0.StringList = _tmp30 + // ByteArray: + var _tmp34 *[3]byte + if _tmp35, _tmp36, err := dec.Kind(); err != nil { + return err + } else if _tmp36 != 0 || _tmp35 != rlp.String { + var _tmp33 [3]byte + if err := dec.ReadBytes(_tmp33[:]); err != nil { + return err + } + _tmp34 = &_tmp33 + } + _tmp0.ByteArray = _tmp34 + // ByteArrayList: + var _tmp38 *[3]byte + if _tmp39, _tmp40, err := dec.Kind(); err != nil { + return err + } else if _tmp40 != 0 || _tmp39 != rlp.List { + var _tmp37 [3]byte + if err := dec.ReadBytes(_tmp37[:]); err != nil { + return err + } + _tmp38 = &_tmp37 + } + _tmp0.ByteArrayList = _tmp38 + // ByteSlice: + var _tmp42 *[]byte + if _tmp43, _tmp44, err := dec.Kind(); err != nil { + return err + } else if _tmp44 != 0 || _tmp43 != rlp.String { + _tmp41, err := dec.Bytes() + if err != nil { + return err + } + _tmp42 = &_tmp41 + } + _tmp0.ByteSlice = _tmp42 + // ByteSliceList: + var _tmp46 *[]byte + if _tmp47, _tmp48, err := dec.Kind(); err != nil { + return err + } else if _tmp48 != 0 || _tmp47 != rlp.List { + _tmp45, err := dec.Bytes() + if err != nil { + return err + } + _tmp46 = &_tmp45 + } + _tmp0.ByteSliceList = _tmp46 + // Struct: + var _tmp51 *Aux + if _tmp52, _tmp53, err := dec.Kind(); err != nil { + return err + } else if _tmp53 != 0 || _tmp52 != rlp.List { + var _tmp49 Aux + { + if _, err := dec.List(); err != nil { + return err + } + // A: + _tmp50, err := dec.Uint32() + if err != nil { + return err + } + _tmp49.A = _tmp50 + if err := dec.ListEnd(); err != nil { + return err + } + } + _tmp51 = &_tmp49 + } + _tmp0.Struct = _tmp51 + // StructString: + var _tmp56 *Aux + if _tmp57, _tmp58, err := dec.Kind(); err != nil { + return err + } else if _tmp58 != 0 || _tmp57 != rlp.String { + var _tmp54 Aux + { + if _, err := dec.List(); err != nil { + return err + } + // A: + _tmp55, err := dec.Uint32() + if err != nil { + return err + } + _tmp54.A = _tmp55 + if err := dec.ListEnd(); err != nil { + return err + } + } + _tmp56 = &_tmp54 + } + _tmp0.StructString = _tmp56 + if err := dec.ListEnd(); err != nil { + return err + } + } + *obj = _tmp0 + return nil + } +FAIL +FAIL github.com/XinFinOrg/XDPoSChain/rlp/rlpgen 0.537s +ok github.com/XinFinOrg/XDPoSChain/rpc (cached) +ok github.com/XinFinOrg/XDPoSChain/tests (cached) +? github.com/XinFinOrg/XDPoSChain/tests/fuzzers/bitutil [no test files] +? github.com/XinFinOrg/XDPoSChain/tests/fuzzers/bn256 [no test files] +? github.com/XinFinOrg/XDPoSChain/tests/fuzzers/runtime [no test files] +ok github.com/XinFinOrg/XDPoSChain/trie (cached) +ok github.com/XinFinOrg/XDPoSChain/whisper/mailserver (cached) +? github.com/XinFinOrg/XDPoSChain/whisper/shhclient [no test files] +ok github.com/XinFinOrg/XDPoSChain/whisper/whisperv5 (cached) +ok github.com/XinFinOrg/XDPoSChain/whisper/whisperv6 (cached) +FAIL +util.go:43: exit status 1 +exit status 1 +make: *** [Makefile:48: test] Error 1 diff --git a/tests/state_test.go b/tests/state_test.go index 79a7dc2a1519..5c91a978c520 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -88,6 +88,6 @@ func withTrace(t *testing.T, gasLimit uint64, test func(vm.Config) error) { } else { t.Log("EVM operation log:\n" + buf.String()) } - t.Logf("EVM output: 0x%x", tracer.Output()) + t.Logf("EVM output: %#x", tracer.Output()) t.Logf("EVM error: %v", tracer.Error()) } diff --git a/trie/trie_test.go b/trie/trie_test.go index 202fc76d809e..9311cbae6400 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -422,7 +422,7 @@ func runRandTest(rt randTest) bool { v := tr.Get(step.key) want := values[string(step.key)] 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: _, rt[i].err = tr.Commit(nil)