From d2efd90206f953e277f137e379d1f297631c8985 Mon Sep 17 00:00:00 2001 From: josemarinas <36479864+josemarinas@users.noreply.github.com> Date: Mon, 23 Oct 2023 09:47:11 +0200 Subject: [PATCH] fix gas feee estimations (#292) --- modules/client/CHANGELOG.md | 6 ++++++ modules/client/package.json | 2 +- .../src/addresslistVoting/internal/client/estimation.ts | 6 +++--- modules/client/src/multisig/internal/client/estimation.ts | 6 +++--- .../client/src/tokenVoting/internal/client/estimation.ts | 8 ++++---- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/client/CHANGELOG.md b/modules/client/CHANGELOG.md index 172ef6d9c..578daf5bd 100644 --- a/modules/client/CHANGELOG.md +++ b/modules/client/CHANGELOG.md @@ -18,6 +18,12 @@ TEMPLATE: --> ## [UPCOMING] + +### Fixed + +- Estimations using `getProvider` instead of `getConnectedSigner` in functions where the identity of the wallet is needed + +## [1.16.0] ### Added - Helper for `daoUpdateAction` in `Client` diff --git a/modules/client/package.json b/modules/client/package.json index 35d113da2..dc00a491b 100644 --- a/modules/client/package.json +++ b/modules/client/package.json @@ -1,7 +1,7 @@ { "name": "@aragon/sdk-client", "author": "Aragon Association", - "version": "1.16.0", + "version": "1.16.1", "license": "MIT", "main": "dist/index.js", "module": "dist/sdk-client.esm.js", diff --git a/modules/client/src/addresslistVoting/internal/client/estimation.ts b/modules/client/src/addresslistVoting/internal/client/estimation.ts index b0f7899c9..975a1b71e 100644 --- a/modules/client/src/addresslistVoting/internal/client/estimation.ts +++ b/modules/client/src/addresslistVoting/internal/client/estimation.ts @@ -30,7 +30,7 @@ export class AddresslistVotingClientEstimation extends ClientCore public async createProposal( params: CreateMajorityVotingProposalParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const addresslistContract = AddresslistVoting__factory.connect( params.pluginAddress, @@ -71,7 +71,7 @@ export class AddresslistVotingClientEstimation extends ClientCore public async voteProposal( params: VoteProposalParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const { pluginAddress, id } = decodeProposalId( params.proposalId, @@ -100,7 +100,7 @@ export class AddresslistVotingClientEstimation extends ClientCore public async executeProposal( proposalId: string, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const { pluginAddress, id } = decodeProposalId( proposalId, diff --git a/modules/client/src/multisig/internal/client/estimation.ts b/modules/client/src/multisig/internal/client/estimation.ts index ec3289dc4..bd2ea6f66 100644 --- a/modules/client/src/multisig/internal/client/estimation.ts +++ b/modules/client/src/multisig/internal/client/estimation.ts @@ -29,7 +29,7 @@ export class MultisigClientEstimation extends ClientCore public async createProposal( params: CreateMultisigProposalParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const multisigContract = Multisig__factory.connect( params.pluginAddress, @@ -69,7 +69,7 @@ export class MultisigClientEstimation extends ClientCore public async approveProposal( params: ApproveMultisigProposalParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const { pluginAddress, id } = decodeProposalId( params.proposalId, ); @@ -95,7 +95,7 @@ export class MultisigClientEstimation extends ClientCore public async executeProposal( proposalId: string, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const { pluginAddress, id } = decodeProposalId( proposalId, diff --git a/modules/client/src/tokenVoting/internal/client/estimation.ts b/modules/client/src/tokenVoting/internal/client/estimation.ts index 3230fd4e6..38e5319c4 100644 --- a/modules/client/src/tokenVoting/internal/client/estimation.ts +++ b/modules/client/src/tokenVoting/internal/client/estimation.ts @@ -35,7 +35,7 @@ export class TokenVotingClientEstimation extends ClientCore public async createProposal( params: CreateMajorityVotingProposalParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const tokenVotingContract = TokenVoting__factory.connect( params.pluginAddress, @@ -75,7 +75,7 @@ export class TokenVotingClientEstimation extends ClientCore public async voteProposal( params: VoteProposalParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const { pluginAddress, id } = decodeProposalId( params.proposalId, @@ -104,7 +104,7 @@ export class TokenVotingClientEstimation extends ClientCore public async executeProposal( proposalId: string, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const { pluginAddress, id } = decodeProposalId( proposalId, @@ -130,7 +130,7 @@ export class TokenVotingClientEstimation extends ClientCore public async delegateTokens( params: DelegateTokensParams, ): Promise { - const provider = this.web3.getProvider(); + const provider = this.web3.getConnectedSigner(); const governanceErc20Contract = GovernanceERC20__factory.connect( params.tokenAddress, provider,