Skip to content

Commit

Permalink
Merge pull request #172 from multiversx/added-test-caller
Browse files Browse the repository at this point in the history
Added test-caller contract used in relayer tests
  • Loading branch information
iulianpascalau authored Jul 2, 2024
2 parents a39b964 + 48e864f commit 12dffb2
Show file tree
Hide file tree
Showing 11 changed files with 344 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ members = [
"multisig",
"multisig/meta",
"bridged-tokens-wrapper",
"bridged-tokens-wrapper/meta"
"bridged-tokens-wrapper/meta",
"test-caller",
"test-caller/meta"
]
7 changes: 7 additions & 0 deletions test-caller/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
*/target/

# The mxpy output
/output*/
21 changes: 21 additions & 0 deletions test-caller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "test-caller"
version = "0.0.0"
authors = ["Iulian Pascalau <[email protected]>"]
edition = "2018"
publish = false

[lib]
path = "src/test-caller.rs"

[dependencies.multiversx-sc]
version = "=0.47.5"

[dependencies.multiversx-sc-modules]
version = "0.47.5"

[dev-dependencies]
num-bigint = "0.4.2"

[dev-dependencies.multiversx-sc-scenario]
version = "=0.47.5"
14 changes: 14 additions & 0 deletions test-caller/meta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "test-caller-meta"
version = "0.0.0"
edition = "2018"
publish = false
authors = ["you"]

[dev-dependencies]

[dependencies.test-caller]
path = ".."

[dependencies.multiversx-sc-meta]
version = "=0.47.5"
3 changes: 3 additions & 0 deletions test-caller/meta/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
multiversx_sc_meta::cli_main::<test_caller::AbiProvider>();
}
3 changes: 3 additions & 0 deletions test-caller/multiversx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"language": "rust"
}
25 changes: 25 additions & 0 deletions test-caller/src/test-caller.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#![no_std]

multiversx_sc::imports!();
multiversx_sc::derive_imports!();

#[multiversx_sc::contract]
pub trait TestCallerContract:
{
#[init]
fn init(&self) {
}

#[upgrade]
fn upgrade(&self) {
}

#[payable("*")]
#[endpoint(callPayable)]
fn call_payable(&self) {
}

#[endpoint(callNonPayable)]
fn call_non_payable(&self) {
}
}
190 changes: 190 additions & 0 deletions test-caller/wasm/Cargo.lock

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

31 changes: 31 additions & 0 deletions test-caller/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Code generated by the multiversx-sc build system. DO NOT EDIT.

# ##########################################
# ############## AUTO-GENERATED #############
# ##########################################

[package]
name = "test-caller-wasm"
version = "0.0.0"
edition = "2018"
publish = false

[lib]
crate-type = ["cdylib"]

[profile.release]
codegen-units = 1
opt-level = "z"
lto = true
debug = false
panic = "abort"
overflow-checks = false

[dependencies.test-caller]
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "=0.47.5"

[workspace]
members = ["."]
29 changes: 29 additions & 0 deletions test-caller/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Code generated by the multiversx-sc build system. DO NOT EDIT.

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

// Init: 1
// Endpoints: 3
// Async Callback (empty): 1
// Total number of exported functions: 5

#![no_std]
#![allow(internal_features)]
#![feature(lang_items)]

multiversx_sc_wasm_adapter::allocator!();
multiversx_sc_wasm_adapter::panic_handler!();

multiversx_sc_wasm_adapter::endpoints! {
test_caller
(
init => init
upgrade => upgrade
callPayable => call_payable
callNonPayable => call_non_payable
)
}

multiversx_sc_wasm_adapter::async_callback_empty! {}

0 comments on commit 12dffb2

Please sign in to comment.