Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
respond to matias feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
harrysolovay committed Nov 7, 2022
1 parent 20bb703 commit f38b663
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
13 changes: 7 additions & 6 deletions examples/batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ const recipients = [T.bob, T.charlie, T.dave, T.eve];

const env = C.Z.env();

// const getBalances = C.Z.ls(
// ...recipients.map(({ publicKey }) => {
// return C.entryRead(T.westend)("System", "Account", [publicKey])
// .access("value").access("data").access("free");
// }),
// ).bind(env);
const getBalances = C.Z.ls(
...recipients.map(({ publicKey }) => {
return C.entryRead(T.westend)("System", "Account", [publicKey])
.access("value").access("data").access("free");
}),
).bind(env);

const runTx = C.extrinsic({
client: T.westend,
Expand Down Expand Up @@ -47,6 +47,7 @@ const runTx = C.extrinsic({
})
.bind(env);

// TODO: uncomment these lines upon solving `count` in zones
// console.log(U.throwIfError(await getBalances()));
U.throwIfError(await runTx());
// console.log(U.throwIfError(await getBalances()));
16 changes: 9 additions & 7 deletions examples/raw_rpc_client_subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ const subscriptionId = await client.subscribe({
counter.inc();
});

const unsubscribed = await client.call({
jsonrpc: "2.0",
id: client.providerRef.nextId(),
method: "chain_unsubscribeAllHeads",
params: [subscriptionId],
});
const { result } = U.throwIfError(
await client.call({
jsonrpc: "2.0",
id: client.providerRef.nextId(),
method: "chain_unsubscribeAllHeads",
params: [subscriptionId],
}),
);

console.log(
// cspell:disable-next-line
`${unsubscribed ? "S" : "Uns"}uccessfully unsubscribed from subscription ${subscriptionId}`,
`${result ? "S" : "Uns"}uccessfully unsubscribed from subscription ${subscriptionId}`,
);

await client.discard();

0 comments on commit f38b663

Please sign in to comment.