Skip to content

Commit

Permalink
feat: Add sepolia configs for pool, pos e util files.
Browse files Browse the repository at this point in the history
Also the Ropsten configs were removed.
  • Loading branch information
brunomenezes committed Mar 27, 2024
1 parent 8334195 commit be25bf2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/contracts/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import {
import { ChainMap } from ".";

import goerli from "@cartesi/staking-pool/export/abi/goerli.json";
import ropsten from "@cartesi/staking-pool/export/abi/ropsten.json";
import sepolia from "@cartesi/staking-pool/export/abi/sepolia.json";
import localhost from "./localhost.json";

const abis: ChainMap = {
3: ropsten,
11155111: sepolia,
5: goerli,
31337: localhost,
};
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/pos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import { ChainMap, getAddress } from ".";

import mainnet from "@cartesi/pos/export/abi/mainnet.json";
import goerli from "@cartesi/pos/export/abi/goerli.json";
import ropsten from "@cartesi/pos/export/abi/ropsten.json";
import sepolia from "@cartesi/pos/export/abi/sepolia.json";
import localhost from "./localhost.json";

const abis: ChainMap = {
1: mainnet,
3: ropsten,
11155111: sepolia,
5: goerli,
31337: localhost,
};
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import { ChainMap, getAddress } from ".";

import mainnet from "@cartesi/util/export/abi/mainnet.json";
import goerli from "@cartesi/util/export/abi/goerli.json";
import ropsten from "@cartesi/util/export/abi/ropsten.json";
import sepolia from "@cartesi/util/export/abi/sepolia.json";
import localhost from "./localhost.json";

const abis: ChainMap = {
1: mainnet,
3: ropsten,
11155111: sepolia,
5: goerli,
31337: localhost,
};
Expand Down
14 changes: 14 additions & 0 deletions test/contracts/pos.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { createPoS } from "../../src/contracts";

import mainnet from "@cartesi/pos/export/abi/mainnet.json";
import goerli from "@cartesi/pos/export/abi/goerli.json";
import sepolia from "@cartesi/pos/export/abi/sepolia.json";

describe("pos contracts test suite", () => {
it("should create PoS mainnet contract", async () => {
Expand All @@ -31,6 +32,19 @@ describe("pos contracts test suite", () => {
expect(pos.signer).to.equal(signer);
});

it("should create PoS sepolia contract", async () => {
const network: Network = {
chainId: 11155111,
name: "sepolia",
};
const signer: Signer = new VoidSigner(
"0x569369A96be963B7ef2bA01dA792EF95fDcCD5b0"
);
const pos = await createPoS(network, signer);
expect(pos.address).to.equal(sepolia.contracts.PoS.address);
expect(pos.signer).to.equal(signer);
});

it("should create PoS goerli contract", async () => {
const network: Network = {
chainId: 5,
Expand Down
16 changes: 16 additions & 0 deletions test/contracts/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { createWorkerManager } from "../../src/contracts/util";

import mainnet from "@cartesi/util/export/abi/mainnet.json";
import goerli from "@cartesi/util/export/abi/goerli.json";
import sepolia from "@cartesi/util/export/abi/sepolia.json";

describe("util contracts test suite", () => {
it("should create mainnet contract", async () => {
Expand Down Expand Up @@ -47,4 +48,19 @@ describe("util contracts test suite", () => {
);
expect(workerManager.signer).to.equal(signer);
});

it("should create sepolia contract", async () => {
const network: Network = {
chainId: 11155111,
name: "sepolia",
};
const signer: Signer = new VoidSigner(
"0x569369A96be963B7ef2bA01dA792EF95fDcCD5b0"
);
const workerManager = await createWorkerManager(network, signer);
expect(workerManager.address).to.equal(
sepolia.contracts.WorkerManagerAuthManagerImpl.address
);
expect(workerManager.signer).to.equal(signer);
});
});

0 comments on commit be25bf2

Please sign in to comment.