Skip to content

Commit

Permalink
delete username builtin function & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Aug 24, 2023
1 parent 96f2af6 commit fd66d52
Show file tree
Hide file tree
Showing 21 changed files with 554 additions and 2 deletions.
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.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ members = [
"contracts/feature-tests/big-float-features/meta",
"contracts/feature-tests/composability",
"contracts/feature-tests/composability/interact",
"contracts/feature-tests/composability/builtin-func-features",
"contracts/feature-tests/composability/builtin-func-features/meta",
"contracts/feature-tests/composability/esdt-contract-pair",
"contracts/feature-tests/composability/esdt-contract-pair/first-contract",
"contracts/feature-tests/composability/esdt-contract-pair/first-contract/meta",
Expand Down
3 changes: 3 additions & 0 deletions contracts/feature-tests/composability/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Andrei Marinica <[email protected]>"]
edition = "2021"
publish = false

[dev-dependencies.builtin-func-features]
path = "builtin-func-features"

[dev-dependencies.forwarder]
path = "forwarder"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "builtin-func-features"
version = "0.0.0"
authors = ["Andrei Marinica <[email protected]>"]
edition = "2021"
publish = false

[lib]
path = "src/builtin_func_features.rs"

[dependencies.multiversx-sc]
version = "0.43.2"
path = "../../../../framework/base"

[dependencies.multiversx-sc-wasm-adapter]
version = "0.43.2"
path = "../../../../framework/wasm-adapter"
optional = true

[dev-dependencies.multiversx-sc-scenario]
version = "0.43.2"
path = "../../../../framework/scenario"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "builtin-func-features-meta"
version = "0.0.0"
edition = "2021"
publish = false

[dependencies.builtin-func-features]
path = ".."

[dependencies.multiversx-sc-meta]
version = "0.43.2"
path = "../../../../../framework/meta"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
multiversx_sc_meta::cli_main::<builtin_func_features::AbiProvider>();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"language": "rust"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#![no_std]

pub mod builtin_func_proxy;

multiversx_sc::imports!();

/// Test contract for investigating async calls.
#[multiversx_sc::contract]
pub trait BuiltinFuncFeatures {
#[proxy]
fn builtin_func_proxy(&self, to: ManagedAddress) -> builtin_func_proxy::Proxy<Self::Api>;

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

#[endpoint]
fn call_set_user_name(&self, address: ManagedAddress, name: ManagedBuffer) {
self.builtin_func_proxy(address)
.set_user_name(&name)
.async_call()
.call_and_exit()
}

#[endpoint]
fn call_delete_user_name(&self, address: ManagedAddress) {
self.builtin_func_proxy(address)
.delete_user_name()
.async_call()
.call_and_exit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
multiversx_sc::imports!();

#[multiversx_sc::derive::proxy]
pub trait UserBuiltin {
#[endpoint(SetUserName)]
fn set_user_name(&self, name: &ManagedBuffer);

#[endpoint(DeleteUserName)]
fn delete_user_name(&self);
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "builtin-func-features-wasm"
version = "0.0.0"
authors = ["Andrei Marinica <[email protected]>"]
edition = "2021"
publish = false

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

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

[dependencies.builtin-func-features]
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.43.2"
path = "../../../../../framework/wasm-adapter"

[workspace]
members = ["."]
Loading

0 comments on commit fd66d52

Please sign in to comment.