mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +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
|
// Subscribe to Transactions
|
||||||
ch1 := make(chan common.Hash)
|
ch1 := make(chan common.Hash)
|
||||||
sub1, err := ec.SubscribePendingTransactions(context.Background(), ch1)
|
ec.SubscribePendingTransactions(context.Background(), ch1)
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("subscribe pending txs failed: %v", err)
|
|
||||||
}
|
|
||||||
defer sub1.Unsubscribe()
|
|
||||||
|
|
||||||
// Subscribe to Transactions
|
// Subscribe to Transactions
|
||||||
ch2 := make(chan *types.Transaction)
|
ch2 := make(chan *types.Transaction)
|
||||||
sub2, err := ec.SubscribeFullPendingTransactions(context.Background(), ch2)
|
ec.SubscribeFullPendingTransactions(context.Background(), ch2)
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("subscribe full pending txs failed: %v", err)
|
|
||||||
}
|
|
||||||
defer sub2.Unsubscribe()
|
|
||||||
|
|
||||||
// Send a transaction
|
// Send a transaction
|
||||||
chainID, err := ethcl.ChainID(context.Background())
|
chainID, err := ethcl.ChainID(context.Background())
|
||||||
|
|
@ -453,24 +445,15 @@ func testSubscribePendingTransactions(t *testing.T, client *rpc.Client) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
// Check that the transaction was sent over the channel
|
// Check that the transaction was sent over the channel
|
||||||
select {
|
hash := <-ch1
|
||||||
case hash := <-ch1:
|
|
||||||
if hash != signedTx.Hash() {
|
if hash != signedTx.Hash() {
|
||||||
t.Fatalf("Invalid tx hash received, got %v, want %v", 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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check that the transaction was sent over the channel
|
// Check that the transaction was sent over the channel
|
||||||
select {
|
tx = <-ch2
|
||||||
case tx := <-ch2:
|
|
||||||
if tx.Hash() != signedTx.Hash() {
|
if tx.Hash() != signedTx.Hash() {
|
||||||
t.Fatalf("Invalid tx hash received, got %v, want %v", 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func testCallContract(t *testing.T, client *rpc.Client) {
|
func testCallContract(t *testing.T, client *rpc.Client) {
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,6 @@ func TestUDPv5_lookupE2E(t *testing.T) {
|
||||||
var cfg Config
|
var cfg Config
|
||||||
if len(nodes) > 0 {
|
if len(nodes) > 0 {
|
||||||
bn := nodes[0].Self()
|
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}
|
cfg.Bootnodes = []*enode.Node{bn}
|
||||||
}
|
}
|
||||||
node := startLocalhostV5(t, cfg)
|
node := startLocalhostV5(t, cfg)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue