Skip to content

Commit 53c7012

Browse files
authored
Merge pull request #256 from aeternity/feature/update-sdk
Release v6.0.1 with [email protected]
2 parents 8df932a + 002cfb4 commit 53c7012

File tree

9 files changed

+38
-48
lines changed

9 files changed

+38
-48
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
runs-on: ubuntu-22.04
99
steps:
1010
- run: |
11-
wget -q https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_25.0.4-1~ubuntu~jammy_amd64.deb
12-
sudo apt install --allow-downgrades ./esl-erlang_25.0.4-1~ubuntu~jammy_amd64.deb
11+
wget -q https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_25.2.3-1~ubuntu~jammy_amd64.deb
12+
sudo apt install ./esl-erlang_25.2.3-1~ubuntu~jammy_amd64.deb
1313
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 100

.mocharc.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
process.env._EXPECTED_MINE_RATE = 1000
2-
process.env._MICRO_BLOCK_CYCLE = 300
3-
41
module.exports = {
52
recursive: true,
63
timeout: '4s',

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
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.
44

5+
### [6.0.1](https://github.com/aeternity/aepp-cli-js/compare/v6.0.0...v6.0.1) (2024-04-22)
6+
7+
8+
### Bug Fixes
9+
10+
* don't show stacktrace for ACI-not-match error ([b1b53b5](https://github.com/aeternity/aepp-cli-js/commit/b1b53b5f135f63f6bac36a0f738581c9e2c616cc))
11+
* update sdk to 13.3.2 ([2b63f5f](https://github.com/aeternity/aepp-cli-js/commit/2b63f5f0c8a8ae4d29a313fd441da0d09486b183))
12+
513
## [6.0.0](https://github.com/aeternity/aepp-cli-js/compare/v5.0.0...v6.0.0) (2024-04-16)
614

715
*Check out the new documentation at [docs.aeternity.com/aepp-cli-js](https://docs.aeternity.com/aepp-cli-js/)*

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@aeternity/aepp-cli",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Aeternity command line interface",
55
"bin": {
66
"aecli": "src/aecli.js"
77
},
88
"type": "module",
99
"dependencies": {
10-
"@aeternity/aepp-sdk": "^13.3.0",
10+
"@aeternity/aepp-sdk": "^13.3.2",
1111
"@azure/core-rest-pipeline": "^1.15.2",
1212
"bignumber.js": "^9.1.2",
1313
"commander": "^12.0.0",

src/aecli.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#!/usr/bin/env node
2+
import { RestError } from '@azure/core-rest-pipeline';
3+
import { InvalidPasswordError, NodeInvocationError, ContractError } from '@aeternity/aepp-sdk';
4+
import { setCommandOptions } from './utils/config.js';
5+
import { prepareOptions } from './utils/default-option-description.js';
6+
import CliError from './utils/CliError.js';
27
import program from './commands/main.js';
3-
import { runProgram } from './utils/CliError.js';
48

5-
await runProgram(program);
9+
try {
10+
prepareOptions(program);
11+
await setCommandOptions(program);
12+
await program.parseAsync();
13+
} catch (error) {
14+
if (
15+
error instanceof CliError
16+
|| error instanceof RestError
17+
|| error instanceof InvalidPasswordError
18+
|| error instanceof NodeInvocationError
19+
|| (error instanceof ContractError && error.message.includes('ACI doesn\'t match called contract'))
20+
|| error.code === 'ENOENT'
21+
) program.error(error.message);
22+
else throw error;
23+
}

src/utils/CliError.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
1-
import { RestError } from '@azure/core-rest-pipeline';
2-
import { InvalidPasswordError, NodeInvocationError } from '@aeternity/aepp-sdk';
3-
import { setCommandOptions } from './config.js';
4-
import { prepareOptions } from './default-option-description.js';
5-
61
export default class CliError extends Error {
72
constructor(message) {
83
super(message);
94
this.name = 'CliError';
105
}
116
}
12-
13-
export async function runProgram(program) {
14-
try {
15-
prepareOptions(program);
16-
await setCommandOptions(program);
17-
await program.parseAsync();
18-
} catch (error) {
19-
if (
20-
error instanceof CliError
21-
|| error instanceof RestError
22-
|| error instanceof InvalidPasswordError
23-
|| error instanceof NodeInvocationError
24-
|| error.code === 'ENOENT'
25-
) {
26-
program.error(error.message);
27-
return;
28-
}
29-
throw error;
30-
}
31-
}

src/utils/cli.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ export function initSdk({
1616
url, keypair, compilerUrl, force: ignoreVersion, networkId, accounts = [],
1717
} = {}) {
1818
return new AeSdk({
19-
/* eslint-disable no-underscore-dangle */
20-
_expectedMineRate: process.env._EXPECTED_MINE_RATE,
21-
_microBlockCycle: process.env._MICRO_BLOCK_CYCLE,
22-
/* eslint-enable no-underscore-dangle */
2319
nodes: url ? [{ name: 'test-node', instance: new Node(url, { ignoreVersion }) }] : [],
2420
...compilerUrl && { onCompiler: getCompilerByUrl(compilerUrl) },
2521
networkId,

test/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ export const WALLET_NAME = 'test-artifacts/wallet.json';
3131
const Sdk = (params = {}) => {
3232
params.accounts ??= [new MemoryAccount(secretKey)];
3333
return new AeSdk({
34-
/* eslint-disable no-underscore-dangle */
35-
_expectedMineRate: process.env._EXPECTED_MINE_RATE,
36-
_microBlockCycle: process.env._MICRO_BLOCK_CYCLE,
37-
/* eslint-enable no-underscore-dangle */
3834
onCompiler: new CompilerHttpNode(compilerUrl),
3935
nodes: [{ name: 'test', instance: new Node(url) }],
4036
...params,

0 commit comments

Comments
 (0)