Skip to content

Commit

Permalink
fix(connector-quorum): transaction with different credentials hyperle…
Browse files Browse the repository at this point in the history
…dger-cacti#1098

Signed-off-by: AzaharaC <a.castano.benito@accenture.com>
  • Loading branch information
AzaharaC committed Nov 3, 2021
1 parent 09ace15 commit 57b617d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,19 @@ export class PluginLedgerConnectorQuorum
// the private key that we need to run the transaction.
const privateKeyHex = await keychainPlugin?.get(keychainEntryKey as string);

if (!transactionConfig.gas) {
this.log.debug(
`${fnTag} Gas not specified in the transaction values. Using the estimate from web3`,
);
transactionConfig.gas = await this.web3.eth.estimateGas(
transactionConfig,
);
this.log.debug(
`${fnTag} Gas estimated from web3 is: `,
transactionConfig.gas,
);
}

return this.transactPrivateKey({
transactionConfig,
web3SigningCredential: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ test(testCase, async (t: Test) => {
invocationType: EthContractInvocationType.Call,
methodName: "getName",
params: [],
gas: 1000000,
// gas: 1000000,
web3SigningCredential: {
ethAccount: testEthAccount.address,
secret: testEthAccount.privateKey,
Expand All @@ -345,7 +345,7 @@ test(testCase, async (t: Test) => {
invocationType: EthContractInvocationType.Send,
methodName: "getName",
params: [],
gas: 1000000,
//gas: 1000000,
web3SigningCredential: {
ethAccount: testEthAccount.address,
secret: testEthAccount.privateKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ test(testCase, async (t: Test) => {
invocationType: EthContractInvocationType.Send,
methodName: "setName",
params: [newName],
gas: 1000000,
// gas: 1000000,
web3SigningCredential: {
ethAccount: testEthAccount.address,
secret: testEthAccount.privateKey,
Expand All @@ -323,7 +323,7 @@ test(testCase, async (t: Test) => {
invocationType: EthContractInvocationType.Call,
methodName: "getName",
params: [],
gas: 1000000,
// gas: 1000000,
web3SigningCredential: {
ethAccount: testEthAccount.address,
secret: testEthAccount.privateKey,
Expand Down

0 comments on commit 57b617d

Please sign in to comment.