Skip to content

Commit

Permalink
FABN-920 TS defs for Gateway connect/disconnect
Browse files Browse the repository at this point in the history
Change the method names initialize / dispose to connect / disconnect
in the typescript definition of the Gateway class

Change-Id: I9ef71fd3b775dc5ab26855fc78eddcd9defdfb63
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
  • Loading branch information
andrew-coleman committed Sep 14, 2018
1 parent 8d6e09f commit 97cbb10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fabric-network/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ export enum DefaultEventHandlerStrategies {

export class Gateway {
constructor();
initialize(ccp: string | Client, options?: InitOptions): Promise<void>;
connect(ccp: string | Client, options?: InitOptions): Promise<void>;
getCurrentIdentity(): User;
getClient(): Client;
getOptions(): InitOptions;
getNetwork(channelName: string): Promise<Network>;
dispose(): void;
disconnect(): void;
}

export class Network {
Expand Down
8 changes: 4 additions & 4 deletions test/typescript/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import {
};


await gateway.initialize('accp', initOpt1);
await gateway.connect('accp', initOpt1);

const gateway2: Gateway = new Gateway();
const client: Client = new Client();
Expand All @@ -83,7 +83,7 @@ import {
identity: 'anod'
};

await gateway.initialize(client, opt2);
await gateway2.connect(client, opt2);


const network: Network = await gateway.getNetwork('a channel');
Expand All @@ -102,8 +102,8 @@ import {
const deleteDone: Promise<void> = inMemoryWallet.delete('User1@org1.example.com')
await deleteDone;
await fileSystemWallet.delete('User1@org1.example.com');
gateway.dispose();
gateway2.dispose();
gateway.disconnect();
gateway2.disconnect();

})();

Expand Down

0 comments on commit 97cbb10

Please sign in to comment.