-
Notifications
You must be signed in to change notification settings - Fork 100
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 #1534 from multiversx/multi-proxy-config
Proxy multi sc-config
- Loading branch information
Showing
26 changed files
with
249 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[settings] | ||
proxy-paths = ["src/adder_proxy.rs"] | ||
|
||
[[proxy]] | ||
path = "src/adder_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,2 +1,2 @@ | ||
[settings] | ||
proxy-paths = ["src/crowdfunding_esdt_proxy.rs"] | ||
[[proxy]] | ||
path = "src/crowdfunding_esdt_proxy.rs" |
10 changes: 8 additions & 2 deletions
10
contracts/examples/crypto-kitties/kitty-genetic-alg/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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
[settings] | ||
proxy-paths = ["../kitty-ownership/src/kitty_genetic_alg_proxy.rs"] | ||
[[proxy]] | ||
path = "../kitty-ownership/src/kitty_genetic_alg_proxy.rs" | ||
[[proxy.path-rename]] | ||
from = "kitty::kitty" | ||
to = "kitty" | ||
[[proxy.path-rename]] | ||
from = "kitty_genes" | ||
to = "kitty" |
16 changes: 11 additions & 5 deletions
16
contracts/examples/crypto-kitties/kitty-ownership/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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
[settings] | ||
proxy-paths = [ | ||
"../kitty-auction/src/kitty_ownership_proxy.rs", | ||
"../../crypto-zombies/src/kitty_ownership_proxy.rs", | ||
] | ||
[[proxy]] | ||
path = "../kitty-auction/src/kitty_ownership_proxy.rs" | ||
[[proxy.path-rename]] | ||
from = "kitty::kitty" | ||
to = "kitty" | ||
|
||
[[proxy]] | ||
path = "../../crypto-zombies/src/kitty_ownership_proxy.rs" | ||
[[proxy.path-rename]] | ||
from = "kitty::kitty" | ||
to = "kitty" |
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,2 +1,2 @@ | ||
[settings] | ||
proxy-paths = ["src/proxy_crypto_zombies.rs"] | ||
[[proxy]] | ||
path = "src/proxy_crypto_zombies.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,2 +1,2 @@ | ||
[settings] | ||
proxy-paths = ["src/digital_cash_proxy.rs"] | ||
[[proxy]] | ||
path = "src/digital_cash_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
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,2 +1,2 @@ | ||
[settings] | ||
proxy-paths = ["../rewards-distribution/src/seed_nft_minter_proxy.rs"] | ||
[[proxy]] | ||
path = "../rewards-distribution/src/seed_nft_minter_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
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
4 changes: 2 additions & 2 deletions
4
...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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[settings] | ||
proxy-paths = ["../parent/src/child_proxy.rs"] | ||
[[proxy]] | ||
path = "../parent/src/child_proxy.rs" |
4 changes: 2 additions & 2 deletions
4
contracts/feature-tests/composability/recursive-caller/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[settings] | ||
proxy-paths = ["src/self_proxy.rs"] | ||
[[proxy]] | ||
path = "src/self_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
4 changes: 3 additions & 1 deletion
4
contracts/feature-tests/erc-style-contracts/erc1155/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
10 changes: 6 additions & 4 deletions
10
contracts/feature-tests/erc-style-contracts/erc20/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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
[settings] | ||
proxy-paths = [ | ||
"../crowdfunding-erc20/src/erc20_proxy.rs", | ||
"../lottery-erc20/src/erc20_proxy.rs", | ||
] | ||
|
||
[[proxy]] | ||
path = "../crowdfunding-erc20/src/erc20_proxy.rs" | ||
|
||
[[proxy]] | ||
path = "../lottery-erc20/src/erc20_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,7 +1,9 @@ | ||
[settings] | ||
proxy-paths = ["tests/pmf_proxy.rs"] | ||
main = "main" | ||
|
||
[contracts.main] | ||
name = "panic-message-features" | ||
panic-message = true | ||
|
||
[[proxy]] | ||
path = "tests/pmf_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,4 +1,4 @@ | ||
pub mod proxy_crate_gen; | ||
pub mod proxy_gen_main; | ||
mod proxy_generator; | ||
mod proxy_naming; | ||
mod proxy_process_type_name; |
18 changes: 9 additions & 9 deletions
18
framework/meta/src/cmd/contract/generate_proxy/proxy_gen_main.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,21 +1,21 @@ | ||
use crate::cmd::contract::sc_config::ProxyConfigSerde; | ||
|
||
use super::{ | ||
super::meta_config::MetaConfig, proxy_crate_gen::create_file, proxy_generator::ProxyGenerator, | ||
}; | ||
|
||
const OUTPUT_PROXY_PATH: &str = "/output/proxy.rs"; | ||
|
||
impl MetaConfig { | ||
pub fn generate_proxy(&mut self) { | ||
write_proxy_with_explicit_path(OUTPUT_PROXY_PATH, self); | ||
let proxy_paths = self.sc_config.proxy_paths.clone(); | ||
for path in proxy_paths { | ||
write_proxy_with_explicit_path(&path, self); | ||
let default_proxy = ProxyConfigSerde::new(); | ||
write_proxy_with_explicit_path(&default_proxy, self); | ||
for proxy_config in self.sc_config.proxy_configs.clone() { | ||
write_proxy_with_explicit_path(&proxy_config, self); | ||
} | ||
} | ||
} | ||
|
||
fn write_proxy_with_explicit_path(path: &str, meta_config: &mut MetaConfig) { | ||
let mut file = create_file(path); | ||
let mut proxy_generator = ProxyGenerator::new(meta_config, &mut file); | ||
fn write_proxy_with_explicit_path(proxy_config: &ProxyConfigSerde, meta_config: &mut MetaConfig) { | ||
let mut file = create_file(&proxy_config.path); | ||
let mut proxy_generator = ProxyGenerator::new(meta_config, &mut file, proxy_config); | ||
proxy_generator.write_proxy_to_file(); | ||
} |
Oops, something went wrong.