-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add to test list for main test - update tests for changes made - modify network tests to only create wallet once Change-Id: I19224a1584c0ad4e4cccbb33e98f0f709e4d16ae Signed-off-by: [email protected] <[email protected]>
- Loading branch information
Showing
6 changed files
with
61 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,13 +61,18 @@ async function getFirstEventHubForOrg(gateway, orgMSP) { | |
return channel.getChannelEventHub(orgPeer.getName()); | ||
} | ||
|
||
test('\n\n***** Network End-to-end flow: import identity into wallet *****\n\n', async (t) => { | ||
await inMemoryIdentitySetup(); | ||
const exists = await inMemoryWallet.exists('[email protected]'); | ||
if (exists) { | ||
t.pass('Successfully imported [email protected] into wallet'); | ||
} else { | ||
t.fail('Failed to import [email protected] into wallet'); | ||
test('\n\n***** Network End-to-end flow: import identity into wallet and configure tls *****\n\n', async (t) => { | ||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
const exists = await inMemoryWallet.exists('[email protected]'); | ||
if (exists) { | ||
t.pass('Successfully imported [email protected] into wallet'); | ||
} else { | ||
t.fail('Failed to import [email protected] into wallet'); | ||
} | ||
} catch (err) { | ||
t.fail('Failed to import identity into wallet and configure tls. ' + err.stack ? err.stack : err); | ||
} | ||
t.end(); | ||
}); | ||
|
@@ -77,8 +82,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
let org1EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -133,9 +136,6 @@ test('\n\n***** Network End-to-end flow: invoke multiple transactions to move mo | |
let org1EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -213,8 +213,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
let org1EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -269,8 +267,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
const gateway = new Gateway(); | ||
let org1EventHub; | ||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -327,8 +323,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
let org2EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -392,8 +386,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
let org2EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -457,8 +449,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
let org2EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -527,8 +517,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
let org2EventHub; | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -595,8 +583,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
const gateway = new Gateway(); | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -631,8 +617,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction with transient data | |
const gateway = new Gateway(); | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -685,8 +669,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction with empty string re | |
const gateway = new Gateway(); | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
@@ -716,19 +698,17 @@ test('\n\n***** Network End-to-end flow: invoke transaction with empty string re | |
test('\n\n***** Network End-to-end flow: handle transaction error *****\n\n', async (t) => { | ||
const gateway = new Gateway(); | ||
|
||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
try { | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
identity: '[email protected]', | ||
clientTlsIdentity: 'tlsId', | ||
discovery: { | ||
enabled: false | ||
} | ||
}); | ||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
identity: '[email protected]', | ||
clientTlsIdentity: 'tlsId', | ||
discovery: { | ||
enabled: false | ||
} | ||
}); | ||
|
||
try { | ||
const response = await contract.submitTransaction('throwError', 'a', 'b', '100'); | ||
t.fail('Transaction "throwError" should have thrown an error. Got response: ' + response.toString()); | ||
} catch (expectedErr) { | ||
|
@@ -893,8 +873,6 @@ test('\n\n***** Network End-to-end flow: invoke transaction to move money using | |
const gateway = new Gateway(); | ||
|
||
try { | ||
await inMemoryIdentitySetup(); | ||
await tlsSetup(); | ||
|
||
const contract = await createContract(t, gateway, { | ||
wallet: inMemoryWallet, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters