Skip to content

Commit

Permalink
Merge branch 'dfinity:main' into jt/spelling-mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifertrin authored Oct 31, 2023
2 parents e21c9d9 + 842b239 commit 5ab0b58
Show file tree
Hide file tree
Showing 45 changed files with 1,657 additions and 17,691 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ jobs:
# build monorepo incl. each subpackage
- run: npm run build --workspaces --if-present

- run: echo y | sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- uses: dfinity/setup-dfx@main

- name: running dfx
id: dfx
run: |
dfx start --background
- name: setup
id: setup
run: npm run setup --workspaces --if-present

- run: npm run e2e --workspaces --if-present
env:
CI: true
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/mitm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- reopened
- edited
- synchronize
workflow_dispatch:

jobs:
test:
Expand Down Expand Up @@ -37,10 +38,10 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: '3.8'
- run: pip3 install mitmproxy~=8.0.0
python-version: '3.11'
- run: pip3 install mitmproxy~=10.0.0

- run: echo y | sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- uses: dfinity/setup-dfx@main

- name: running dfx
id: dfx
Expand All @@ -51,17 +52,15 @@ jobs:
id: mitmdump
run: |
set -ex
mitmdump -p 8888 --mode reverse:http://127.0.0.1:4943 \
mitmdump -p 8888 --mode reverse:https://icp-api.io \
--modify-headers '/~s/Transfer-Encoding/' \
--modify-body '/~s/Hello/Hullo' \
&
sleep 5
sleep 20
- name: mitm e2e
env:
CI: true
REPLICA_PORT: 8888
MITM: true
run: npm run mitm --workspaces --if-present

aggregate:
Expand Down
2 changes: 1 addition & 1 deletion demos/sample-javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

1. Ensure all dependencies are installed: `npm install`
2. Run the development server `npm run develop`
3. Visit the running site at http://localhost:8080
3. Visit the running site at http://127.0.0.1:8080
1 change: 0 additions & 1 deletion demos/sample-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"dependencies": {
"@dfinity/agent": "^0.19.3",
"@dfinity/authentication": "^0.14.1",
"@dfinity/identity": "^0.19.3",
"@dfinity/principal": "^0.19.3"
},
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ <h1>Agent-JS Changelog</h1>
<section>
<h2>Version x.x.x</h2>
<ul>
<li>feat: adds subnet metrics decoding to canisterStatus for `/subnet` path</li>
<li>
chore: replaces use of localhost with 127.0.0.1 for better node 18 support. Also swaps
Jest for vitest, runs mitm against mainnet, and updates some packages
</li>
<li>feat: retry logic will catch and retry for thrown errors</li>
<li>
feat!: adds certificate logic to decode subnet and node key paths from the hashtree.
Expand Down
2 changes: 1 addition & 1 deletion e2e/browser/.proxyrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/api": {
"target": "http://localhost:4943/",
"target": "http://127.0.0.1:4943/"
}
}
19 changes: 17 additions & 2 deletions e2e/browser/cypress/e2e/ecdsa.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ import { ECDSAKeyIdentity } from '@dfinity/identity';
import { get, set } from 'idb-keyval';
import { createActor } from '../utils/actor';
import ids from '../../.dfx/local/canister_ids.json';
import fetchPolyfill from 'isomorphic-fetch';
const canisterId = ids.whoami.local;

const setup = async () => {
const identity1 = await ECDSAKeyIdentity.generate();
const whoami1 = createActor(ids.whoami.local, { agentOptions: { identity: identity1 } });
const whoami1 = createActor(ids.whoami.local, {
agentOptions: {
verifyQuerySignatures: false,
identity: identity1,
fetch: fetchPolyfill,
host: 'http://127.0.0.1:4943/',
},
});

const principal1 = await whoami1.whoami();

Expand Down Expand Up @@ -34,7 +42,14 @@ describe('ECDSAKeyIdentity tests with SubtleCrypto', () => {

const identity2 = await ECDSAKeyIdentity.fromKeyPair(storedKeyPair);

const whoami2 = createActor(canisterId, { agentOptions: { identity: identity2 } });
const whoami2 = createActor(canisterId, {
agentOptions: {
verifyQuerySignatures: false,
identity: identity2,
fetchPolyfill,
host: 'http://127.0.0.1:4943/',
},
});

const principal2 = await whoami2.whoami();

Expand Down
Loading

0 comments on commit 5ab0b58

Please sign in to comment.