-
Notifications
You must be signed in to change notification settings - Fork 9
Refactor suggestions regarding relay modules #188
Comments
ConfirmBlockManagementError should be a Error, not a event. |
Currently, the implementation is ugly, very inefficiency. Relay encode the header things pass to Game, then Game call Relay to decode them. Such as We should eventually separate the APIs. Refactor the Game's protocol. Is possible to make Game an actual protocol? Like phragmen which defined in primitives. |
It might be a solution to implement a struct named struct Relayable {}
struct EthereumHeaderThing {}
struct TronHeaderThing{}
impl Into<Relayable> for EthereumHeaderThing{}
impl Into<Relayable> for TronHeaderThing{} Or use a trait and proc_macro struct Relayable {
header: String,
mmr: H256,
}
trait RelayableTrait {
fn relayable() -> Relayable
}
/// -snippet-
/// a proc macro
#[derive(Relayable)]
struct EthHeaderThing{}
#[derive(Relayable)]
struct TronHeaderThing{} |
Can we remove Then for We will not need encode/decode process between them then. Currently RelayerGame has chain storages, it's more like a pallet than a primitives library. |
The text was updated successfully, but these errors were encountered: