mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-10 05:58:01 -05:00
Sprint 22 23 24 changes bug fix (#1356)
* [INJIMOB-878]: replace all references of VC to VCMeta Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-878]: remove credential logging Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> --------- Signed-off-by: Alka Prasad <prasadalka1998@gmail.com>
This commit is contained in:
@@ -21,10 +21,11 @@ import {
|
||||
sendErrorEvent,
|
||||
getErrorEventData,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {WalletBindingResponse} from '../VCMetaMachine/vc';
|
||||
|
||||
import {ActivityLogEvents} from '../../activityLog';
|
||||
import {BackupEvents} from '../../backupAndRestore/backup';
|
||||
import {VcMetaEvents} from '../VCMetaMachine/VCMetaMachine';
|
||||
import {WalletBindingResponse} from '../VCMetaMachine/vc';
|
||||
|
||||
export const VCItemActions = model => {
|
||||
return {
|
||||
@@ -43,7 +44,7 @@ export const VCItemActions = model => {
|
||||
vcMetadata: context.vcMetadata,
|
||||
}),
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
requestStoredContext: send(
|
||||
@@ -94,7 +95,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
removeVcMetaDataFromStorage: send(
|
||||
@@ -116,7 +117,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
sendDownloadLimitExpire: send(
|
||||
@@ -127,7 +128,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
|
||||
@@ -140,7 +141,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
refreshAllVcs: send(
|
||||
@@ -148,7 +149,7 @@ export const VCItemActions = model => {
|
||||
type: 'REFRESH_MY_VCS',
|
||||
}),
|
||||
{
|
||||
to: (context: any) => context.serviceRefs.vc,
|
||||
to: (context: any) => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
|
||||
@@ -166,13 +167,13 @@ export const VCItemActions = model => {
|
||||
sendVcUpdated: send(
|
||||
(context: any) => VcMetaEvents.VC_METADATA_UPDATED(context.vcMetadata),
|
||||
{
|
||||
to: (context: any) => context.serviceRefs.vc,
|
||||
to: (context: any) => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
sendTamperedVc: send(
|
||||
(context: any) => VcMetaEvents.TAMPERED_VC(context.vcMetadata),
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
setErrorAsWalletBindingError: assign({
|
||||
@@ -196,7 +197,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: (context: any) => context.serviceRefs.vc,
|
||||
to: (context: any) => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
setWalletBindingResponse: assign({
|
||||
@@ -340,7 +341,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
|
||||
@@ -352,7 +353,7 @@ export const VCItemActions = model => {
|
||||
};
|
||||
},
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
sendTelemetryEvents: () => {
|
||||
|
||||
@@ -78,13 +78,13 @@ export const vcMetaMachine =
|
||||
context: model.initialContext,
|
||||
events: {} as EventFrom<typeof model>,
|
||||
},
|
||||
id: 'vc',
|
||||
id: 'vcMeta',
|
||||
initial: 'init',
|
||||
states: {
|
||||
init: {
|
||||
on: {
|
||||
REFRESH_MY_VCS: {
|
||||
target: '#vc.ready.myVcs.refreshing',
|
||||
target: '#vcMeta.ready.myVcs.refreshing',
|
||||
},
|
||||
},
|
||||
initial: 'myVcs',
|
||||
@@ -103,7 +103,7 @@ export const vcMetaMachine =
|
||||
on: {
|
||||
STORE_RESPONSE: {
|
||||
actions: 'setReceivedVcs',
|
||||
target: '#vc.ready',
|
||||
target: '#vcMeta.ready',
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -183,7 +183,7 @@ export const vcMetaMachine =
|
||||
actions: 'resetWalletBindingSuccess',
|
||||
},
|
||||
REFRESH_RECEIVED_VCS: {
|
||||
target: '#vc.ready.receivedVcs.refreshing',
|
||||
target: '#vcMeta.ready.receivedVcs.refreshing',
|
||||
},
|
||||
TAMPERED_VC: {
|
||||
actions: 'setTamperedVcs',
|
||||
@@ -194,7 +194,7 @@ export const vcMetaMachine =
|
||||
'removeVcFromInProgressDownlods',
|
||||
'setDownloadingFailedVcs',
|
||||
],
|
||||
target: '#vc.ready.myVcs.refreshing',
|
||||
target: '#vcMeta.ready.myVcs.refreshing',
|
||||
},
|
||||
DELETE_VC: {
|
||||
target: 'deletingFailedVcs',
|
||||
@@ -204,7 +204,7 @@ export const vcMetaMachine =
|
||||
'removeVcFromInProgressDownlods',
|
||||
'setVerificationErrorMessage',
|
||||
],
|
||||
target: '#vc.ready.myVcs.refreshing',
|
||||
target: '#vcMeta.ready.myVcs.refreshing',
|
||||
},
|
||||
RESET_VERIFY_ERROR: {
|
||||
actions: 'resetVerificationErrorMessage',
|
||||
@@ -239,7 +239,7 @@ export const vcMetaMachine =
|
||||
entry: ['logTamperedVCsremoved', send('REFRESH_VCS_METADATA')],
|
||||
on: {
|
||||
REFRESH_VCS_METADATA: {
|
||||
target: '#vc.init',
|
||||
target: '#vcMeta.init',
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -253,7 +253,7 @@ export const vcMetaMachine =
|
||||
'removeDownloadingFailedVcsFromMyVcs',
|
||||
'resetDownloadFailedVcs',
|
||||
],
|
||||
target: '#vc.ready.myVcs.refreshing',
|
||||
target: '#vcMeta.ready.myVcs.refreshing',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -195,7 +195,7 @@ export const MyVcsTabMachine = model.createMachine(
|
||||
(_context, event) =>
|
||||
VcMetaEvents.VC_ADDED(event.response as VCMetadata),
|
||||
{
|
||||
to: context => context.serviceRefs.vc,
|
||||
to: context => context.serviceRefs.vcMeta,
|
||||
},
|
||||
),
|
||||
},
|
||||
|
||||
@@ -86,9 +86,6 @@ function handleResponse(
|
||||
errorMessage = VerificationErrorType.TECHNICAL_ERROR;
|
||||
isVerifiedFlag = false;
|
||||
|
||||
console.log('Verification: ', result['results'][0]);
|
||||
console.log('Verifiable Credential: ', verifiableCredential);
|
||||
|
||||
if (errorCodeName == 'jsonld.InvalidUrl') {
|
||||
errorMessage = VerificationErrorType.NETWORK_ERROR;
|
||||
} else if (errorCodeName == VerificationErrorType.RANGE_ERROR) {
|
||||
|
||||
Reference in New Issue
Block a user