Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: automatically deploys trap canister if it doesn't exist yet dur… #942

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

## [Unreleased]

## Changed
### Added

- fix: recalculates body to use a fresh `Expiry` when polling for `read_state` requests. This prevents the request from exceeding the `maximum_ingress_expiry` when the replica is slow to respond.
### Changed

## [2.1.2] - 2024-09-30
- fix: revert https://github.com/dfinity/agent-js/pull/923 allow option to set agent replica time
- test: automatically deploys trap canister if it doesn't exist yet during e2e
- fix: handle v3 traps correctly, pulling the reject_code and message from the certificate in the error response like v2.
Example trap error message:
```txt
Expand All @@ -20,6 +19,10 @@ AgentError: Call failed:
"Reject message": "foo"
```
- feat: the `UpdateCallRejected` error now exposes `reject_code: ReplicaRejectCode`, `reject_message: string`, and `error_code?: string` properties directly on the error object.
- fix: recalculates body to use a fresh `Expiry` when polling for `read_state` requests. This prevents the request from exceeding the `maximum_ingress_expiry` when the replica is slow to respond.

## [2.1.2] - 2024-09-30
- fix: revert https://github.com/dfinity/agent-js/pull/923 allow option to set agent replica time

## [2.1.1] - 2024-09-13

Expand Down
9 changes: 8 additions & 1 deletion e2e/node/basic/trap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import util from 'util';
import exec from 'child_process';
const execAsync = util.promisify(exec.exec);

const { stdout } = await execAsync('dfx canister id trap');
// eslint-disable-next-line prefer-const
let stdout;
try {
({ stdout } = await execAsync('dfx canister id trap'));
} catch {
await execAsync('dfx deploy trap');
({ stdout } = await execAsync('dfx canister id trap'));
}

export const idlFactory = ({ IDL }) => {
return IDL.Service({
Expand Down
Loading