From 5ada9b8866af674d85c8aae9ecdc08f2d2e87325 Mon Sep 17 00:00:00 2001 From: wit liu <765765346@qq.com> Date: Sun, 7 Dec 2025 18:09:31 +0800 Subject: [PATCH] core: fix unused warnings (#1811) --- core/txpool/txpool_test.go | 1 - core/types/bloom9.go | 1 - core/types/lending_signing.go | 1 - core/types/receipt_test.go | 3 --- core/vm/privacy/ringct.go | 14 -------------- core/vm/runtime/runtime_test.go | 1 - 6 files changed, 21 deletions(-) diff --git a/core/txpool/txpool_test.go b/core/txpool/txpool_test.go index 3d930ed8f6..8d53a025f7 100644 --- a/core/txpool/txpool_test.go +++ b/core/txpool/txpool_test.go @@ -742,7 +742,6 @@ func TestPostponing(t *testing.T) { // Add a batch consecutive pending transactions for validation txs := []*types.Transaction{} for i, key := range keys { - for j := 0; j < 10; j++ { var tx *types.Transaction if (i+j)%2 == 0 { diff --git a/core/types/bloom9.go b/core/types/bloom9.go index 94b05cd178..4bea48b15a 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -78,7 +78,6 @@ func (b Bloom) Test(test *big.Int) bool { func (b Bloom) TestBytes(test []byte) bool { return b.Test(new(big.Int).SetBytes(test)) - } // MarshalText encodes b as a hex string with 0x prefix. diff --git a/core/types/lending_signing.go b/core/types/lending_signing.go index 72a9eead94..02bbaaaf4d 100644 --- a/core/types/lending_signing.go +++ b/core/types/lending_signing.go @@ -216,7 +216,6 @@ func (lendingsign LendingTxSigner) Sender(tx *LendingTransaction) (common.Addres } address := crypto.PubkeyToAddress(*pubKey) return address, nil - } // CacheLendingSigner cache signed lending transaction diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index 0936e73403..3478e0a208 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -87,8 +87,6 @@ var ( to3 = common.HexToAddress("0x3") to4 = common.HexToAddress("0x4") to5 = common.HexToAddress("0x5") - to6 = common.HexToAddress("0x6") - to7 = common.HexToAddress("0x7") txs = Transactions{ NewTx(&LegacyTx{ Nonce: 1, @@ -130,7 +128,6 @@ var ( } blockNumber = big.NewInt(1) - blockTime = uint64(2) blockHash = common.BytesToHash([]byte{0x03, 0x14}) // Create the corresponding receipts diff --git a/core/vm/privacy/ringct.go b/core/vm/privacy/ringct.go index 9fe22ced2b..bdf73511e8 100644 --- a/core/vm/privacy/ringct.go +++ b/core/vm/privacy/ringct.go @@ -62,19 +62,6 @@ type RingSignature struct { SerializedRing []byte //temporary memory stored the raw ring ct used in case of verifying ringCT with message verification } -func (p *PrivateSendVerifier) verify() bool { - return false -} - -func (p *PrivateSendVerifier) deserialize() { - -} - -// helper function, returns type of v -func typeof(v interface{}) string { - return fmt.Sprintf("%T", v) -} - func isOdd(a *big.Int) bool { return a.Bit(0) == 1 } @@ -195,7 +182,6 @@ func computeSignatureSize(numRing int, ringSize int) int { if term < 0 || term < numRing || term < ringSize { return -1 } - return 8 + 8 + 32 + 32 + numRing*ringSize*32 + numRing*ringSize*33 + numRing*33 } diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index 13e42af7a2..eba1ca2cd1 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -491,7 +491,6 @@ func TestEip2929Cases(t *testing.T) { t.Skip("Test only useful for generating documentation") id := 1 prettyPrint := func(comment string, code []byte) { - instrs := make([]string, 0) it := asm.NewInstructionIterator(code) for it.Next() {