Skip to content

Commit

Permalink
builtin func - clam dev rewards fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Apr 8, 2024
1 parent 10dcd1d commit 70b4a44
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion contracts/modules/src/claim_developer_rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ multiversx_sc::imports!();
pub trait ClaimDeveloperRewardsModule {
#[endpoint(claimDeveloperRewards)]
fn claim_developer_rewards(&self, child_sc_address: ManagedAddress) {
self.claim_developer_rewards(child_sc_address);
self.send()
.claim_developer_rewards(child_sc_address)
.sync_call();
}
}
12 changes: 7 additions & 5 deletions framework/base/src/contract_base/wrappers/send_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use crate::{
ESDT_NFT_CREATE_FUNC_NAME, ESDT_NFT_UPDATE_ATTRIBUTES_FUNC_NAME,
},
BigUint, ContractCall, ContractCallNoPayment, ESDTSystemSCAddress,
EgldOrEsdtTokenIdentifier, EsdtTokenPayment, GasLeft, ManagedAddress, ManagedArgBuffer,
ManagedBuffer, ManagedType, ManagedVec, ReturnsRawResult, ToSelf, TokenIdentifier, Tx,
TxScEnv,
EgldOrEsdtTokenIdentifier, EsdtTokenPayment, FunctionCall, GasLeft, ManagedAddress,
ManagedArgBuffer, ManagedBuffer, ManagedType, ManagedVec, OriginalResultMarker,
ReturnsRawResult, ToSelf, TokenIdentifier, Tx, TxScEnv,
},
};

Expand Down Expand Up @@ -361,10 +361,12 @@ where
/// Creates a call to the `ClaimDeveloperRewards` builtin function.
///
/// In itself, this does nothing. You need to then call turn the contract call into an async call.
#[allow(clippy::type_complexity)]
pub fn claim_developer_rewards(
&self,
child_sc_address: ManagedAddress<A>,
) -> system_proxy::UserBuiltinProxyMethods<TxScEnv<A>, (), ManagedAddress<A>, ()> {
) -> Tx<TxScEnv<A>, (), ManagedAddress<A>, (), (), FunctionCall<A>, OriginalResultMarker<()>>
{
Tx::new_tx_from_sc()
.to(child_sc_address)
.typed(system_proxy::UserBuiltinProxy)
Expand Down Expand Up @@ -411,7 +413,7 @@ where
.gas(GasLeft)
.raw_call(function_name)
.arguments_raw(arg_buffer)
// .sync_call()
.sync_call()
}

/// Allows synchronous minting of ESDT/SFT (depending on nonce). Execution is resumed afterwards.
Expand Down
2 changes: 1 addition & 1 deletion framework/base/src/types/interaction/system_proxy.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub mod builtin_func_names;
mod builtin_func_proxy;
mod esdt_system_sc_proxy;
mod legacy_system_sc_proxy;
pub(crate) mod token_properties;
pub mod builtin_func_names;

pub use builtin_func_proxy::*;
pub use esdt_system_sc_proxy::*;
Expand Down

0 comments on commit 70b4a44

Please sign in to comment.