Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new chain ID for Alpha Goerli 2 #267

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export enum TransactionHashPrefix {
DEPLOY = "110386840629113",
INVOKE = "115923154332517"
}

export enum StarknetChainId {
MAINNET = "0x534e5f4d41494e",
TESTNET = "0x534e5f474f45524c49",
TESTNET2 = "0x534e5f474f45524c4932"
}

export const PREFIX_TRANSACTION = "StarkNet Transaction";

export const TRANSACTION_VERSION = BigInt(1);
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {
VOYAGER_GOERLI_VERIFIED_URL,
VOYAGER_MAINNET_VERIFIED_URL,
VOYAGER_GOERLI_2_CONTRACT_API_URL,
VOYAGER_GOERLI_2_VERIFIED_URL
VOYAGER_GOERLI_2_VERIFIED_URL,
StarknetChainId
} from "./constants";
import {
getAccountPath,
Expand Down Expand Up @@ -60,7 +61,6 @@ import {
} from "./extend-utils";
import { DevnetUtils } from "./devnet-utils";
import { ExternalServer } from "./external-server";
import { StarknetChainId } from "starknet/constants";

exitHook(() => {
ExternalServer.cleanAll();
Expand Down Expand Up @@ -130,7 +130,7 @@ extendConfig((config: HardhatConfig) => {
ALPHA_GOERLI_URL_2,
VOYAGER_GOERLI_2_CONTRACT_API_URL,
VOYAGER_GOERLI_2_VERIFIED_URL,
StarknetChainId.TESTNET
StarknetChainId.TESTNET2
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/starknet_cli_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@

CHAIN_IDS = {
"alpha-goerli": StarknetChainId.TESTNET.value,
"alpha-goerli2": StarknetChainId.TESTNET.value,
"alpha-mainnet": StarknetChainId.MAINNET.value,
"alpha-goerli2": StarknetChainId.TESTNET.value, # Should be changed to StarknetChainId.TESTNET2.value when adapting 0.10.3.
"alpha-mainnet": StarknetChainId.MAINNET.value
}

FEE_MARGIN_OF_ESTIMATION = 1.1
Expand Down
2 changes: 1 addition & 1 deletion src/type-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import { Account, ArgentAccount, OpenZeppelinAccount } from "./account";
import { Transaction, TransactionReceipt, Block, TransactionTrace } from "./starknet-types";
import { HardhatNetworkConfig, NetworkConfig } from "hardhat/types/config";
import { StarknetChainId } from "starknet/constants";
import { StarknetChainId } from "./constants";

type StarknetConfig = {
dockerizedVersion?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {
ALPHA_TESTNET_2_INTERNALLY,
DEFAULT_STARKNET_ACCOUNT_PATH,
INTEGRATED_DEVNET,
INTEGRATED_DEVNET_INTERNALLY
INTEGRATED_DEVNET_INTERNALLY,
StarknetChainId
} from "./constants";
import * as path from "path";
import * as fs from "fs";
import { glob } from "glob";
import { promisify } from "util";
import { StringMap } from "./types";
import { StarknetChainId } from "starknet/constants";

const globPromise = promisify(glob);
/**
Expand Down