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

Merge rc/v0.54 -> feat/dapp #1783

Merged
merged 43 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2bbca77
chain-sim - prototype of integration with adder interactor
BiancaIalangi Aug 12, 2024
c060158
chain sim - impl in framework
BiancaIalangi Aug 21, 2024
0dc0540
Merge branch 'rc/v0.53' into chain-simulator-interactor
BiancaIalangi Aug 21, 2024
bd9be2e
impl for interactor
mihaicalinluca Sep 13, 2024
fd25e34
Merge branch 'rc/v0.54' into chain-simulator-interactor
BiancaIalangi Sep 17, 2024
3905c2c
chain sim - fix test
BiancaIalangi Sep 17, 2024
b72c23d
tx hash in scenario
mihaicalinluca Sep 19, 2024
d305c74
chain sim - pass URI from the interactor
BiancaIalangi Sep 19, 2024
eb7dd57
chain sim - add gateway_uri in adder config
BiancaIalangi Sep 20, 2024
69d09a5
unified syntax - tx hash in blackbox/whitebox tests
andrei-marinica Sep 20, 2024
b8853bc
unified syntax - tx hash refactor
andrei-marinica Sep 20, 2024
09c8e34
fix interactor tests
BiancaIalangi Sep 20, 2024
c69e89a
chain sim - fix clippy
BiancaIalangi Sep 20, 2024
265a9fa
wasm-extractor - fix report parameters
BiancaIalangi Sep 20, 2024
c096aae
wasm-extractor - fix mem_grow, create unitests
BiancaIalangi Sep 21, 2024
0dea313
wasm-extractor - clean empty contract
BiancaIalangi Sep 21, 2024
4006993
vm-core crate: Address, H256, BoxedBytes, flags
andrei-marinica Sep 24, 2024
167d9b9
cleanup
andrei-marinica Sep 24, 2024
a93e4c6
lldb formatter fix
andrei-marinica Sep 24, 2024
d3cedb0
no_std fix
andrei-marinica Sep 24, 2024
24b6441
vm-core builtin func names
andrei-marinica Sep 25, 2024
5134dc4
Merge pull request #1774 from multiversx/fix-interactor-tests
BiancaIalangi Sep 26, 2024
c88c59d
wasm-extractor - rename enum PanicReport + max_severity
BiancaIalangi Sep 27, 2024
7c0fc8e
chain sim - generate one block after register wallets
BiancaIalangi Sep 27, 2024
a39c586
chain sim - add enum ChainType in config
BiancaIalangi Sep 27, 2024
d4773f4
Merge branch 'chain-simulator-interactor' of https://github.com/multi…
BiancaIalangi Sep 27, 2024
c5db177
Merge pull request #1772 from multiversx/returns-tx-hash
andrei-marinica Sep 27, 2024
f601d26
remove dbg files
BiancaIalangi Sep 27, 2024
40fc99e
vm-core renamed to chain-core
andrei-marinica Sep 27, 2024
5b6fee0
chain-core cleanup
andrei-marinica Sep 27, 2024
647a571
Merge pull request #1777 from multiversx/vm-core
andrei-marinica Sep 30, 2024
288dd73
Merge pull request #1779 from multiversx/fix-code-report
BiancaIalangi Sep 30, 2024
e31136e
Address conversions removed
andrei-marinica Sep 30, 2024
e41b2a3
Merge pull request #1775 from multiversx/wasm-extractor-fix
BiancaIalangi Sep 30, 2024
33bdb49
Merge pull request #1780 from multiversx/address-dedup
andrei-marinica Sep 30, 2024
53613d0
core Address referenced in SDK
andrei-marinica Sep 30, 2024
d3d9472
clippy fix
andrei-marinica Sep 30, 2024
fca4517
Merge pull request #1728 from multiversx/chain-simulator-interactor
andrei-marinica Sep 30, 2024
16a7a15
Merge branch 'rc/v0.54' into sdk-address
andrei-marinica Sep 30, 2024
64a2174
cleanup
andrei-marinica Sep 30, 2024
7e72cdf
adder interactor config default back to devnet
andrei-marinica Sep 30, 2024
1448840
Merge pull request #1782 from multiversx/sdk-address
andrei-marinica Sep 30, 2024
4b74e62
Merge branch 'rc/v0.54' into feat/dapp
andrei-marinica Sep 30, 2024
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
94 changes: 80 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ members = [
# "tools/plotter",
"tools/interactor-system-func-calls/",

"vm-core",
"vm",

"contracts/modules",
Expand Down
6 changes: 5 additions & 1 deletion contracts/examples/adder/interact/config.toml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
gateway = 'https://devnet-gateway.multiversx.com'
# chain_type = 'simulator'
# gateway_uri = 'http://localhost:8085'

chain_type = 'real'
gateway_uri = 'https://devnet-gateway.multiversx.com'
25 changes: 16 additions & 9 deletions contracts/examples/adder/interact/src/basic_interact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ mod basic_interact_cli;
mod basic_interact_config;
mod basic_interact_state;

use core::str;

use adder::adder_proxy;
use basic_interact_config::Config;
use basic_interact_state::State;
Expand Down Expand Up @@ -61,22 +63,27 @@ struct AdderInteract {
impl AdderInteract {
async fn init() -> Self {
let config = Config::load_config();
let mut interactor = Interactor::new(config.gateway())
let mut interactor = Interactor::new(config.gateway_uri(), config.use_chain_simulator())
.await
.with_tracer(INTERACTOR_SCENARIO_TRACE_PATH)
.await;

let adder_owner_address =
interactor.register_wallet(Wallet::from_pem_file("adder-owner.pem").unwrap());
let adder_owner_address = interactor
.register_wallet(Wallet::from_pem_file("adder-owner.pem").unwrap())
.await;
// PASSWORD: "alice"
// InsertPassword::Plaintext("alice".to_string()) || InsertPassword::StandardInput
let wallet_address = interactor.register_wallet(
Wallet::from_keystore_secret(
"alice.json",
InsertPassword::Plaintext("alice".to_string()),
let wallet_address = interactor
.register_wallet(
Wallet::from_keystore_secret(
"alice.json",
InsertPassword::Plaintext("alice".to_string()),
)
.unwrap(),
)
.unwrap(),
);
.await;

interactor.proxy.generate_blocks(1).await.unwrap();

Self {
interactor,
Expand Down
24 changes: 20 additions & 4 deletions contracts/examples/adder/interact/src/basic_interact_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ use std::io::Read;
/// Config file
const CONFIG_FILE: &str = "config.toml";

#[derive(Debug, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum ChainType {
Real,
Simulator,
}

/// Adder Interact configuration
#[derive(Debug, Deserialize)]
pub struct Config {
gateway: String,
gateway_uri: String,
chain_type: ChainType,
}

impl Config {
Expand All @@ -19,8 +27,16 @@ impl Config {
toml::from_str(&content).unwrap()
}

// Returns the gateway
pub fn gateway(&self) -> &str {
&self.gateway
// Returns the gateway URI
pub fn gateway_uri(&self) -> &str {
&self.gateway_uri
}

// Returns if chain type is chain simulator
pub fn use_chain_simulator(&self) -> bool {
match self.chain_type {
ChainType::Real => false,
ChainType::Simulator => true,
}
}
}
3 changes: 2 additions & 1 deletion contracts/examples/multisig/interact/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
gateway = 'https://devnet-gateway.multiversx.com'
chain_type = 'real'
gateway_uri = 'https://devnet-gateway.multiversx.com'
quorum = 2
wegld_address = "erd1qqqqqqqqqqqqqpgqqkwzsxkjc83vlfex9dmznwm7tjvxlqqkpauqx0n782"
10 changes: 5 additions & 5 deletions contracts/examples/multisig/interact/src/multisig_interact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async fn main() {
env_logger::init();

let mut multisig_interact = MultisigInteract::init().await;
multisig_interact.register_wallets();
multisig_interact.register_wallets().await;

let cli = multisig_interact_cli::InteractCli::parse();
match &cli.command {
Expand Down Expand Up @@ -86,11 +86,11 @@ struct MultisigInteract {
impl MultisigInteract {
async fn init() -> Self {
let config = Config::load_config();
let mut interactor = Interactor::new(&config.gateway)
let mut interactor = Interactor::new(config.gateway_uri(), config.use_chain_simulator())
.await
.with_tracer(INTERACTOR_SCENARIO_TRACE_PATH)
.await;
let wallet_address = interactor.register_wallet(test_wallets::mike());
let wallet_address = interactor.register_wallet(test_wallets::mike()).await;
let multisig_code = BytesValue::interpret_from(
"mxsc:../output/multisig.mxsc.json",
&InterpreterContext::default(),
Expand All @@ -106,13 +106,13 @@ impl MultisigInteract {
}
}

fn register_wallets(&mut self) {
async fn register_wallets(&mut self) {
let carol = test_wallets::carol();
let dan = test_wallets::dan();
let eve = test_wallets::eve();

for wallet in &[carol, dan, eve] {
self.interactor.register_wallet(*wallet);
self.interactor.register_wallet(*wallet).await;
}
}

Expand Down
Loading
Loading