mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
fix: rename func AddRemoteSync to addRemoteSync
This commit is contained in:
parent
6832f228fa
commit
19fb6103c0
2 changed files with 8 additions and 8 deletions
|
|
@ -889,7 +889,7 @@ func (pool *TxPool) AddRemotesSync(txs []*types.Transaction) []error {
|
|||
}
|
||||
|
||||
// This is like AddRemotes with a single transaction, but waits for pool reorganization. Tests use this method.
|
||||
func (pool *TxPool) AddRemoteSync(tx *types.Transaction) error {
|
||||
func (pool *TxPool) addRemoteSync(tx *types.Transaction) error {
|
||||
errs := pool.AddRemotesSync([]*types.Transaction{tx})
|
||||
return errs[0]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -725,7 +725,7 @@ func TestTransactionGapFilling(t *testing.T) {
|
|||
t.Fatalf("pool internal state corrupted: %v", err)
|
||||
}
|
||||
// Fill the nonce gap and ensure all transactions become pending
|
||||
if err := pool.AddRemoteSync(transaction(1, 100000, key)); err != nil {
|
||||
if err := pool.addRemoteSync(transaction(1, 100000, key)); err != nil {
|
||||
t.Fatalf("failed to add gapped transaction: %v", err)
|
||||
}
|
||||
pending, queued = pool.Stats()
|
||||
|
|
@ -757,7 +757,7 @@ func TestTransactionQueueAccountLimiting(t *testing.T) {
|
|||
testTxPoolConfig.AccountQueue = 10
|
||||
// Keep queuing up transactions and make sure all above a limit are dropped
|
||||
for i := uint64(1); i <= testTxPoolConfig.AccountQueue; i++ {
|
||||
if err := pool.AddRemoteSync(transaction(i, 100000, key)); err != nil {
|
||||
if err := pool.addRemoteSync(transaction(i, 100000, key)); err != nil {
|
||||
t.Fatalf("tx %d: failed to add transaction: %v", i, err)
|
||||
}
|
||||
if len(pool.pending) != 0 {
|
||||
|
|
@ -963,7 +963,7 @@ func TestTransactionPendingLimiting(t *testing.T) {
|
|||
|
||||
// Keep queuing up transactions and make sure all above a limit are dropped
|
||||
for i := uint64(0); i < testTxPoolConfig.AccountQueue; i++ {
|
||||
if err := pool.AddRemoteSync(transaction(i, 100000, key)); err != nil {
|
||||
if err := pool.addRemoteSync(transaction(i, 100000, key)); err != nil {
|
||||
t.Fatalf("tx %d: failed to add transaction: %v", i, err)
|
||||
}
|
||||
if pool.pending[account].Len() != int(i)+1 {
|
||||
|
|
@ -1458,7 +1458,7 @@ func TestTransactionPoolStableUnderpricing(t *testing.T) {
|
|||
t.Fatalf("pool internal state corrupted: %v", err)
|
||||
}
|
||||
// Ensure that adding high priced transactions drops a cheap, but doesn't produce a gap
|
||||
if err := pool.AddRemoteSync(pricedTransaction(0, 100000, big.NewInt(3), keys[1])); err != nil {
|
||||
if err := pool.addRemoteSync(pricedTransaction(0, 100000, big.NewInt(3), keys[1])); err != nil {
|
||||
t.Fatalf("failed to add well priced transaction: %v", err)
|
||||
}
|
||||
pending, queued = pool.Stats()
|
||||
|
|
@ -1502,7 +1502,7 @@ func TestTransactionReplacement(t *testing.T) {
|
|||
price := int64(100)
|
||||
threshold := (price * (100 + int64(testTxPoolConfig.PriceBump))) / 100
|
||||
|
||||
if err := pool.AddRemoteSync(pricedTransaction(0, 100000, big.NewInt(1), key)); err != nil {
|
||||
if err := pool.addRemoteSync(pricedTransaction(0, 100000, big.NewInt(1), key)); err != nil {
|
||||
t.Fatalf("failed to add original cheap pending transaction: %v", err)
|
||||
}
|
||||
if err := pool.AddRemote(pricedTransaction(0, 100001, big.NewInt(1), key)); err != ErrReplaceUnderpriced {
|
||||
|
|
@ -1515,7 +1515,7 @@ func TestTransactionReplacement(t *testing.T) {
|
|||
t.Fatalf("cheap replacement event firing failed: %v", err)
|
||||
}
|
||||
|
||||
if err := pool.AddRemoteSync(pricedTransaction(0, 100000, big.NewInt(price), key)); err != nil {
|
||||
if err := pool.addRemoteSync(pricedTransaction(0, 100000, big.NewInt(price), key)); err != nil {
|
||||
t.Fatalf("failed to add original proper pending transaction: %v", err)
|
||||
}
|
||||
if err := pool.AddRemote(pricedTransaction(0, 100001, big.NewInt(threshold-1), key)); err != ErrReplaceUnderpriced {
|
||||
|
|
@ -1606,7 +1606,7 @@ func testTransactionJournaling(t *testing.T, nolocals bool) {
|
|||
if err := pool.AddLocal(pricedTransaction(2, 100000, big.NewInt(1), local)); err != nil {
|
||||
t.Fatalf("failed to add local transaction: %v", err)
|
||||
}
|
||||
if err := pool.AddRemoteSync(pricedTransaction(0, 100000, big.NewInt(1), remote)); err != nil {
|
||||
if err := pool.addRemoteSync(pricedTransaction(0, 100000, big.NewInt(1), remote)); err != nil {
|
||||
t.Fatalf("failed to add remote transaction: %v", err)
|
||||
}
|
||||
pending, queued := pool.Stats()
|
||||
|
|
|
|||
Loading…
Reference in a new issue