Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
fix(cli)!: remove default value for --consensusAddress
Browse files Browse the repository at this point in the history
* Removed `Authority` address as default option for `--consensusAddress`
* Removed `authority` exported variable from `src/connect.ts`

BREAKING CHANGE: require `--consensusAddress <addr>`
  • Loading branch information
guidanoli committed Jun 15, 2023
1 parent 879ac33 commit 287f648
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
15 changes: 4 additions & 11 deletions onchain/rollups-cli/src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { parseUnits } from "@ethersproject/units";
import { ApplicationCreatedEvent } from "@cartesi/rollups/dist/src/types/contracts/dapp/ICartesiDAppFactory";

import { BlockchainArgs, blockchainBuilder } from "../args";
import { authority, factory } from "../connect";
import { factory } from "../connect";
import { safeHandler } from "../util";

interface Args extends BlockchainArgs {
dappOwner?: string;
consensusAddress?: string;
consensusAddress: string;
templateHash?: string;
templateHashFile?: string;
salt?: string;
Expand Down Expand Up @@ -52,6 +52,7 @@ const builder = (yargs: Argv<{}>): Argv<Args> => {
.option("consensusAddress", {
describe: "Consensus contract address",
type: "string",
demandOption: true,
})
.option("templateHash", {
describe: "Cartesi Machine template hash",
Expand Down Expand Up @@ -95,14 +96,6 @@ const handler = safeHandler<Args>(async (args) => {
// connect to provider, use deployment address based on returned chain id of provider
console.log(`connecting to ${rpc}`);

// connect to authority
const authorityContract = await authority(
rpc,
mnemonic,
accountIndex,
deploymentFile
);

// connect to factory
const factoryContract = await factory(
rpc,
Expand Down Expand Up @@ -130,7 +123,7 @@ const handler = safeHandler<Args>(async (args) => {
overrides.gasLimit = gasLimit;
}

const consensusAddress = args.consensusAddress || authorityContract.address;
const consensusAddress = args.consensusAddress;
const dappOwner = args.dappOwner || address;

let tx;
Expand Down
7 changes: 0 additions & 7 deletions onchain/rollups-cli/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import fs from "fs";
import { JsonRpcProvider } from "@ethersproject/providers";
import { ethers } from "ethers";
import {
Authority,
Authority__factory,
CartesiDAppFactory,
CartesiDAppFactory__factory,
} from "@cartesi/rollups";
Expand Down Expand Up @@ -99,11 +97,6 @@ function getContractConnector<T>(contractName: string, contractFactory: any) {
};
}

export const authority = getContractConnector<Authority>(
"Authority",
Authority__factory
);

export const factory = getContractConnector<CartesiDAppFactory>(
"CartesiDAppFactory",
CartesiDAppFactory__factory
Expand Down

0 comments on commit 287f648

Please sign in to comment.