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

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kratico committed Dec 22, 2022
1 parent 1a956c5 commit 8b11595
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
16 changes: 7 additions & 9 deletions examples/smart_contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,14 @@ const tx = C.contracts.instantiate(client)({
salt,
sender: T.alice.address,
}).signed(T.alice.sign)
const finalizedIn = tx.watch(({ end }) =>
(status) => {
if (typeof status !== "string" && (status.inBlock ?? status.finalized)) {
return end(status.inBlock ?? status.finalized)
} else if (C.rpc.known.TransactionStatus.isTerminal(status)) {
return end(new Error())
}
return
const finalizedIn = tx.watch(({ end }) => (status) => {
if (typeof status !== "string" && (status.inBlock ?? status.finalized)) {
return end(status.inBlock ?? status.finalized)
} else if (C.rpc.known.TransactionStatus.isTerminal(status)) {
return end(new Error())
}
)
return
})
const contractAddress = U.throwIfError(
await C
.events(tx, finalizedIn)
Expand Down
16 changes: 7 additions & 9 deletions fluent/Contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ export class Contract<Client extends Z.Effect<rpc.Client>> {
...this.#basePayload(props.sender, props.messageLabel, props.args),
value: props.value,
}).signed(props.sign)
const finalizedIn = tx.watch(({ end }) =>
(status) => {
if (typeof status !== "string" && (status.inBlock ?? status.finalized)) {
return end(status.inBlock ?? status.finalized)
} else if (rpc.known.TransactionStatus.isTerminal(status)) {
return end(new Error())
}
return
const finalizedIn = tx.watch(({ end }) => (status) => {
if (typeof status !== "string" && (status.inBlock ?? status.finalized)) {
return end(status.inBlock ?? status.finalized)
} else if (rpc.known.TransactionStatus.isTerminal(status)) {
return end(new Error())
}
)
return
})
const events_ = events(tx, finalizedIn)
const contractEvents = contracts.events(this.contractMetadata, events_)
return Z.ls(finalizedIn, events_, contractEvents)
Expand Down

0 comments on commit 8b11595

Please sign in to comment.