Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unified - blackbox promises_feature #1663

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ main = "promises-features"
name = "promises-features"
add-unlabelled = true
ei = "1.3" # the whole point of this config is to explicitly specify that this contract needs EI 1.3/VM 1.5

[[proxy]]
path = "src/promises_feature_proxy.rs"
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
// Code generated by the multiversx-sc proxy generator. DO NOT EDIT.

////////////////////////////////////////////////////
////////////////// AUTO-GENERATED //////////////////
////////////////////////////////////////////////////

#![allow(dead_code)]
#![allow(clippy::all)]

use multiversx_sc::proxy_imports::*;

pub struct PromisesFeaturesProxy;

impl<Env, From, To, Gas> TxProxyTrait<Env, From, To, Gas> for PromisesFeaturesProxy
where
Env: TxEnv,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
type TxProxyMethods = PromisesFeaturesProxyMethods<Env, From, To, Gas>;

fn proxy_methods(self, tx: Tx<Env, From, To, (), Gas, (), ()>) -> Self::TxProxyMethods {
PromisesFeaturesProxyMethods { wrapped_tx: tx }
}
}

pub struct PromisesFeaturesProxyMethods<Env, From, To, Gas>
where
Env: TxEnv,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
wrapped_tx: Tx<Env, From, To, (), Gas, (), ()>,
}

#[rustfmt::skip]
impl<Env, From, Gas> PromisesFeaturesProxyMethods<Env, From, (), Gas>
where
Env: TxEnv,
Env::Api: VMApi,
From: TxFrom<Env>,
Gas: TxGas<Env>,
{
pub fn init(
self,
) -> TxTypedDeploy<Env, From, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_deploy()
.original_result()
}
}

#[rustfmt::skip]
impl<Env, From, To, Gas> PromisesFeaturesProxyMethods<Env, From, To, Gas>
where
Env: TxEnv,
Env::Api: VMApi,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
pub fn callback_data(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, MultiValueEncoded<Env::Api, CallbackData<Env::Api>>> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("callback_data")
.original_result()
}

pub fn callback_data_at_index<
Arg0: ProxyArg<usize>,
>(
self,
index: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, MultiValue5<ManagedBuffer<Env::Api>, EgldOrEsdtTokenIdentifier<Env::Api>, u64, BigUint<Env::Api>, MultiValueManagedVec<Env::Api, ManagedBuffer<Env::Api>>>> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("callback_data_at_index")
.argument(&index)
.original_result()
}

pub fn clear_callback_data(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("clear_callback_data")
.original_result()
}

pub fn forward_promise_accept_funds<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
>(
self,
to: Arg0,
) -> TxTypedCall<Env, From, To, (), Gas, ()> {
self.wrapped_tx
.raw_call("forward_promise_accept_funds")
.argument(&to)
.original_result()
}

pub fn forward_promise_retrieve_funds<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<EgldOrEsdtTokenIdentifier<Env::Api>>,
Arg2: ProxyArg<u64>,
Arg3: ProxyArg<BigUint<Env::Api>>,
>(
self,
to: Arg0,
token: Arg1,
token_nonce: Arg2,
amount: Arg3,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("forward_promise_retrieve_funds")
.argument(&to)
.argument(&token)
.argument(&token_nonce)
.argument(&amount)
.original_result()
}

pub fn promise_raw_single_token<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<ManagedBuffer<Env::Api>>,
Arg2: ProxyArg<u64>,
Arg3: ProxyArg<u64>,
Arg4: ProxyArg<MultiValueEncoded<Env::Api, ManagedBuffer<Env::Api>>>,
>(
self,
to: Arg0,
endpoint_name: Arg1,
gas_limit: Arg2,
extra_gas_for_callback: Arg3,
args: Arg4,
) -> TxTypedCall<Env, From, To, (), Gas, ()> {
self.wrapped_tx
.raw_call("promise_raw_single_token")
.argument(&to)
.argument(&endpoint_name)
.argument(&gas_limit)
.argument(&extra_gas_for_callback)
.argument(&args)
.original_result()
}

pub fn promise_raw_multi_transfer<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<ManagedBuffer<Env::Api>>,
Arg2: ProxyArg<u64>,
Arg3: ProxyArg<MultiValueEncoded<Env::Api, EsdtTokenPaymentMultiValue<Env::Api>>>,
>(
self,
to: Arg0,
endpoint_name: Arg1,
extra_gas_for_callback: Arg2,
token_payment_args: Arg3,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("promise_raw_multi_transfer")
.argument(&to)
.argument(&endpoint_name)
.argument(&extra_gas_for_callback)
.argument(&token_payment_args)
.original_result()
}

pub fn forward_sync_retrieve_funds_bt<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<EgldOrEsdtTokenIdentifier<Env::Api>>,
Arg2: ProxyArg<u64>,
Arg3: ProxyArg<BigUint<Env::Api>>,
>(
self,
to: Arg0,
token: Arg1,
token_nonce: Arg2,
amount: Arg3,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("forward_sync_retrieve_funds_bt")
.argument(&to)
.argument(&token)
.argument(&token_nonce)
.argument(&amount)
.original_result()
}

pub fn forward_sync_retrieve_funds_bt_twice<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<EgldOrEsdtTokenIdentifier<Env::Api>>,
Arg2: ProxyArg<u64>,
Arg3: ProxyArg<BigUint<Env::Api>>,
>(
self,
to: Arg0,
token: Arg1,
token_nonce: Arg2,
amount: Arg3,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("forward_sync_retrieve_funds_bt_twice")
.argument(&to)
.argument(&token)
.argument(&token_nonce)
.argument(&amount)
.original_result()
}

pub fn forward_promise_retrieve_funds_back_transfers<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<EgldOrEsdtTokenIdentifier<Env::Api>>,
Arg2: ProxyArg<u64>,
Arg3: ProxyArg<BigUint<Env::Api>>,
>(
self,
to: Arg0,
token: Arg1,
token_nonce: Arg2,
amount: Arg3,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("forward_promise_retrieve_funds_back_transfers")
.argument(&to)
.argument(&token)
.argument(&token_nonce)
.argument(&amount)
.original_result()
}
}

#[type_abi]
#[derive(TopEncode, TopDecode)]
pub struct CallbackData<Api>
where
Api: ManagedTypeApi,
{
pub callback_name: ManagedBuffer<Api>,
pub token_identifier: EgldOrEsdtTokenIdentifier<Api>,
pub token_nonce: u64,
pub token_amount: BigUint<Api>,
pub args: ManagedVec<Api, ManagedBuffer<Api>>,
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod fwd_call_promise_direct;
mod fwd_call_promises;
mod fwd_call_promises_bt;
pub mod fwd_call_sync_bt;
pub mod promises_feature_proxy;
pub mod vault_proxy;

multiversx_sc::imports!();
Expand Down
Loading
Loading