Skip to content
Draft
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
7 changes: 7 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# Call your personal global hook if it exists
if [ -x "$HOME/.config/git/hooks/prepare-commit-msg" ]; then
"$HOME/.config/git/hooks/prepare-commit-msg" "$1" "$2" "$3"
fi
1 change: 1 addition & 0 deletions check
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
23 changes: 15 additions & 8 deletions packages/sdk-communication-layer/e2e/sdk-comm.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const getClient = ({ type, options }: { type: 'dApp' | 'wallet', options:

describe('SDK Communication Layer', () => {
let clientsReady = false;
const communicationServerUrl = 'http://localhost:4000';
const communicationServerUrl = 'http://localhost:4000'; // Adjust with your server url

describe('Protocol V1', () => {
it('should establish client/mobile connection through comm server with remote key exchange', async () => {
Expand Down Expand Up @@ -145,7 +145,8 @@ describe('SDK Communication Layer', () => {
communicationServerUrl
}
})
const clientPublicKey = dAppClient.getKeyInfo()?.ecies.public ?? '';
await dAppClient.initFromDappStorage();
const clientPublicKey = dAppClient.getKeyInfo()?.ecies.public ?? 'aaa';

const walletClient = getClient({ type: 'dApp', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });

Expand All @@ -172,14 +173,16 @@ describe('SDK Communication Layer', () => {
const channelId = uuidv4();

const dAppClient = getClient({
type: 'wallet', options: {
type: 'dApp', options: {
communicationServerUrl
}
})
await dAppClient.initFromDappStorage();
await dAppClient.connectToChannel({ channelId });

const clientPublicKey = dAppClient.getKeyInfo()?.ecies.public ?? '';

const walletClient = getClient({ type: 'dApp', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });
const walletClient = getClient({ type: 'wallet', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });
await walletClient.connectToChannel({ channelId, authorized: true });

await waitForCondition({
Expand Down Expand Up @@ -209,14 +212,16 @@ describe('SDK Communication Layer', () => {
const channelId = uuidv4();

const dAppClient = getClient({
type: 'wallet', options: {
type: 'dApp', options: {
communicationServerUrl
}
})
await dAppClient.initFromDappStorage();
await dAppClient.connectToChannel({ channelId });

const clientPublicKey = dAppClient.getKeyInfo()?.ecies.public ?? '';

const walletClient = getClient({ type: 'dApp', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });
const walletClient = getClient({ type: 'wallet', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });

await walletClient.connectToChannel({ channelId, authorized: true });
await walletClient.sendMessage({
Expand Down Expand Up @@ -251,14 +256,16 @@ describe('SDK Communication Layer', () => {
const channelId = uuidv4();

const dAppClient = getClient({
type: 'wallet', options: {
type: 'dApp', options: {
communicationServerUrl
}
})
await dAppClient.initFromDappStorage();
await dAppClient.connectToChannel({ channelId });

const clientPublicKey = dAppClient.getKeyInfo()?.ecies.public ?? '';

const walletClient = getClient({ type: 'dApp', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });
const walletClient = getClient({ type: 'wallet', options: { communicationServerUrl, otherPublicKey: clientPublicKey } });

await walletClient.connectToChannel({ channelId, authorized: true });

Expand Down