Skip to content

Commit

Permalink
Merge pull request #256 from aeternity/feature/update-sdk
Browse files Browse the repository at this point in the history
Release v6.0.1 with [email protected]
  • Loading branch information
davidyuk authored Apr 22, 2024
2 parents 8df932a + 002cfb4 commit 53c7012
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- run: |
wget -q https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_25.0.4-1~ubuntu~jammy_amd64.deb
sudo apt install --allow-downgrades ./esl-erlang_25.0.4-1~ubuntu~jammy_amd64.deb
wget -q https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_25.2.3-1~ubuntu~jammy_amd64.deb
sudo apt install ./esl-erlang_25.2.3-1~ubuntu~jammy_amd64.deb
- uses: actions/checkout@v4
with:
fetch-depth: 100
Expand Down
3 changes: 0 additions & 3 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
process.env._EXPECTED_MINE_RATE = 1000
process.env._MICRO_BLOCK_CYCLE = 300

module.exports = {
recursive: true,
timeout: '4s',
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [6.0.1](https://github.com/aeternity/aepp-cli-js/compare/v6.0.0...v6.0.1) (2024-04-22)


### Bug Fixes

* don't show stacktrace for ACI-not-match error ([b1b53b5](https://github.com/aeternity/aepp-cli-js/commit/b1b53b5f135f63f6bac36a0f738581c9e2c616cc))
* update sdk to 13.3.2 ([2b63f5f](https://github.com/aeternity/aepp-cli-js/commit/2b63f5f0c8a8ae4d29a313fd441da0d09486b183))

## [6.0.0](https://github.com/aeternity/aepp-cli-js/compare/v5.0.0...v6.0.0) (2024-04-16)

*Check out the new documentation at [docs.aeternity.com/aepp-cli-js](https://docs.aeternity.com/aepp-cli-js/)*
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@aeternity/aepp-cli",
"version": "6.0.0",
"version": "6.0.1",
"description": "Aeternity command line interface",
"bin": {
"aecli": "src/aecli.js"
},
"type": "module",
"dependencies": {
"@aeternity/aepp-sdk": "^13.3.0",
"@aeternity/aepp-sdk": "^13.3.2",
"@azure/core-rest-pipeline": "^1.15.2",
"bignumber.js": "^9.1.2",
"commander": "^12.0.0",
Expand Down
22 changes: 20 additions & 2 deletions src/aecli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/usr/bin/env node
import { RestError } from '@azure/core-rest-pipeline';
import { InvalidPasswordError, NodeInvocationError, ContractError } from '@aeternity/aepp-sdk';
import { setCommandOptions } from './utils/config.js';
import { prepareOptions } from './utils/default-option-description.js';
import CliError from './utils/CliError.js';
import program from './commands/main.js';
import { runProgram } from './utils/CliError.js';

await runProgram(program);
try {
prepareOptions(program);
await setCommandOptions(program);
await program.parseAsync();
} catch (error) {
if (
error instanceof CliError
|| error instanceof RestError
|| error instanceof InvalidPasswordError
|| error instanceof NodeInvocationError
|| (error instanceof ContractError && error.message.includes('ACI doesn\'t match called contract'))
|| error.code === 'ENOENT'
) program.error(error.message);
else throw error;
}
25 changes: 0 additions & 25 deletions src/utils/CliError.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
import { RestError } from '@azure/core-rest-pipeline';
import { InvalidPasswordError, NodeInvocationError } from '@aeternity/aepp-sdk';
import { setCommandOptions } from './config.js';
import { prepareOptions } from './default-option-description.js';

export default class CliError extends Error {
constructor(message) {
super(message);
this.name = 'CliError';
}
}

export async function runProgram(program) {
try {
prepareOptions(program);
await setCommandOptions(program);
await program.parseAsync();
} catch (error) {
if (
error instanceof CliError
|| error instanceof RestError
|| error instanceof InvalidPasswordError
|| error instanceof NodeInvocationError
|| error.code === 'ENOENT'
) {
program.error(error.message);
return;
}
throw error;
}
}
4 changes: 0 additions & 4 deletions src/utils/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ export function initSdk({
url, keypair, compilerUrl, force: ignoreVersion, networkId, accounts = [],
} = {}) {
return new AeSdk({
/* eslint-disable no-underscore-dangle */
_expectedMineRate: process.env._EXPECTED_MINE_RATE,
_microBlockCycle: process.env._MICRO_BLOCK_CYCLE,
/* eslint-enable no-underscore-dangle */
nodes: url ? [{ name: 'test-node', instance: new Node(url, { ignoreVersion }) }] : [],
...compilerUrl && { onCompiler: getCompilerByUrl(compilerUrl) },
networkId,
Expand Down
4 changes: 0 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export const WALLET_NAME = 'test-artifacts/wallet.json';
const Sdk = (params = {}) => {
params.accounts ??= [new MemoryAccount(secretKey)];
return new AeSdk({
/* eslint-disable no-underscore-dangle */
_expectedMineRate: process.env._EXPECTED_MINE_RATE,
_microBlockCycle: process.env._MICRO_BLOCK_CYCLE,
/* eslint-enable no-underscore-dangle */
onCompiler: new CompilerHttpNode(compilerUrl),
nodes: [{ name: 'test', instance: new Node(url) }],
...params,
Expand Down

0 comments on commit 53c7012

Please sign in to comment.