Skip to content

Commit

Permalink
Merge branch 'main' into call-update
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodeev committed May 21, 2024
2 parents 49c0a26 + 3e3f332 commit 514e191
Show file tree
Hide file tree
Showing 9 changed files with 1,792 additions and 336 deletions.
8 changes: 3 additions & 5 deletions .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 All @@ -56,16 +56,14 @@ jobs:

# Test Account on devnet
- name: Test Account on devnet
run: echo "Skip for now - until account tests stable"
#run: cd account && go test -timeout 600s -v -env devnet .
run: cd account && go test -timeout 600s -v -env devnet .
env:
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_BASE: "http://localhost:5050"

# Test Account on mock
- name: Test Account with mocks
run: echo "Skip for now - until account tests stable"
#run: cd account && go test -v . -env mock
run: cd account && go test -v . -env mock

# Build examples
- name: Build examples
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
13 changes: 7 additions & 6 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
)

var (
ErrNotAllParametersSet = errors.New("Not all neccessary parameters have been set")
ErrTxnTypeUnSupported = errors.New("Unsupported transction type")
ErrTxnVersionUnSupported = errors.New("Unsupported transction version")
ErrFeltToBigInt = errors.New("Felt to BigInt error")
ErrNotAllParametersSet = errors.New("not all neccessary parameters have been set")
ErrTxnTypeUnSupported = errors.New("unsupported transction type")
ErrTxnVersionUnSupported = errors.New("unsupported transction version")
ErrFeltToBigInt = errors.New("felt to BigInt error")
)

var (
Expand Down Expand Up @@ -534,7 +534,8 @@ func (account *Account) WaitForTransactionReceipt(ctx context.Context, transacti
case <-t.C:
receiptWithBlockInfo, err := account.TransactionReceipt(ctx, transactionHash)
if err != nil {
if errors.Is(err, rpc.ErrHashNotFound) {
rpcErr := err.(*rpc.RPCError)
if rpcErr.Code == rpc.ErrHashNotFound.Code && rpcErr.Message == rpc.ErrHashNotFound.Message {
continue
} else {
return nil, err
Expand Down Expand Up @@ -905,7 +906,7 @@ func (account *Account) FmtCalldata(fnCalls []rpc.FunctionCall) ([]*felt.Felt, e
case 2:
return FmtCallDataCairo2(fnCalls), nil
default:
return nil, errors.New("Cairo version not supported")
return nil, errors.New("cairo version not supported")
}
}

Expand Down
Loading

0 comments on commit 514e191

Please sign in to comment.