From 6fed55eae9894fa0c7436ac872df3ee3926ff2ee Mon Sep 17 00:00:00 2001 From: Claudiu Ion Lataretu Date: Tue, 20 Apr 2021 16:08:01 +0300 Subject: [PATCH] staking/ only Mint and Burn roles are used Signed-off-by: Claudiu Ion Lataretu --- elrond_dex_staking/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/elrond_dex_staking/src/lib.rs b/elrond_dex_staking/src/lib.rs index b542bc454..2cce091a3 100644 --- a/elrond_dex_staking/src/lib.rs +++ b/elrond_dex_staking/src/lib.rs @@ -400,21 +400,18 @@ pub trait Staking { #[endpoint(setLocalRolesStakeToken)] fn set_local_roles_stake_token( &self, - #[var_args] roles: VarArgs, ) -> SCResult> { require!(self.is_active(), "Not active"); sc_try!(self.require_permissions()); require!(!self.stake_token_id().is_empty(), "No stake token issued"); - require!(!roles.is_empty(), "Empty args"); let token = self.stake_token_id().get(); - Ok(self.set_local_roles(token, roles)) + Ok(self.set_local_roles(token)) } #[endpoint(setLocalRolesUnstakeToken)] fn set_local_roles_unstake_token( &self, - #[var_args] roles: VarArgs, ) -> SCResult> { require!(self.is_active(), "Not active"); sc_try!(self.require_permissions()); @@ -422,22 +419,25 @@ pub trait Staking { !self.unstake_token_id().is_empty(), "No unstake token issued" ); - require!(!roles.is_empty(), "Empty args"); let token = self.unstake_token_id().get(); - Ok(self.set_local_roles(token, roles)) + Ok(self.set_local_roles(token)) } fn set_local_roles( &self, token: TokenIdentifier, - #[var_args] roles: VarArgs, ) -> AsyncCall { ESDTSystemSmartContractProxy::new() .set_special_roles( &self.blockchain().get_sc_address(), token.as_esdt_identifier(), - roles.as_slice(), + &[ + EsdtLocalRole::Mint, + EsdtLocalRole::Burn, + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity + ], ) .async_call() .with_callback(self.callbacks().change_roles_callback())