-
Notifications
You must be signed in to change notification settings - Fork 99
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 #1517 from multiversx/composability-migration
migration and new proxies for composability
- Loading branch information
Showing
19 changed files
with
1,152 additions
and
131 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
72 changes: 65 additions & 7 deletions
72
contracts/feature-tests/composability/builtin-func-features/src/builtin_func_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 |
---|---|---|
@@ -1,10 +1,68 @@ | ||
multiversx_sc::imports!(); | ||
// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. | ||
|
||
#[multiversx_sc::derive::proxy] | ||
pub trait UserBuiltin { | ||
#[endpoint(SetUserName)] | ||
fn set_user_name(&self, name: &ManagedBuffer); | ||
//////////////////////////////////////////////////// | ||
////////////////// AUTO-GENERATED ////////////////// | ||
//////////////////////////////////////////////////// | ||
|
||
#[endpoint(DeleteUserName)] | ||
fn delete_user_name(&self); | ||
#![allow(dead_code)] | ||
#![allow(clippy::all)] | ||
|
||
use multiversx_sc::proxy_imports::*; | ||
|
||
pub struct UserBuiltinProxy; | ||
|
||
impl<Env, From, To, Gas> TxProxyTrait<Env, From, To, Gas> for UserBuiltinProxy | ||
where | ||
Env: TxEnv, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
type TxProxyMethods = UserBuiltinProxyMethods<Env, From, To, Gas>; | ||
|
||
fn proxy_methods(self, tx: Tx<Env, From, To, (), Gas, (), ()>) -> Self::TxProxyMethods { | ||
UserBuiltinProxyMethods { wrapped_tx: tx } | ||
} | ||
} | ||
|
||
pub struct UserBuiltinProxyMethods<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, To, Gas> UserBuiltinProxyMethods<Env, From, To, Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn set_user_name< | ||
Arg0: CodecInto<ManagedBuffer<Env::Api>>, | ||
>( | ||
self, | ||
name: Arg0, | ||
) -> TxProxyCall<Env, From, To, Gas, ()> { | ||
self.wrapped_tx | ||
.raw_call() | ||
.function_name("SetUserName") | ||
.argument(&name) | ||
.original_result() | ||
} | ||
|
||
pub fn delete_user_name( | ||
self, | ||
) -> TxProxyCall<Env, From, To, Gas, ()> { | ||
self.wrapped_tx | ||
.raw_call() | ||
.function_name("DeleteUserName") | ||
.original_result() | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...acts/feature-tests/composability/execute-on-dest-esdt-issue-callback/child/sc-config.toml
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,2 @@ | ||
[settings] | ||
proxy-paths = ["../parent/src/child_proxy.rs"] |
102 changes: 102 additions & 0 deletions
102
...feature-tests/composability/execute-on-dest-esdt-issue-callback/parent/src/child_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,102 @@ | ||
// 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 ChildProxy; | ||
|
||
impl<Env, From, To, Gas> TxProxyTrait<Env, From, To, Gas> for ChildProxy | ||
where | ||
Env: TxEnv, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
type TxProxyMethods = ChildProxyMethods<Env, From, To, Gas>; | ||
|
||
fn proxy_methods(self, tx: Tx<Env, From, To, (), Gas, (), ()>) -> Self::TxProxyMethods { | ||
ChildProxyMethods { wrapped_tx: tx } | ||
} | ||
} | ||
|
||
pub struct ChildProxyMethods<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> ChildProxyMethods<Env, From, (), Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn init( | ||
self, | ||
) -> TxProxyDeploy<Env, From, Gas, ()> { | ||
self.wrapped_tx | ||
.raw_deploy() | ||
.original_result() | ||
} | ||
} | ||
|
||
#[rustfmt::skip] | ||
impl<Env, From, To, Gas> ChildProxyMethods<Env, From, To, Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
} | ||
|
||
#[rustfmt::skip] | ||
impl<Env, From, To, Gas> ChildProxyMethods<Env, From, To, Gas> | ||
where | ||
Env: TxEnv, | ||
Env::Api: VMApi, | ||
From: TxFrom<Env>, | ||
To: TxTo<Env>, | ||
Gas: TxGas<Env>, | ||
{ | ||
pub fn issue_wrapped_egld< | ||
Arg0: CodecInto<ManagedBuffer<Env::Api>>, | ||
Arg1: CodecInto<ManagedBuffer<Env::Api>>, | ||
Arg2: CodecInto<BigUint<Env::Api>>, | ||
>( | ||
self, | ||
token_display_name: Arg0, | ||
token_ticker: Arg1, | ||
initial_supply: Arg2, | ||
) -> TxProxyCall<Env, From, To, Gas, ()> { | ||
self.wrapped_tx | ||
.raw_call() | ||
.function_name("issueWrappedEgld") | ||
.argument(&token_display_name) | ||
.argument(&token_ticker) | ||
.argument(&initial_supply) | ||
.original_result() | ||
} | ||
|
||
pub fn wrapped_egld_token_identifier( | ||
self, | ||
) -> TxProxyCall<Env, From, To, Gas, TokenIdentifier<Env::Api>> { | ||
self.wrapped_tx | ||
.raw_call() | ||
.function_name("getWrappedEgldTokenIdentifier") | ||
.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
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
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
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.