Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from celo-org/nambrot/useTxResult
Browse files Browse the repository at this point in the history
Use ContractKit's toTxResult
  • Loading branch information
nambrot committed Aug 21, 2019
2 parents c18da38 + a9be726 commit e46db1c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions savingscircle.ts
Expand Up @@ -7,7 +7,7 @@ import BigNumber from "bignumber.js";
import { requestTxSig, GasCurrency, waitForSignedTxs } from "@celo/dappkit";
import { Linking } from "expo";
import { zipObject } from "lodash";
import { request } from "http";
import { toTxResult } from "@celo/contractkit/lib/utils/tx-result";
import { CeloContract } from "@celo/contractkit";

const INITIAL_STATE = {
Expand Down Expand Up @@ -252,13 +252,7 @@ export function* makeAddCircleTxSaga(action: AddCircle) {
}

async function sendTx(tx: string) {
return new Promise((resolve, reject) => {
web3.eth
.sendSignedTransaction(tx)
.on("confirmation", resolve)
.on("error", reject)
.catch(reject);
});
return toTxResult(web3.eth.sendSignedTransaction(tx)).waitReceipt()
}

export function* sendAddCircleTxSaga(action: SendAddCircleTx) {
Expand Down

0 comments on commit e46db1c

Please sign in to comment.