Skip to content

Commit

Permalink
Fixed TestWaitForTransactionReceipt on devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodeev committed May 16, 2024
1 parent b1fbb46 commit 4a147d4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main_ci_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: cd rpc && go test -timeout 600s -v -env devnet .
env:
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_BASE: "http://localhost:5050/rpc"
INTEGRATION_BASE: "http://localhost:5050/"

# Test rpc on mock
- name: Test RPC with mocks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
run: go test -timeout 600s -v -env devnet -run "^(TestRPC|TestGeneral)" .
env:
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_BASE: "http://localhost:5050/rpc"
INTEGRATION_BASE: "http://localhost:5050/"
2 changes: 1 addition & 1 deletion .github/workflows/test_rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: cd rpc && go test -timeout 600s -v -env devnet .
env:
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_BASE: "http://localhost:5050/rpc"
INTEGRATION_BASE: "http://localhost:5050/"

# Test rpc on mock
- name: Test RPC with mocks
Expand Down
8 changes: 4 additions & 4 deletions account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ func TestWaitForTransactionReceipt(t *testing.T) {
if testEnv != "devnet" {
t.Skip("Skipping test as it requires a devnet environment")
}
client, err := rpc.NewProvider(base + "/rpc")
client, err := rpc.NewProvider(base)
require.NoError(t, err, "Error in rpc.NewClient")

acnt, err := account.NewAccount(client, &felt.Zero, "pubkey", account.NewMemKeystore(), 0)
Expand All @@ -1119,10 +1119,10 @@ func TestWaitForTransactionReceipt(t *testing.T) {
testSet := map[string][]testSetType{
"devnet": {
{
Timeout: 3, // Should poll 3 times
Timeout: 1, // Should poll 3 times
Hash: new(felt.Felt).SetUint64(100),
ExpectedReceipt: nil,
ExpectedErr: rpc.Err(rpc.InternalError, "Post \"http://0.0.0.0:5050/rpc\": context deadline exceeded"),
ExpectedErr: rpc.Err(rpc.InternalError, "Post \"http://0.0.0.0:5050/\": context deadline exceeded"),
},
},
}[testEnv]
Expand All @@ -1131,7 +1131,7 @@ func TestWaitForTransactionReceipt(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(test.Timeout)*time.Second)
defer cancel()

resp, err := acnt.WaitForTransactionReceipt(ctx, test.Hash, 1*time.Second)
resp, err := acnt.WaitForTransactionReceipt(ctx, test.Hash, 2*time.Second)
if test.ExpectedErr != nil {
require.Equal(t, test.ExpectedErr.Error(), err.Error())
} else {
Expand Down

0 comments on commit 4a147d4

Please sign in to comment.