Skip to content

Commit

Permalink
refactor(chain)!: remove network_id command
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `aecli chain network_id` removed
Use `aecli chain status` instead.
  • Loading branch information
davidyuk committed Apr 15, 2024
1 parent 302c8b3 commit 4d4adce
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
11 changes: 0 additions & 11 deletions src/actions/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ export async function version(options) {
printUnderscored('Syncing', status.syncing);
}

// ## Retrieve `node` version
export async function getNetworkId(options) {
const { json } = options;
// Initialize `Ae`
const sdk = initSdk(options);
// Call `getStatus` API and print it
const { networkId } = await sdk.api.getStatus();
if (json) print({ networkId });
else printUnderscored('Network ID', networkId);
}

// ## Retrieve `ttl` version
export async function ttl(_absoluteTtl, { json, ...options }) {
// Initialize `Ae`
Expand Down
8 changes: 0 additions & 8 deletions src/commands/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ addCommonOptions(program
.description('Get relative ttl')
.action(Chain.ttl));

// ## Initialize `network_id` command
//
// You can use this command to get current network ID
addCommonOptions(program
.command('network_id')
.description('Get network ID')
.action(Chain.getNetworkId));

// ## Initialize `play` command
//
// You can use this command to get list of block by some condition (by `limit` or `height`)
Expand Down
6 changes: 0 additions & 6 deletions test/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,4 @@ Absolute TTL ____________________________ 10
Relative TTL ____________________________ ${resJson.relativeTtl}
`.trim());
});

it('prints network id', async () => {
const nodeNetworkId = await sdk.api.getNetworkId();
const { networkId } = await executeChain(['network_id', '--json']);
nodeNetworkId.should.equal(networkId);
});
});

0 comments on commit 4d4adce

Please sign in to comment.