mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 17:40:34 +00:00
Fixes for prior commit
This commit is contained in:
parent
08e6669403
commit
88a1726399
6 changed files with 30 additions and 46 deletions
|
@ -318,7 +318,6 @@ async fn dkg_test() {
|
||||||
let spec = spec.clone();
|
let spec = spec.clone();
|
||||||
let key_pair = key_pair.clone();
|
let key_pair = key_pair.clone();
|
||||||
async move {
|
async move {
|
||||||
let tx = tx.0;
|
|
||||||
// Version, Pallet, Call, Network, Key Pair, Signature
|
// Version, Pallet, Call, Network, Key Pair, Signature
|
||||||
let expected_len = 1 + 1 + 1 + 1 + 32 + 1 + key_pair.1.len() + 64;
|
let expected_len = 1 + 1 + 1 + 1 + 32 + 1 + key_pair.1.len() + 64;
|
||||||
// It's length prefixed
|
// It's length prefixed
|
||||||
|
|
|
@ -10,7 +10,6 @@ use scale::{Encode, Decode};
|
||||||
use serai_client::{
|
use serai_client::{
|
||||||
Public, Signature,
|
Public, Signature,
|
||||||
validator_sets::primitives::{ValidatorSet, KeyPair},
|
validator_sets::primitives::{ValidatorSet, KeyPair},
|
||||||
subxt::utils::Encoded,
|
|
||||||
SeraiValidatorSets,
|
SeraiValidatorSets,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,7 +137,7 @@ pub(crate) async fn handle_application_tx<
|
||||||
D: Db,
|
D: Db,
|
||||||
Pro: Processors,
|
Pro: Processors,
|
||||||
FPst: Future<Output = ()>,
|
FPst: Future<Output = ()>,
|
||||||
PST: Clone + Fn(ValidatorSet, Encoded) -> FPst,
|
PST: Clone + Fn(ValidatorSet, Vec<u8>) -> FPst,
|
||||||
FRid: Future<Output = ()>,
|
FRid: Future<Output = ()>,
|
||||||
RID: RIDTrait<FRid>,
|
RID: RIDTrait<FRid>,
|
||||||
>(
|
>(
|
||||||
|
|
|
@ -8,7 +8,7 @@ use ciphersuite::{Ciphersuite, Ristretto};
|
||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
|
|
||||||
use scale::{Encode, Decode};
|
use scale::{Encode, Decode};
|
||||||
use serai_client::{validator_sets::primitives::ValidatorSet, subxt::utils::Encoded, Serai};
|
use serai_client::{validator_sets::primitives::ValidatorSet, Serai};
|
||||||
|
|
||||||
use serai_db::DbTxn;
|
use serai_db::DbTxn;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ async fn handle_block<
|
||||||
D: Db,
|
D: Db,
|
||||||
Pro: Processors,
|
Pro: Processors,
|
||||||
FPst: Future<Output = ()>,
|
FPst: Future<Output = ()>,
|
||||||
PST: Clone + Fn(ValidatorSet, Encoded) -> FPst,
|
PST: Clone + Fn(ValidatorSet, Vec<u8>) -> FPst,
|
||||||
FRid: Future<Output = ()>,
|
FRid: Future<Output = ()>,
|
||||||
RID: RIDTrait<FRid>,
|
RID: RIDTrait<FRid>,
|
||||||
P: P2p,
|
P: P2p,
|
||||||
|
@ -134,7 +134,7 @@ pub(crate) async fn handle_new_blocks<
|
||||||
D: Db,
|
D: Db,
|
||||||
Pro: Processors,
|
Pro: Processors,
|
||||||
FPst: Future<Output = ()>,
|
FPst: Future<Output = ()>,
|
||||||
PST: Clone + Fn(ValidatorSet, Encoded) -> FPst,
|
PST: Clone + Fn(ValidatorSet, Vec<u8>) -> FPst,
|
||||||
FRid: Future<Output = ()>,
|
FRid: Future<Output = ()>,
|
||||||
RID: RIDTrait<FRid>,
|
RID: RIDTrait<FRid>,
|
||||||
P: P2p,
|
P: P2p,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
use core::ops::Deref;
|
||||||
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use futures::stream::{Stream, StreamExt};
|
use futures::stream::{Stream, StreamExt};
|
||||||
|
|
|
@ -210,16 +210,12 @@ async fn sign_test() {
|
||||||
// Fund the new account to pay for fees
|
// Fund the new account to pay for fees
|
||||||
let balance = Balance { coin: Coin::Serai, amount: Amount(1_000_000_000) };
|
let balance = Balance { coin: Coin::Serai, amount: Amount(1_000_000_000) };
|
||||||
serai
|
serai
|
||||||
.publish(
|
.publish(&serai.sign(
|
||||||
&serai
|
&PairSigner::new(insecure_pair_from_name("Ferdie")),
|
||||||
.sign(
|
&SeraiCoins::transfer(address, balance),
|
||||||
&PairSigner::new(insecure_pair_from_name("Ferdie")),
|
0,
|
||||||
&SeraiCoins::transfer(address, balance),
|
Default::default(),
|
||||||
0,
|
))
|
||||||
Default::default(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
@ -275,16 +271,12 @@ async fn sign_test() {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
serai
|
serai
|
||||||
.publish(
|
.publish(&serai.sign(
|
||||||
&serai
|
&serai_pair,
|
||||||
.sign(
|
&SeraiCoins::burn_with_instruction(out_instruction.clone()),
|
||||||
&serai_pair,
|
0,
|
||||||
&SeraiCoins::burn_with_instruction(out_instruction.clone()),
|
Default::default(),
|
||||||
0,
|
))
|
||||||
Default::default(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
|
@ -248,16 +248,12 @@ async fn mint_and_burn_test() {
|
||||||
// Fund the new account to pay for fees
|
// Fund the new account to pay for fees
|
||||||
let balance = Balance { coin: Coin::Serai, amount: Amount(1_000_000_000) };
|
let balance = Balance { coin: Coin::Serai, amount: Amount(1_000_000_000) };
|
||||||
serai
|
serai
|
||||||
.publish(
|
.publish(&serai.sign(
|
||||||
&serai
|
&PairSigner::new(insecure_pair_from_name("Ferdie")),
|
||||||
.sign(
|
&SeraiCoins::transfer(address, balance),
|
||||||
&PairSigner::new(insecure_pair_from_name("Ferdie")),
|
0,
|
||||||
&SeraiCoins::transfer(address, balance),
|
Default::default(),
|
||||||
0,
|
))
|
||||||
Default::default(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
@ -506,16 +502,12 @@ async fn mint_and_burn_test() {
|
||||||
};
|
};
|
||||||
|
|
||||||
serai
|
serai
|
||||||
.publish(
|
.publish(&serai.sign(
|
||||||
&serai
|
serai_pair,
|
||||||
.sign(
|
&SeraiCoins::burn_with_instruction(out_instruction),
|
||||||
serai_pair,
|
nonce,
|
||||||
&SeraiCoins::burn_with_instruction(out_instruction),
|
Default::default(),
|
||||||
nonce,
|
))
|
||||||
Default::default(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue