Skip to content

Commit

Permalink
fix: name conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
vrockz747 committed Jul 26, 2024
1 parent 4047d20 commit 19b08fa
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 69 deletions.
4 changes: 2 additions & 2 deletions apps/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const run = async () => {
const wallets = await mApp.getWallets();
const params : IWalletSignParams = {
challenge: wallets.walletList[0].id,
walletId: wallets.walletList[0].i,
walletId: wallets.walletList[0].id,
// new Uint8Array([
// 154, 108, 179, 79, 204, 240, 165, 236,
// 246, 144, 78, 203, 251, 52, 85, 159,
Expand All @@ -52,7 +52,7 @@ const run = async () => {
isPublickey: true
}

const challengeresponse = await iApp.getWalletSign(params);
const challengeresponse = await iApp.getWalletAuth(params);

console.log(challengeresponse);

Expand Down
4 changes: 2 additions & 2 deletions packages/app-inheritance/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export class InheritanceApp {
return new InheritanceApp(sdk);
}

public async getWalletSign(params: operations.IWalletSignParams) {
public async getWalletAuth(params: operations.IWalletSignParams) {
return this.sdk.runOperation(() =>
operations.getWalletSign(this.sdk, params),
operations.getWalletAuth(this.sdk, params),
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app-inheritance/src/operations/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './walletSign';
export * from './walletAuth';
6 changes: 3 additions & 3 deletions packages/app-inheritance/src/operations/recovery/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export const getRecovery = async (sdk: ISDK): Promise<IPlainData> => {
});
// TODO: add vars to parameters
await helper.sendQuery({
encryptedDataPacket: {
encryptedData: {
packet: new Uint8Array([65, 65]),
},
});

var result: any;
let result: any;

for (var i = 0; i < 5; i++) {
for (let i = 0; i < 5; i += 1) {
result.plainData[i] = await helper.waitForResult();
logger.verbose('RecoveryResponse', result.plainData[i]);
console.log(JSON.stringify(result.plainData[i]));
Expand Down
15 changes: 10 additions & 5 deletions packages/app-inheritance/src/operations/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ISDK } from '@cypherock/sdk-core';
import { createLoggerWithPrefix, hexToUint8Array } from '@cypherock/sdk-utils';
import { APP_VERSION } from '../../constants/appId';
import {
IEncryptedDataPacket,
IWalletAuthResultResponse,
IEncryptedData,
// IWalletAuthResultResponse,
} from '../../proto/generated/types';
import {
assertOrThrowInvalidResult,
Expand All @@ -13,7 +13,7 @@ import {

const logger = createLoggerWithPrefix(rootLogger, 'SetupRequest');

export const getSetup = async (sdk: ISDK): Promise<IEncryptedDataPacket> => {
export const getSetup = async (sdk: ISDK): Promise<IEncryptedData> => {
logger.info('Started');

await sdk.checkAppCompatibility(APP_VERSION);
Expand All @@ -28,35 +28,40 @@ export const getSetup = async (sdk: ISDK): Promise<IEncryptedDataPacket> => {
plainData: [
{
message: hexToUint8Array('Shortest'),
isPrivate: false,
},
{
message: hexToUint8Array(
'This is a slightly longer message to test the 50 characters length requirement.',
),
isPrivate: false,
},
{
message: hexToUint8Array(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
),
isPrivate: false,
},
{
message: hexToUint8Array(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
),
isPrivate: false,
},
{
message: hexToUint8Array(
"Embarking on a journey to write a 900-character piece necessitates precision and clarity, ensuring each word contributes to the overall message. Begin by defining the central theme or purpose, whether it's to inform, persuade, or entertain. Structure is crucial: start with an engaging introduction to hook the reader, followed by the main content divided into concise paragraphs, and conclude with a memorable closing statement. Use active voice and vary sentence lengths to maintain reader interest. Edit ruthlessly to eliminate redundant words and ensure each sentence flows seamlessly into the next. Pay attention to grammar and punctuation, as these details enhance readability and professionalism. Finally, read the piece aloud to catch any awkward phrasing or overlooked errors, ensuring the final draft is polished and impactful. This approach not only adheres to the character limit of msgs.",
),
isPrivate: false,
},
],
});

const result = await helper.waitForResult();
logger.verbose('SetupResponse', result);
console.log(JSON.stringify(result));
assertOrThrowInvalidResult(result.encryptedDataPacket?.packet);
assertOrThrowInvalidResult(result.encryptedData?.packet);

logger.info('Completed');
return result.encryptedDataPacket;
return result.encryptedData;
};
2 changes: 1 addition & 1 deletion packages/app-inheritance/src/operations/types.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './walletSign/types';
export * from './walletAuth/types';
20 changes: 6 additions & 14 deletions packages/app-inheritance/src/operations/walletAuth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import {
OperationHelper,
logger as rootLogger,
} from '../../utils';
import { IWalletSignParams } from './types';

export * from './types';

const logger = createLoggerWithPrefix(rootLogger, 'walletAuthRequest');

export const getWalletAuth = async (
sdk: ISDK,
params: IWalletSignParams,
): Promise<IWalletAuthResultResponse> => {
logger.info('Started');

Expand All @@ -22,21 +26,9 @@ export const getWalletAuth = async (
queryKey: 'walletAuth',
resultKey: 'walletAuth',
});
// TODO: add vars to parameters

await helper.sendQuery({
initiate: {
challenge: new Uint8Array([
144, 213, 122, 213, 228, 193, 104, 222, 201, 19, 75, 27, 117, 55, 36,
46, 163, 239, 183, 51, 61, 251, 171, 30, 87, 72, 90, 53, 41, 121, 48,
132,
]),
walletId: new Uint8Array([
144, 213, 122, 213, 228, 193, 104, 222, 201, 19, 75, 27, 117, 55, 36,
46, 87, 72, 90, 53, 41, 121, 48, 132, 163, 239, 183, 51, 61, 251, 171,
30,
]),
isPublickey: false,
},
initiate: params,
});

const result = await helper.waitForResult();
Expand Down
41 changes: 0 additions & 41 deletions packages/app-inheritance/src/operations/walletSign/index.ts

This file was deleted.

0 comments on commit 19b08fa

Please sign in to comment.