Skip to content

Commit

Permalink
Merge pull request #156 from multiversx/add-upgrade-functions
Browse files Browse the repository at this point in the history
Add upgrade functions for each SC
  • Loading branch information
CostinCarabas authored Dec 21, 2023
2 parents ae4d2e8 + d31ec10 commit 8c1438e
Show file tree
Hide file tree
Showing 15 changed files with 343 additions and 369 deletions.
3 changes: 3 additions & 0 deletions bridged-tokens-wrapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pub trait BridgedTokensWrapper: multiversx_sc_modules::pause::PauseModule {
self.set_paused(true);
}

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

#[only_owner]
#[endpoint(addWrappedToken)]
fn add_wrapped_token(&self, universal_bridged_token_ids: TokenIdentifier, num_decimals: u32) {
Expand Down
116 changes: 45 additions & 71 deletions bridged-tokens-wrapper/wasm/Cargo.lock

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

8 changes: 7 additions & 1 deletion bridged-tokens-wrapper/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Code generated by the multiversx-sc build system. DO NOT EDIT.

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

[package]
name = "bridged-tokens-wrapper-wasm"
version = "0.0.0"
authors = ["Alin Cruceat <[email protected]>"]
edition = "2018"
publish = false

Expand All @@ -14,6 +19,7 @@ opt-level = "z"
lto = true
debug = false
panic = "abort"
overflow-checks = false

[dependencies.bridged-tokens-wrapper]
path = ".."
Expand Down
47 changes: 26 additions & 21 deletions bridged-tokens-wrapper/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT.
// Code generated by the multiversx-sc build system. DO NOT EDIT.

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

// Init: 1
// Endpoints: 16
// Endpoints: 17
// Async Callback (empty): 1
// Total number of exported functions: 18
// Total number of exported functions: 19

#![no_std]
#![feature(alloc_error_handler, lang_items)]

// Configuration that works with rustc < 1.73.0.
// TODO: Recommended rustc version: 1.73.0 or newer.
#![feature(lang_items)]

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

multiversx_sc_wasm_adapter::endpoints! {
bridged_tokens_wrapper
(
addWrappedToken
updateWrappedToken
removeWrappedToken
whitelistToken
updateWhitelistedToken
blacklistToken
depositLiquidity
wrapTokens
unwrapToken
getUniversalBridgedTokenIds
getTokenLiquidity
getChainSpecificToUniversalMapping
getchainSpecificTokenIds
pause
unpause
isPaused
init => init
upgrade => upgrade
addWrappedToken => add_wrapped_token
updateWrappedToken => update_wrapped_token
removeWrappedToken => remove_wrapped_token
whitelistToken => whitelist_token
updateWhitelistedToken => update_whitelisted_token
blacklistToken => blacklist_token
depositLiquidity => deposit_liquidity
wrapTokens => wrap_tokens
unwrapToken => unwrap_token
getUniversalBridgedTokenIds => universal_bridged_token_ids
getTokenLiquidity => token_liquidity
getChainSpecificToUniversalMapping => chain_specific_to_universal_mapping
getchainSpecificTokenIds => chain_specific_token_ids
pause => pause_endpoint
unpause => unpause_endpoint
isPaused => paused_status
)
}

multiversx_sc_wasm_adapter::empty_callback! {}
multiversx_sc_wasm_adapter::async_callback_empty! {}
3 changes: 3 additions & 0 deletions esdt-safe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ pub trait EsdtSafe:
self.set_paused(true);
}

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

/// Sets the statuses for the transactions, after they were executed on the Ethereum side.
///
/// Only TransactionStatus::Executed (3) and TransactionStatus::Rejected (4) values are allowed.
Expand Down
16 changes: 10 additions & 6 deletions esdt-safe/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# Code generated by the multiversx-sc build system. DO NOT EDIT.

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

[package]
name = "esdt-safe-wasm"
version = "0.0.0"
authors = ["you"]
edition = "2018"
publish = false

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

[workspace]
members = ["."]

[dev-dependencies]

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

[dependencies.esdt-safe]
path = ".."

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

[workspace]
members = ["."]
Loading

0 comments on commit 8c1438e

Please sign in to comment.