-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1628 from multiversx/proxy-config-variant
sc-config proxy - add variant
- Loading branch information
Showing
6 changed files
with
221 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
contracts/feature-tests/multi-contract-features/src/multi_contract_alt_impl_proxy.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// 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 MultiContractFeaturesProxy; | ||
|
||
impl<Env, From, To, Gas> TxProxyTrait<Env, From, To, Gas> for MultiContractFeaturesProxy | ||
where | ||
Env: TxEnv, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
type TxProxyMethods = MultiContractFeaturesProxyMethods<Env, From, To, Gas>; | ||
|
||
fn proxy_methods(self, tx: Tx<Env, From, To, (), Gas, (), ()>) -> Self::TxProxyMethods { | ||
MultiContractFeaturesProxyMethods { wrapped_tx: tx } | ||
} | ||
} | ||
|
||
pub struct MultiContractFeaturesProxyMethods<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> MultiContractFeaturesProxyMethods<Env, From, (), Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn alternative_init( | ||
self, | ||
) -> TxTypedDeploy<Env, From, NotPayable, Gas, &'static str> { | ||
self.wrapped_tx | ||
.payment(NotPayable) | ||
.raw_deploy() | ||
.original_result() | ||
} | ||
} | ||
|
||
#[rustfmt::skip] | ||
impl<Env, From, To, Gas> MultiContractFeaturesProxyMethods<Env, From, To, Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn alternative_sample_value( | ||
self, | ||
) -> TxTypedCall<Env, From, To, NotPayable, Gas, &'static str> { | ||
self.wrapped_tx | ||
.payment(NotPayable) | ||
.raw_call("sample_value") | ||
.original_result() | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
contracts/feature-tests/multi-contract-features/src/multi_contract_example_feature_proxy.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// 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 MultiContractFeaturesProxy; | ||
|
||
impl<Env, From, To, Gas> TxProxyTrait<Env, From, To, Gas> for MultiContractFeaturesProxy | ||
where | ||
Env: TxEnv, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
type TxProxyMethods = MultiContractFeaturesProxyMethods<Env, From, To, Gas>; | ||
|
||
fn proxy_methods(self, tx: Tx<Env, From, To, (), Gas, (), ()>) -> Self::TxProxyMethods { | ||
MultiContractFeaturesProxyMethods { wrapped_tx: tx } | ||
} | ||
} | ||
|
||
pub struct MultiContractFeaturesProxyMethods<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> MultiContractFeaturesProxyMethods<Env, From, (), Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn default_init< | ||
Arg0: ProxyArg<BigUint<Env::Api>>, | ||
>( | ||
self, | ||
sample_value: Arg0, | ||
) -> TxTypedDeploy<Env, From, NotPayable, Gas, ()> { | ||
self.wrapped_tx | ||
.payment(NotPayable) | ||
.raw_deploy() | ||
.argument(&sample_value) | ||
.original_result() | ||
} | ||
} | ||
|
||
#[rustfmt::skip] | ||
impl<Env, From, To, Gas> MultiContractFeaturesProxyMethods<Env, From, To, Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn sample_value( | ||
self, | ||
) -> TxTypedCall<Env, From, To, NotPayable, Gas, BigUint<Env::Api>> { | ||
self.wrapped_tx | ||
.payment(NotPayable) | ||
.raw_call("sample_value") | ||
.original_result() | ||
} | ||
|
||
pub fn example_feature_message( | ||
self, | ||
) -> TxTypedCall<Env, From, To, NotPayable, Gas, &'static str> { | ||
self.wrapped_tx | ||
.payment(NotPayable) | ||
.raw_call("example_feature_message") | ||
.original_result() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.