Skip to content

Commit

Permalink
fix gas feee estimations (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Oct 23, 2023
1 parent 697caff commit d2efd90
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion modules/client/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class AddresslistVotingClientEstimation extends ClientCore
public async createProposal(
params: CreateMajorityVotingProposalParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const addresslistContract = AddresslistVoting__factory.connect(
params.pluginAddress,
Expand Down Expand Up @@ -71,7 +71,7 @@ export class AddresslistVotingClientEstimation extends ClientCore
public async voteProposal(
params: VoteProposalParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const { pluginAddress, id } = decodeProposalId(
params.proposalId,
Expand Down Expand Up @@ -100,7 +100,7 @@ export class AddresslistVotingClientEstimation extends ClientCore
public async executeProposal(
proposalId: string,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const { pluginAddress, id } = decodeProposalId(
proposalId,
Expand Down
6 changes: 3 additions & 3 deletions modules/client/src/multisig/internal/client/estimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class MultisigClientEstimation extends ClientCore
public async createProposal(
params: CreateMultisigProposalParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const multisigContract = Multisig__factory.connect(
params.pluginAddress,
Expand Down Expand Up @@ -69,7 +69,7 @@ export class MultisigClientEstimation extends ClientCore
public async approveProposal(
params: ApproveMultisigProposalParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();
const { pluginAddress, id } = decodeProposalId(
params.proposalId,
);
Expand All @@ -95,7 +95,7 @@ export class MultisigClientEstimation extends ClientCore
public async executeProposal(
proposalId: string,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const { pluginAddress, id } = decodeProposalId(
proposalId,
Expand Down
8 changes: 4 additions & 4 deletions modules/client/src/tokenVoting/internal/client/estimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class TokenVotingClientEstimation extends ClientCore
public async createProposal(
params: CreateMajorityVotingProposalParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const tokenVotingContract = TokenVoting__factory.connect(
params.pluginAddress,
Expand Down Expand Up @@ -75,7 +75,7 @@ export class TokenVotingClientEstimation extends ClientCore
public async voteProposal(
params: VoteProposalParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const { pluginAddress, id } = decodeProposalId(
params.proposalId,
Expand Down Expand Up @@ -104,7 +104,7 @@ export class TokenVotingClientEstimation extends ClientCore
public async executeProposal(
proposalId: string,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();

const { pluginAddress, id } = decodeProposalId(
proposalId,
Expand All @@ -130,7 +130,7 @@ export class TokenVotingClientEstimation extends ClientCore
public async delegateTokens(
params: DelegateTokensParams,
): Promise<GasFeeEstimation> {
const provider = this.web3.getProvider();
const provider = this.web3.getConnectedSigner();
const governanceErc20Contract = GovernanceERC20__factory.connect(
params.tokenAddress,
provider,
Expand Down

0 comments on commit d2efd90

Please sign in to comment.