diff --git a/fabcar/javascript/enrollAdmin.js b/fabcar/javascript/enrollAdmin.js index 788227ea8a..72c7f6e6e6 100644 --- a/fabcar/javascript/enrollAdmin.js +++ b/fabcar/javascript/enrollAdmin.js @@ -35,7 +35,7 @@ async function main() { // Enroll the admin user, and import the new identity into the wallet. const enrollment = await ca.enroll({ enrollmentID: 'admin', enrollmentSecret: 'adminpw' }); const identity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes()); - wallet.import('admin', identity); + await wallet.import('admin', identity); console.log('Successfully enrolled admin user "admin" and imported it into the wallet'); } catch (error) { diff --git a/fabcar/javascript/registerUser.js b/fabcar/javascript/registerUser.js index a65edd37bf..21af6f1314 100644 --- a/fabcar/javascript/registerUser.js +++ b/fabcar/javascript/registerUser.js @@ -47,7 +47,7 @@ async function main() { const secret = await ca.register({ affiliation: 'org1.department1', enrollmentID: 'user1', role: 'client' }, adminIdentity); const enrollment = await ca.enroll({ enrollmentID: 'user1', enrollmentSecret: secret }); const userIdentity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes()); - wallet.import('user1', userIdentity); + await wallet.import('user1', userIdentity); console.log('Successfully registered and enrolled admin user "user1" and imported it into the wallet'); } catch (error) { diff --git a/fabcar/typescript/src/enrollAdmin.ts b/fabcar/typescript/src/enrollAdmin.ts index 226f76b780..630d751f36 100644 --- a/fabcar/typescript/src/enrollAdmin.ts +++ b/fabcar/typescript/src/enrollAdmin.ts @@ -33,7 +33,7 @@ async function main() { // Enroll the admin user, and import the new identity into the wallet. const enrollment = await ca.enroll({ enrollmentID: 'admin', enrollmentSecret: 'adminpw' }); const identity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes()); - wallet.import('admin', identity); + await wallet.import('admin', identity); console.log('Successfully enrolled admin user "admin" and imported it into the wallet'); } catch (error) { diff --git a/fabcar/typescript/src/registerUser.ts b/fabcar/typescript/src/registerUser.ts index 5f699c1fcb..1eb4a367fd 100644 --- a/fabcar/typescript/src/registerUser.ts +++ b/fabcar/typescript/src/registerUser.ts @@ -45,7 +45,7 @@ async function main() { const secret = await ca.register({ affiliation: 'org1.department1', enrollmentID: 'user1', role: 'client' }, adminIdentity); const enrollment = await ca.enroll({ enrollmentID: 'user1', enrollmentSecret: secret }); const userIdentity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes()); - wallet.import('user1', userIdentity); + await wallet.import('user1', userIdentity); console.log('Successfully registered and enrolled admin user "user1" and imported it into the wallet'); } catch (error) {