Skip to content

Commit

Permalink
fix: fixes 1445 and implementing correct interface types
Browse files Browse the repository at this point in the history
For all the connector class definitions the implementation are fixed to
follow their interface definition and to match in consistent way for all
the connectors

Closes: hyperledger-cacti#1445
Signed-off-by: Michael Courtin <michael.courtin@accenture.com>
  • Loading branch information
m-courtin authored and RafaelAPB committed Nov 19, 2021
1 parent 8775199 commit 8bda139
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ export class PluginLedgerConnectorBesu

public async deployContract(
req: DeployContractSolidityBytecodeV1Request,
): Promise<RunTransactionResponse> {
): Promise<DeployContractSolidityBytecodeV1Response> {
const fnTag = `${this.className}#deployContract()`;
Checks.truthy(req, `${fnTag} req`);
if (isWeb3SigningCredentialNone(req.web3SigningCredential)) {
Expand Down Expand Up @@ -827,7 +827,13 @@ export class PluginLedgerConnectorBesu
`${fnTag} Cannot create an instance of the contract because the contractName and the contractName on the keychain does not match`,
);
}
return runTxResponse;

// creating solidity byte code response
const deployResponse: DeployContractSolidityBytecodeV1Response = {
transactionReceipt: runTxResponse.transactionReceipt,
};

return deployResponse;
}
throw new Error(
`${fnTag} Cannot deploy contract without keychainId and the contractName`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ export class PluginLedgerConnectorXdai

public async deployContract(
req: DeployContractV1Request,
): Promise<RunTransactionV1Response> {
): Promise<DeployContractV1Response> {
const fnTag = `${this.className}#deployContract()`;
Checks.truthy(req, `${fnTag} req`);
if (isWeb3SigningCredentialNone(req.web3SigningCredential)) {
Expand Down Expand Up @@ -592,7 +592,13 @@ export class PluginLedgerConnectorXdai
await keychainPlugin.set(contractName, JSON.stringify(contractPojo));
}
}
return runTxResponse;

// creating contract response
const deployResponse: DeployContractV1Response = {
transactionReceipt: runTxResponse.transactionReceipt,
};

return deployResponse;
}
throw new Error(
`${fnTag} Cannot deploy contract without keychainId and the contractName`,
Expand Down

0 comments on commit 8bda139

Please sign in to comment.