Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganization the devnet subscription services #6331

Merged
merged 8 commits into from
Jan 10, 2023
Next Next commit
Saving
  • Loading branch information
leonardchinonso committed Dec 12, 2022
commit bb7dfd2dc162301cab3587a874425d18b286801c
4 changes: 4 additions & 0 deletions cmd/devnet/commands/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ func callContractTx() (*common.Hash, error) {
fmt.Printf("SUCCESS => Tx submitted, adding tx with hash %q to txpool\n", hash)
fmt.Println()

checkTxPoolContent(1, 0)

_, err = services.SearchBlockForTransactionHash(*hash)
if err != nil {
return nil, fmt.Errorf("failed to find tx in block: %v", err)
}
fmt.Println()

checkTxPoolContent(1, 0)

if err := services.EmitFallbackEvent(models.ReqId, subscriptionContract, transactOpts, address); err != nil {
fmt.Printf("failed to emit events: %v\n", err)
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions cmd/devnet/commands/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ func checkTxPoolContent(expectedPendingSize, expectedQueuedSize int) {

if pendingSize != expectedPendingSize {
fmt.Printf("FAILURE => %v\n", fmt.Errorf("expected %d transaction(s) in pending pool, got %d", expectedPendingSize, pendingSize))
return
}

if queuedSize != expectedQueuedSize {
fmt.Printf("FAILURE => %v\n", fmt.Errorf("expected %d transaction(s) in queued pool, got %d", expectedQueuedSize, queuedSize))
return
}

fmt.Printf("SUCCESS => %d transaction(s) in the pending pool and %d transaction(s) in the queued pool\n", pendingSize, queuedSize)
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/models/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const (
// ReqId is the request id for each request
ReqId = 0
// MaxNumberOfBlockChecks is the max number of blocks to look for a transaction in
MaxNumberOfBlockChecks = 1
MaxNumberOfBlockChecks = 3

// Latest is the parameter for the latest block
Latest BlockNumber = "latest"
Expand Down