From a71ab4161084f48d2b471a874df2baeb831f8fc6 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 31 Aug 2023 12:52:43 +0300 Subject: [PATCH] fix build --- contracts/src/governance/governor/impls.rs | 11 +++++++---- contracts/src/governance/governor/internal.rs | 7 +++---- contracts/src/governance/utils/votes/impls.rs | 2 +- lang/codegen/src/implementations.rs | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/contracts/src/governance/governor/impls.rs b/contracts/src/governance/governor/impls.rs index 581c17a0e..93e22c784 100644 --- a/contracts/src/governance/governor/impls.rs +++ b/contracts/src/governance/governor/impls.rs @@ -51,7 +51,10 @@ use ink::{ }, DefaultEnvironment, }, - prelude::vec::Vec, + prelude::{ + vec, + vec::Vec, + }, }; use openbrush::{ modifiers, @@ -295,10 +298,10 @@ pub trait GovernorImpl: let message = (proposal_id.clone(), support.clone(), reason.clone(), Vec::::new()).encode(); if !signature.verify(&message, &Self::env().caller()) { - return Err(GovernanceError::InvalidSignature(Self::env().caller())) + return Err(GovernanceError::InvalidSignature) } - self._cast_vote(proposal_id, Self::env().caller(), support, reason) + self._cast_vote_with_params(proposal_id, Self::env().caller(), support, reason, vec![]) } /// Casts a vote with signature and parameters for a proposal from a message sender. Returns the number of votes already casted for the proposal by the sender @@ -313,7 +316,7 @@ pub trait GovernorImpl: let message = (proposal_id.clone(), support.clone(), reason.clone(), params.clone()).encode(); if !signature.verify(&message, &Self::env().caller()) { - return Err(GovernanceError::InvalidSignature(Self::env().caller())) + return Err(GovernanceError::InvalidSignature) } self._cast_vote_with_params(proposal_id, Self::env().caller(), support, reason, params) diff --git a/contracts/src/governance/governor/internal.rs b/contracts/src/governance/governor/internal.rs index 1e250033d..667e8cd27 100644 --- a/contracts/src/governance/governor/internal.rs +++ b/contracts/src/governance/governor/internal.rs @@ -43,7 +43,6 @@ use crate::{ ProposalState, Transaction, VoteType, - ALL_PROPOSAL_STATES, }, }, }; @@ -141,10 +140,10 @@ pub trait GovernorInternal: .call_flags(CallFlags::default().set_allow_reentry(true)) .returns::<()>() .try_invoke() - .map_err(|_| GovernanceError::ExecutionFailed(tx.clone()))? - .map_err(|_| GovernanceError::ExecutionFailed(tx.clone()))?; + .map_err(|_| GovernanceError::ExecutionFailed)? + .map_err(|_| GovernanceError::ExecutionFailed)?; } else { - return Err(GovernanceError::ExecutionFailed(tx.clone())) + return Err(GovernanceError::ExecutionFailed) } } diff --git a/contracts/src/governance/utils/votes/impls.rs b/contracts/src/governance/utils/votes/impls.rs index 6819e3998..8b1932ede 100644 --- a/contracts/src/governance/utils/votes/impls.rs +++ b/contracts/src/governance/utils/votes/impls.rs @@ -112,7 +112,7 @@ pub trait VotesImpl: Storage + VotesInternal + nonces::NoncesImpl + VotesE let message = (&delegatee, &nonce, &expiry).encode(); if !signature.verify(&message, &signer) { - return Err(GovernanceError::InvalidSignature(signer)) + return Err(GovernanceError::InvalidSignature) } else { self._use_checked_nonce(&signer, nonce)?; self._delegate(&Some(signer), &Some(delegatee)) diff --git a/lang/codegen/src/implementations.rs b/lang/codegen/src/implementations.rs index 7ad7627f4..04ea7c045 100644 --- a/lang/codegen/src/implementations.rs +++ b/lang/codegen/src/implementations.rs @@ -3149,7 +3149,7 @@ pub(crate) fn impl_governor(impl_args: &mut ImplArgs) { reason: String, signature: Signature, ) -> Result { - GovernorImpl::cast_vote_with_signature(self, proposal_id, support, reason, signature, params) + GovernorImpl::cast_vote_with_signature(self, proposal_id, support, reason, signature) } #[ink(message)]