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

MX-15084: add PauseModule for bridge-proxy #162

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading