Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit b739b00

Browse files
authored
Merge pull request #14 from casper-ecosystem/fix/event-stream-changes
event stream related fixes
2 parents 96280d7 + 8bcc819 commit b739b00

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.env
1+
.env*
22
dist/
33
node_modules/

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "casper-cep47-js-client",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
"typescript": "^3.3.3"
2424
},
2525
"dependencies": {
26-
"casper-js-sdk": "2.4.0",
26+
"casper-js-sdk": "2.4.1",
2727
"ts-results": "^3.3.0"
2828
}
2929
}

src/cep47-client.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ class CEP47Client {
506506
});
507507

508508
if (deployHash !== null) {
509-
return deployHash;
510509
this.addPendingDeploy(CEP47Events.TransferToken, deployHash);
510+
return deployHash;
511511
} else {
512512
throw Error("Invalid Deploy");
513513
}
@@ -544,7 +544,11 @@ class CEP47Client {
544544
eventNames: CEP47Events[],
545545
callback: (
546546
eventName: CEP47Events,
547-
deployStatus: { deployHash: string; success: boolean, error: string | null },
547+
deployStatus: {
548+
deployHash: string;
549+
success: boolean;
550+
error: string | null;
551+
},
548552
result: any | null
549553
) => void
550554
): any {
@@ -579,8 +583,7 @@ class CEP47Client {
579583
{
580584
deployHash,
581585
error:
582-
value.body.DeployProcessed.execution_result.Failure.effect
583-
.error_message,
586+
value.body.DeployProcessed.execution_result.Failure.error_message,
584587
success: false,
585588
},
586589
null
@@ -618,7 +621,11 @@ class CEP47Client {
618621
}, []);
619622

620623
cep47Events.forEach((d: any) =>
621-
callback(d.name, { deployHash, error: null, success: true }, d.clValue)
624+
callback(
625+
d.name,
626+
{ deployHash, error: null, success: true },
627+
d.clValue
628+
)
622629
);
623630
}
624631

test/install.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ const test = async () => {
4545
);
4646

4747
const installDeployHash = await cep47.install(
48-
KEYS, TOKEN_NAME!, TOKEN_SYMBOL!, TOKEN_META!, INSTALL_PAYMENT_AMOUNT!, WASM_PATH!);
48+
KEYS,
49+
TOKEN_NAME!,
50+
TOKEN_SYMBOL!,
51+
TOKEN_META!,
52+
INSTALL_PAYMENT_AMOUNT!,
53+
WASM_PATH!
54+
);
4955

5056
console.log(`... Contract installation deployHash: ${installDeployHash}`);
5157

@@ -58,7 +64,10 @@ const test = async () => {
5864
console.log(`... Account Info: `);
5965
console.log(JSON.stringify(accountInfo, null, 2));
6066

61-
const contractHash = await utils.getAccountNamedKeyValue(accountInfo, `${TOKEN_NAME!}_contract`);
67+
const contractHash = await utils.getAccountNamedKeyValue(
68+
accountInfo,
69+
`${TOKEN_NAME!}_contract`
70+
);
6271

6372
console.log(`... Contract Hash: ${contractHash}`);
6473
};

test/installed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const test = async () => {
135135
KEYS,
136136
KEYS.publicKey,
137137
new Map([["name", "copied"]]),
138-
["A1", "A2", "A3", "A4", "A5"],
138+
["A6", "A7", "A8", "A9", "A10"],
139139
5,
140140
MINT_COPIES_PAYMENT_AMOUNT!
141141
);

0 commit comments

Comments
 (0)