Skip to content

Commit c2da26d

Browse files
committed
fix: fix tests for starknet 0.10
1 parent fc2fcbb commit c2da26d

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

.github/workflows/pr.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,29 @@ jobs:
1919
- run: npm ci
2020
- run: npm run build --if-present
2121

22+
- uses: actions/upload-artifact@v2
23+
with:
24+
name: build
25+
path: dist
26+
2227
tests:
23-
name: Run test
28+
strategy:
29+
max-parallel: 1 # needed until we get a seperate account for the rpc provider, until then running them in parallel would result in a nonce issue
30+
matrix:
31+
name: [sequencer-test, sequencer-goerli, rpc-goerli]
32+
include:
33+
- name: sequencer-test
34+
TEST_PROVIDER_BASE_URL: http://127.0.0.1:5050/
35+
- name: sequencer-goerli
36+
TEST_PROVIDER_BASE_URL: https://alpha4.starknet.io
37+
ENABLE_TEST_ACCOUNT_PRIVATE_KEY: true
38+
ENABLE_TEST_ACCOUNT_ADDRESS: true
39+
- name: rpc-goerli
40+
ENABLE_TEST_RPC_URL: true
41+
ENABLE_TEST_ACCOUNT_PRIVATE_KEY: true
42+
ENABLE_TEST_ACCOUNT_ADDRESS: true
43+
44+
name: Run test on ${{ matrix.name }}
2445
runs-on: ubuntu-latest
2546
needs: [build]
2647

@@ -30,7 +51,10 @@ jobs:
3051
ports:
3152
- 5050:5050
3253
env:
33-
TEST_PROVIDER_BASE_URL: http://127.0.0.1:5050/
54+
TEST_PROVIDER_BASE_URL: ${{ matrix.TEST_PROVIDER_BASE_URL }}
55+
TEST_RPC_URL: ${{ matrix.ENABLE_TEST_RPC_URL && secrets.TEST_RPC_URL }}
56+
TEST_ACCOUNT_PRIVATE_KEY: ${{ matrix.ENABLE_TEST_ACCOUNT_PRIVATE_KEY && secrets.TEST_ACCOUNT_PRIVATE_KEY }}
57+
TEST_ACCOUNT_ADDRESS: ${{ matrix.ENABLE_TEST_ACCOUNT_ADDRESS && secrets.TEST_ACCOUNT_ADDRESS }}
3458

3559
steps:
3660
- uses: actions/checkout@v2

src/account/default.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ import { AccountInterface } from './interface';
2323
export class Account extends Provider implements AccountInterface {
2424
public signer: SignerInterface;
2525

26+
public address: string;
27+
2628
constructor(
2729
providerOrOptions: ProviderOptions | ProviderInterface,
28-
public address: string,
30+
address: string,
2931
keyPairOrSigner: KeyPair | SignerInterface
3032
) {
3133
super(providerOrOptions);
34+
this.address = address.toLowerCase();
3235
this.signer =
3336
'getPubKey' in keyPairOrSigner ? keyPairOrSigner : new Signer(keyPairOrSigner as KeyPair);
3437
}

src/contract/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class Contract implements ContractInterface {
125125
address: string,
126126
providerOrAccount: ProviderInterface | AccountInterface = defaultProvider
127127
) {
128-
this.address = address;
128+
this.address = address.toLowerCase();
129129
this.providerOrAccount = providerOrAccount;
130130
this.abi = abi;
131131
this.structs = abi

0 commit comments

Comments
 (0)