Skip to content

Commit

Permalink
Merge pull request #162 from multiversx/MX-15084
Browse files Browse the repository at this point in the history
MX-15084: add PauseModule for bridge-proxy
  • Loading branch information
dragos-rebegea authored Feb 12, 2024
2 parents 7a38dec + 4f3c069 commit 2c56f2a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions bridge-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ path = "../common/eth-address"
[dependencies.multiversx-sc]
version = "0.46.1"

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

[dependencies.adder]
git = "https://github.com/multiversx/mx-contracts-rs"
rev = "64e8926"
Expand Down
5 changes: 4 additions & 1 deletion bridge-proxy/src/bridge-proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ pub mod config;
use transaction::{EthTransaction, EthTransactionPayment};

#[multiversx_sc::contract]
pub trait BridgeProxyContract: config::ConfigModule {
pub trait BridgeProxyContract:
config::ConfigModule
+ multiversx_sc_modules::pause::PauseModule {
#[init]
fn init(&self, opt_multi_transfer_address: OptionalValue<ManagedAddress>) {
self.set_multi_transfer_contract_address(opt_multi_transfer_address);
Expand All @@ -29,6 +31,7 @@ pub trait BridgeProxyContract: config::ConfigModule {

#[endpoint(executeWithAsnyc)]
fn execute_with_async(&self, tx_id: u32) {
require!(self.not_paused(), "Contract is paused");
let tx_node = self
.eth_transaction_list()
.remove_node_by_id(tx_id)
Expand Down
10 changes: 10 additions & 0 deletions bridge-proxy/wasm/Cargo.lock

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

11 changes: 8 additions & 3 deletions bridge-proxy/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 8
// Endpoints: 11
// Async Callback: 1
// Total number of exported functions: 10
// Total number of exported functions: 13

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

// 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!();
Expand All @@ -28,6 +30,9 @@ multiversx_sc_wasm_adapter::endpoints! {
getMultiTransferAddress => multi_transfer_address
getEthTransactionList => eth_transaction_list
getEthFailedTransactionList => eth_failed_transaction_list
pause => pause_endpoint
unpause => unpause_endpoint
isPaused => paused_status
)
}

Expand Down

0 comments on commit 2c56f2a

Please sign in to comment.