Skip to content

Commit

Permalink
Merge branch 'develop' into feat/udc-provider-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Nov 9, 2022
2 parents 40fdf29 + 25dc7f0 commit 927c9ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: sequencer-test
TEST_PROVIDER_BASE_URL: http://127.0.0.1:5050/
- name: sequencer-goerli
TEST_PROVIDER_BASE_URL: https://alpha4.starknet.io
TEST_PROVIDER_BASE_URL: https://alpha4-2.starknet.io
ENABLE_TEST_ACCOUNT_PRIVATE_KEY: true
ENABLE_TEST_ACCOUNT_ADDRESS: true
- name: rpc-goerli
Expand Down
10 changes: 9 additions & 1 deletion __tests__/udc.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { encodeShortString } from '../src/utils/shortString';
import { randomAddress } from '../src/utils/stark';
import { IS_DEVNET, compiledErc20, getTestAccount, getTestProvider } from './fixtures';

describe('Declare and UDC Deploy Flow', () => {
Expand All @@ -12,22 +13,29 @@ describe('Declare and UDC Deploy Flow', () => {
contract: compiledErc20,
});

await provider.waitForTransaction(declareTx.transaction_hash);

expect(declareTx).toHaveProperty('class_hash');
expect(declareTx.class_hash).toEqual(erc20ClassHash);
});

test('UDC Deploy', async () => {
const salt = randomAddress(); // use random salt

const deployment = await account.deploy({
classHash: erc20ClassHash,
constructorCalldata: [
encodeShortString('Token'),
encodeShortString('ERC20'),
account.address,
],
salt: '123',
salt,
unique: true, // Using true here so as not to clash with normal erc20 deploy in account and provider test
isDevnet: IS_DEVNET,
});

await provider.waitForTransaction(deployment.transaction_hash);

expect(deployment).toHaveProperty('transaction_hash');
});
});

0 comments on commit 927c9ec

Please sign in to comment.