Skip to content

Commit

Permalink
Finish merging develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Jun 24, 2024
1 parent ad70bce commit 28edc66
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion substrate/abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ frame-support = { git = "https://github.com/serai-dex/substrate", default-featur
serai-primitives = { path = "../primitives", version = "0.1", default-features = false }
serai-coins-primitives = { path = "../coins/primitives", version = "0.1", default-features = false }
serai-validator-sets-primitives = { path = "../validator-sets/primitives", version = "0.1", default-features = false }
serai-genesis-liquidity-primitives = { path = "../genesis-liquidity/primitives", version = "0.1" }
serai-genesis-liquidity-primitives = { path = "../genesis-liquidity/primitives", version = "0.1", default-features = false }
serai-in-instructions-primitives = { path = "../in-instructions/primitives", version = "0.1", default-features = false }
serai-signals-primitives = { path = "../signals/primitives", version = "0.1", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion substrate/client/src/serai/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Serai {
let validators: String = self
.call("state_call", ["SeraiRuntimeApi_validators".to_string(), hex::encode(network.encode())])
.await?;
let bytes = hex_decode(hash)
let bytes = hex_decode(validators)
.map_err(|_| SeraiError::InvalidNode("expected hex from node wasn't hex".to_string()))?;
let r = Vec::<Public>::decode(&mut bytes.as_slice())
.map_err(|e| SeraiError::ErrorInResponse(e.to_string()))?;
Expand Down
1 change: 1 addition & 0 deletions substrate/genesis-liquidity/pallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ std = [
"genesis-liquidity-primitives/std",
"validator-sets-primitives/std",
]
try-runtime = [] # TODO
fast-epoch = []

default = ["std"]
22 changes: 21 additions & 1 deletion substrate/runtime/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serai_abi::Call;
use crate::{
Vec,
primitives::{PublicKey, SeraiAddress},
timestamp, coins, dex,
timestamp, coins, dex, genesis_liquidity,
validator_sets::{self, MembershipProof},
in_instructions, signals, babe, grandpa, RuntimeCall,
};
Expand Down Expand Up @@ -89,6 +89,17 @@ impl From<Call> for RuntimeCall {
send_to: send_to.into(),
}),
},
Call::GenesisLiquidity(gl) => match gl {
serai_abi::genesis_liquidity::Call::remove_coin_liquidity { balance } => {
RuntimeCall::GenesisLiquidity(genesis_liquidity::Call::remove_coin_liquidity { balance })
}
serai_abi::genesis_liquidity::Call::set_initial_price { prices, signature } => {
RuntimeCall::GenesisLiquidity(genesis_liquidity::Call::set_initial_price {
prices,
signature,
})
}
},
Call::ValidatorSets(vs) => match vs {
serai_abi::validator_sets::Call::set_keys {
network,
Expand Down Expand Up @@ -261,6 +272,15 @@ impl TryInto<Call> for RuntimeCall {
}
_ => Err(())?,
}),
RuntimeCall::GenesisLiquidity(call) => Call::GenesisLiquidity(match call {
genesis_liquidity::Call::remove_coin_liquidity { balance } => {
serai_abi::genesis_liquidity::Call::remove_coin_liquidity { balance }
}
genesis_liquidity::Call::set_initial_price { prices, signature } => {
serai_abi::genesis_liquidity::Call::set_initial_price { prices, signature }
}
_ => Err(())?,
}),
RuntimeCall::ValidatorSets(call) => Call::ValidatorSets(match call {
validator_sets::Call::set_keys { network, removed_participants, key_pair, signature } => {
serai_abi::validator_sets::Call::set_keys {
Expand Down

0 comments on commit 28edc66

Please sign in to comment.