Skip to content

Commit

Permalink
devnet as default network
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmaayan committed Aug 8, 2023
1 parent 138a536 commit 47b214d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ecosystem/typescript/sdk_v2/src/utils/const.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Network } from "./api-endpoints";

export const DEFAULT_NETWORK = Network.TESTNET;
export const DEFAULT_NETWORK = Network.DEVNET;
21 changes: 11 additions & 10 deletions ecosystem/typescript/sdk_v2/tests/unit/aptos_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import { Aptos, AptosConfig } from "../../src";
import { Network } from "../../src/utils/api-endpoints";

describe("aptos config", () => {
test("it should set TESTNET network if network is not provided", async () => {
test("it should set DEVNET network if network is not provided", async () => {
const aptos = new Aptos();
expect(aptos.config.network).toEqual("testnet");
expect(aptos.config.fullnode).toEqual("https://fullnode.testnet.aptoslabs.com/v1");
expect(aptos.config.faucet).toEqual("https://faucet.testnet.aptoslabs.com");
expect(aptos.config.indexer).toEqual("https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql");
expect(aptos.config.network).toEqual("devnet");
expect(aptos.config.fullnode).toEqual("https://fullnode.devnet.aptoslabs.com/v1");
expect(aptos.config.faucet).toEqual("https://faucet.devnet.aptoslabs.com");
expect(aptos.config.indexer).toEqual("https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql");
});

test("it should set urls based on the provided network", async () => {
const settings: AptosConfig = {
network: Network.DEVNET,
network: Network.TESTNET,
};
const aptos = new Aptos(settings);
expect(aptos.config.network).toEqual("devnet");
expect(aptos.config.fullnode).toEqual("https://fullnode.devnet.aptoslabs.com/v1");
expect(aptos.config.faucet).toEqual("https://faucet.devnet.aptoslabs.com");
expect(aptos.config.indexer).toEqual("https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql");
console.log(Network.DEVNET === "devnet");
expect(aptos.config.network).toEqual("testnet");
expect(aptos.config.fullnode).toEqual("https://fullnode.testnet.aptoslabs.com/v1");
expect(aptos.config.faucet).toEqual("https://faucet.testnet.aptoslabs.com");
expect(aptos.config.indexer).toEqual("https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql");
});

test("it should set urls based on a local network", async () => {
Expand Down

0 comments on commit 47b214d

Please sign in to comment.