pallet-hyperbridge

Crates.iopallet-hyperbridge
lib.rspallet-hyperbridge
version
sourcesrc
created_at2024-05-06 08:22:16.77754
updated_at2024-12-10 13:58:12.366848
descriptionPallet hyperbridge mediates the connection between hyperbridge and substrate-based chains.
homepagehttps://docs.hyperbridge.network/developers/polkadot/getting-started
repositoryhttps://github.com/polytope-labs/hyperbridge
max_upload_size
id1230978
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Core Devs (github:polytope-labs:core-devs)

documentation

https://docs.rs/pallet-hyperbridge

README

Pallet Hyperbridge

Pallet hyperbridge mediates the connection between hyperbridge and substrate-based chains. This pallet provides:

  • An [IsmpDispatcher] implementation which collects protocol fees and commits the reciepts for these fees to child storage. Hyperbridge only accepts messages that have been paid for using this module.
  • An [IsmpModule] which recieves and processes requests from hyperbridge. These requests are dispatched by hyperbridge governance and may adjust fees or request payouts for both relayers and protocol revenue.

This pallet contains no calls and dispatches no requests. Substrate based chains should use this to dispatch requests that should be processed by hyperbridge.

Usage

This module must be configured as an [IsmpModule] in your [IsmpRouter] implementation so that it may receive important messages from hyperbridge such as paramter updates or relayer fee withdrawals.

use ismp::Error;
use ismp::module::IsmpModule;
use ismp::router::IsmpRouter;
use pallet_hyperbridge::PALLET_HYPERBRIDGE_ID;

#[derive(Default)]
struct ModuleRouter;

impl IsmpRouter for ModuleRouter {
    fn module_for_id(&self, id: Vec<u8>) -> Result<Box<dyn IsmpModule>, Error> {
        return match id.as_slice() {
            PALLET_HYPERBRIDGE_ID => Ok(Box::new(pallet_hyperbridge::Pallet::<Runtime>::default())),
            _ => Err(Error::ModuleNotFound(id)),
        };
    }
}

License

This library is licensed under the Apache 2.0 License, Copyright (c) 2024 Polytope Labs.

Commit count: 710

cargo fmt