Skip to content

Commit

Permalink
ci(WIP): test devnet-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
penovicp committed Sep 1, 2023
1 parent 7f575dd commit 603abd7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ jobs:
# TODO - periodically check if conditional services are supported; https://github.com/actions/runner/issues/822
services:
devnet:
# image: ${{ inputs.use-rpc-devnet && 'shardlabs/starknet-devnet:0.6.0a0-seed0' || inputs.use-seq-devnet && 'shardlabs/starknet-devnet:0.6.0a0-seed0' || '' }}
image: ${{ (inputs.use-rpc-devnet || inputs.use-seq-devnet) && 'shardlabs/starknet-devnet:0.6.0a0-seed0' || '' }}
# image: shardlabs/starknet-devnet:0.6.0a0-seed0
image: ${{ inputs.use-rpc-devnet && 'shardlabs/starknet-devnet-rs:966221808176c3298cc47ca99e93650e77a6a323-seed0' || inputs.use-seq-devnet && 'shardlabs/starknet-devnet:0.5.5-seed0' || '' }}
# image: ${{ (inputs.use-rpc-devnet || inputs.use-seq-devnet) && 'shardlabs/starknet-devnet:0.5.5-seed0' || '' }}
# image: shardlabs/starknet-devnet-rs:966221808176c3298cc47ca99e93650e77a6a323-seed0
ports:
- 5050:5050

# TODO - temporary conditional, remove if/when devnet RPC support is restored
if: ${{ (!inputs.use-rpc-devnet) }}
# if: ${{ (!inputs.use-rpc-devnet) }}

# if: ${{ (inputs.use-rpc-devnet) }}

env:
TEST_PROVIDER_BASE_URL: ${{ secrets.TEST_PROVIDER_BASE_URL }}
Expand Down
20 changes: 15 additions & 5 deletions __tests__/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export const compiledC1v2Casm = readContractSierraCasm('cairo/helloCairo2/compil

/* Default test config based on run `starknet-devnet --seed 0` */
const DEFAULT_TEST_PROVIDER_SEQUENCER_URL = 'http://127.0.0.1:5050/';
const DEFAULT_TEST_ACCOUNT_ADDRESS =
'0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a';
const DEFAULT_TEST_ACCOUNT_PRIVATE_KEY = '0xe3e70682c2094cac629f6fbed82c07cd';
// const DEFAULT_TEST_ACCOUNT_ADDRESS =
// '0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a';
// const DEFAULT_TEST_ACCOUNT_PRIVATE_KEY = '0xe3e70682c2094cac629f6fbed82c07cd';

/* User defined config or default one */
const BASE_URL = process.env.TEST_PROVIDER_BASE_URL || DEFAULT_TEST_PROVIDER_SEQUENCER_URL;
Expand Down Expand Up @@ -103,8 +103,18 @@ export const getTestAccount = (provider: ProviderInterface) => {
throw new Error('TEST_ACCOUNT_ADDRESS is not set');
}
} else {
testAccountAddress = DEFAULT_TEST_ACCOUNT_ADDRESS;
testAccountPrivateKey = DEFAULT_TEST_ACCOUNT_PRIVATE_KEY;
// testAccountAddress = DEFAULT_TEST_ACCOUNT_ADDRESS;
// testAccountPrivateKey = DEFAULT_TEST_ACCOUNT_PRIVATE_KEY;

[testAccountAddress, testAccountPrivateKey] = IS_RPC
? [
'0x64b48806902a367c8598f4f95c305e8c1a1acba5f082d294a43793113115691',
'0x71d7bb07b9a64f6f78ac4c816aff4da9',
]
: [
'0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a',
'0xe3e70682c2094cac629f6fbed82c07cd',
];
}
const cairoVersion = (process.env.ACCOUNT_CAIRO_VERSION as CairoVersion) || '0';

Expand Down

0 comments on commit 603abd7

Please sign in to comment.