Skip to content

Commit

Permalink
fix(connector-quorum): transaction with different credentials #1098
Browse files Browse the repository at this point in the history
Signed-off-by: AzaharaC <[email protected]>
  • Loading branch information
AzaharaC authored and petermetz committed Nov 5, 2021
1 parent 9022064 commit af6c240
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 af6c240

Please sign in to comment.