Skip to content

Commit

Permalink
Merge pull request #392 from 0xs34n/test/rpc-testnet-2
Browse files Browse the repository at this point in the history
Test/rpc testnet 2
  • Loading branch information
tabaktoni authored Nov 10, 2022
2 parents feec75e + a1dafad commit 05333b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions __tests__/rpcProvider.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Account, GetBlockResponse, RpcProvider, ec } from '../src';
import { StarknetChainId } from '../src/constants';
import {
compiledOpenZeppelinAccount,
describeIfRpc,
Expand All @@ -22,7 +23,7 @@ describeIfRpc('RPCProvider', () => {

test('getChainId', async () => {
const chainId = await rpcProvider.getChainId();
expect(chainId).toBe('0x534e5f474f45524c49');
expect(chainId).toBe(StarknetChainId.TESTNET2);
});

test('getPendingTransactions', async () => {
Expand Down Expand Up @@ -115,9 +116,9 @@ describeIfRpc('RPCProvider', () => {
});
});

test('getClass classHash 0x0733734fa0dab1158bccdfe0df7b0becf3827f908971fac8d39cc73d99ad8645', async () => {
test('getClass classHash 0x00808396477a4296946bf6574afb2e14723f8d9a37bba25a1e104315ca89b1f7', async () => {
const contractClass = await rpcProvider.getClass(
'0x0733734fa0dab1158bccdfe0df7b0becf3827f908971fac8d39cc73d99ad8645'
'0x00808396477a4296946bf6574afb2e14723f8d9a37bba25a1e104315ca89b1f7'
);
expect(contractClass).toHaveProperty('program');
expect(contractClass).toHaveProperty('entry_points_by_type');
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const MASK_251 = TWO.pow(toBN(251));
export enum StarknetChainId {
MAINNET = '0x534e5f4d41494e', // encodeShortString('SN_MAIN'),
TESTNET = '0x534e5f474f45524c49', // encodeShortString('SN_GOERLI'),
TESTNET2 = '0x534e5f474f45524c4932',
}
export enum TransactionHashPrefix {
DECLARE = '0x6465636c617265', // encodeShortString('declare'),
Expand Down
2 changes: 1 addition & 1 deletion src/provider/sequencer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class SequencerProvider implements ProviderInterface {

private responseParser = new SequencerAPIResponseParser();

constructor(optionsOrProvider: SequencerProviderOptions = { network: 'goerli-alpha' }) {
constructor(optionsOrProvider: SequencerProviderOptions = { network: 'goerli-alpha-2' }) {
if ('network' in optionsOrProvider) {
this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network);
this.chainId = SequencerProvider.getChainIdFromBaseUrl(this.baseUrl);
Expand Down

0 comments on commit 05333b1

Please sign in to comment.