Skip to content

Commit

Permalink
add update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaGamingArcade committed Nov 28, 2024
1 parent 2a3a89c commit 12f34a6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 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.

1 change: 1 addition & 0 deletions pallets/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ scale-info = { version = "2.10.0", default-features = false, features = [
] }

# frame deps
sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false}
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
Expand Down
16 changes: 12 additions & 4 deletions pallets/bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ mod benchmarking;
pub mod weights;
pub use weights::*;

use aga_traits::{
ChainID, DomainID, DepositNonce
};

#[frame_support::pallet]
pub mod pallet {
// Import various useful types required by all FRAME pallets.
use super::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use frame_support::traits::fungible::{NativeOrWithId, Inspect, Mutate};
use aga_traits::{
ChainID, DomainID, DepositNonce
};
use frame_support::traits::tokens::Preservation;
use scale_info::prelude::vec::Vec;
use primitive_types::U256;
Expand Down Expand Up @@ -646,4 +647,11 @@ pub mod pallet {
IsPaused::<T>::iter_keys().for_each(|d| IsPaused::<T>::insert(d, true));
}
}
}
}

sp_api::decl_runtime_apis! {
/// This runtime api is for checking if the proposal is executed already
pub trait AgaBridgeApi {
fn is_proposal_executed(nonce: DepositNonce, domain_id: DomainID) -> bool;
}
}
1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pallet-template = { path = "../pallets/template", default-features = false }
aga-access-segregator = { path = "../pallets/access-segregator", default-features = false }
aga-bridge = { path = "../pallets/bridge", default-features = false}
pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
aga-traits = { path = "../traits", default-features = false }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", optional = true }
Expand Down
9 changes: 8 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
mod assets_config;
mod contract_config;

use aga_traits::{DepositNonce, DomainID};
use pallet_grandpa::AuthorityId as GrandpaId;
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
Expand Down Expand Up @@ -695,7 +696,7 @@ impl_runtime_apis! {
Contracts::get_storage(address, key)
}
}

impl pallet_asset_conversion::AssetConversionApi<
Block,
Balance,
Expand All @@ -715,6 +716,12 @@ impl_runtime_apis! {
}
}

impl aga_bridge::AgaBridgeApi<Block> for Runtime {
fn is_proposal_executed(nonce: DepositNonce, domain_id: DomainID) -> bool {
AgaBridge::is_proposal_executed(nonce, domain_id)
}
}

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Expand Down

0 comments on commit 12f34a6

Please sign in to comment.