Skip to content

Commit

Permalink
feat(connector-besu): request param: wait for ledger tx receipt hyper…
Browse files Browse the repository at this point in the history
…ledger-cacti#685

This is work in progress
-----------------------------------

Fixes hyperledger-cacti#685

Signed-off-by: Peter Somogyvari <[email protected]>
  • Loading branch information
petermetz committed Mar 19, 2021
1 parent 932d5a4 commit b54b4f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,18 @@ export class PluginLedgerConnectorBesu
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#transactSigned()`;

this.log.debug("Starting web3.eth.sendSignedTransaction(rawTransaction) ");
const receipt = await this.web3.eth.sendSignedTransaction(rawTransaction);
this.log.debug("Received preliminary receipt from Besu node.");

if (receipt instanceof Error) {
this.log.debug(`${fnTag} Web3 sendSignedTransaction failed`, receipt);
throw receipt;
} else {
return { transactionReceipt: receipt };
this.log.debug("Starting poll for ledger TX receipt ...");
const theReceipt = await this.pollForTxReceipt(receipt.transactionHash);
this.log.debug("Finished poll for ledger TX receipt: %o", theReceipt);
return { transactionReceipt: theReceipt };
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ test("deploys contract via .json file", async (t: Test) => {
});
const connector: PluginLedgerConnectorBesu = await factory.create({
rpcApiHttpHost,
logLevel,
instanceId: uuidv4(),
pluginRegistry: new PluginRegistry({ plugins: [keychainPlugin] }),
});
Expand Down

0 comments on commit b54b4f8

Please sign in to comment.