mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 12:16:44 +00:00
Revert unrelated test fixes
This commit is contained in:
parent
6769b383fb
commit
017fe52f7b
2 changed files with 8 additions and 30 deletions
|
|
@ -413,19 +413,11 @@ func testSubscribePendingTransactions(t *testing.T, client *rpc.Client) {
|
|||
|
||||
// Subscribe to Transactions
|
||||
ch1 := make(chan common.Hash)
|
||||
sub1, err := ec.SubscribePendingTransactions(context.Background(), ch1)
|
||||
if err != nil {
|
||||
t.Fatalf("subscribe pending txs failed: %v", err)
|
||||
}
|
||||
defer sub1.Unsubscribe()
|
||||
ec.SubscribePendingTransactions(context.Background(), ch1)
|
||||
|
||||
// Subscribe to Transactions
|
||||
ch2 := make(chan *types.Transaction)
|
||||
sub2, err := ec.SubscribeFullPendingTransactions(context.Background(), ch2)
|
||||
if err != nil {
|
||||
t.Fatalf("subscribe full pending txs failed: %v", err)
|
||||
}
|
||||
defer sub2.Unsubscribe()
|
||||
ec.SubscribeFullPendingTransactions(context.Background(), ch2)
|
||||
|
||||
// Send a transaction
|
||||
chainID, err := ethcl.ChainID(context.Background())
|
||||
|
|
@ -453,23 +445,14 @@ func testSubscribePendingTransactions(t *testing.T, client *rpc.Client) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
// Check that the transaction was sent over the channel
|
||||
select {
|
||||
case hash := <-ch1:
|
||||
if hash != signedTx.Hash() {
|
||||
t.Fatalf("Invalid tx hash received, got %v, want %v", hash, signedTx.Hash())
|
||||
}
|
||||
case err := <-sub1.Err():
|
||||
t.Fatalf("subscription 1 error: %v", err)
|
||||
hash := <-ch1
|
||||
if hash != signedTx.Hash() {
|
||||
t.Fatalf("Invalid tx hash received, got %v, want %v", hash, signedTx.Hash())
|
||||
}
|
||||
|
||||
// Check that the transaction was sent over the channel
|
||||
select {
|
||||
case tx := <-ch2:
|
||||
if tx.Hash() != signedTx.Hash() {
|
||||
t.Fatalf("Invalid tx hash received, got %v, want %v", tx.Hash(), signedTx.Hash())
|
||||
}
|
||||
case err := <-sub2.Err():
|
||||
t.Fatalf("subscription 2 error: %v", err)
|
||||
tx = <-ch2
|
||||
if tx.Hash() != signedTx.Hash() {
|
||||
t.Fatalf("Invalid tx hash received, got %v, want %v", tx.Hash(), signedTx.Hash())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,6 @@ func TestUDPv5_lookupE2E(t *testing.T) {
|
|||
var cfg Config
|
||||
if len(nodes) > 0 {
|
||||
bn := nodes[0].Self()
|
||||
// Wait for bootnode to have a valid UDP port (fix for flaky test)
|
||||
for j := 0; j < 50 && bn.UDP() == 0; j++ {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
bn = nodes[0].Self()
|
||||
}
|
||||
cfg.Bootnodes = []*enode.Node{bn}
|
||||
}
|
||||
node := startLocalhostV5(t, cfg)
|
||||
|
|
|
|||
Loading…
Reference in a new issue