mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-16 08:57:36 +00:00
dockertest 0.5, correct errors from prior update commit
This commit is contained in:
parent
0d5756ffcf
commit
c1a9256cc5
15 changed files with 67 additions and 49 deletions
65
Cargo.lock
generated
65
Cargo.lock
generated
|
@ -459,8 +459,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "alloy-sol-type-parser"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4691da83dce9c9b4c775dd701c87759f173bd3021cbf2e60cde00c5fe6d7241"
|
||||
source = "git+https://github.com/alloy-rs/core?rev=446b9d2fbce12b88456152170709a3eaac929af0#446b9d2fbce12b88456152170709a3eaac929af0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"winnow 0.6.18",
|
||||
|
@ -1213,18 +1212,21 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bollard"
|
||||
version = "0.15.0"
|
||||
version = "0.17.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f03db470b3c0213c47e978da93200259a1eb4dae2e5512cba9955e2b540a6fc6"
|
||||
checksum = "d41711ad46fda47cd701f6908e59d1bd6b9a2b7464c0d0aeab95c6d37096ff8a"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"base64 0.22.1",
|
||||
"bollard-stubs",
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"hex",
|
||||
"http 0.2.12",
|
||||
"hyper 0.14.30",
|
||||
"http 1.1.0",
|
||||
"http-body-util",
|
||||
"hyper 1.4.1",
|
||||
"hyper-named-pipe",
|
||||
"hyper-util",
|
||||
"hyperlocal",
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
|
@ -1236,15 +1238,16 @@ dependencies = [
|
|||
"thiserror",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower-service",
|
||||
"url",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bollard-stubs"
|
||||
version = "1.43.0-rc.2"
|
||||
version = "1.45.0-rc.26.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b58071e8fd9ec1e930efd28e3a90c1251015872a2ce49f81f36421b86466932e"
|
||||
checksum = "6d7c5415e3a6bc6d3e99eff6268e488fd4ee25e7b28c10f08fa6760bd9de16e4"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_repr",
|
||||
|
@ -2227,20 +2230,22 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "dockertest"
|
||||
version = "0.4.0"
|
||||
source = "git+https://github.com/orcalabs/dockertest-rs?rev=4dd6ae24738aa6dc5c89444cc822ea4745517493#4dd6ae24738aa6dc5c89444cc822ea4745517493"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8648c989dfd460932144f0ce5c55ff35cf0de758f89ea20e3b3d0d3f5e1cce6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"base64 0.21.7",
|
||||
"base64 0.22.1",
|
||||
"bollard",
|
||||
"bytes",
|
||||
"dyn-clone",
|
||||
"futures",
|
||||
"lazy_static",
|
||||
"rand",
|
||||
"secrecy",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum 0.26.3",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
|
@ -3402,7 +3407,7 @@ dependencies = [
|
|||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project-lite",
|
||||
"socket2 0.4.10",
|
||||
"socket2 0.5.7",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
|
@ -3421,6 +3426,7 @@ dependencies = [
|
|||
"http 1.1.0",
|
||||
"http-body 1.0.1",
|
||||
"httparse",
|
||||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project-lite",
|
||||
"smallvec",
|
||||
|
@ -3428,6 +3434,21 @@ dependencies = [
|
|||
"want",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-named-pipe"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"hyper 1.4.1",
|
||||
"hyper-util",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-rustls"
|
||||
version = "0.27.3"
|
||||
|
@ -3468,15 +3489,17 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "hyperlocal"
|
||||
version = "0.8.0"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fafdf7b2b2de7c9784f76e02c0935e65a8117ec3b768644379983ab333ac98c"
|
||||
checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"hex",
|
||||
"hyper 0.14.30",
|
||||
"pin-project",
|
||||
"http-body-util",
|
||||
"hyper 1.4.1",
|
||||
"hyper-util",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3932,7 +3955,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-targets 0.48.5",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -11063,7 +11086,7 @@ version = "0.1.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -138,9 +138,6 @@ panic = "unwind"
|
|||
# https://github.com/rust-lang-nursery/lazy-static.rs/issues/201
|
||||
lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" }
|
||||
|
||||
# Needed due to dockertest's usage of `Rc`s when we need `Arc`s
|
||||
dockertest = { git = "https://github.com/orcalabs/dockertest-rs", rev = "4dd6ae24738aa6dc5c89444cc822ea4745517493" }
|
||||
|
||||
parking_lot_core = { path = "patches/parking_lot_core" }
|
||||
parking_lot = { path = "patches/parking_lot" }
|
||||
# wasmtime pulls in an old version for this
|
||||
|
@ -161,6 +158,9 @@ matches = { path = "patches/matches" }
|
|||
option-ext = { path = "patches/option-ext" }
|
||||
directories-next = { path = "patches/directories-next" }
|
||||
|
||||
# https://github.com/alloy-rs/core/issues/717
|
||||
alloy-sol-type-parser = { git = "https://github.com/alloy-rs/core", rev = "446b9d2fbce12b88456152170709a3eaac929af0" }
|
||||
|
||||
[workspace.lints.clippy]
|
||||
unwrap_or_default = "allow"
|
||||
borrow_as_ptr = "deny"
|
||||
|
|
|
@ -10,6 +10,7 @@ ignore = [
|
|||
"RUSTSEC-2020-0168", # mach is unmaintained
|
||||
"RUSTSEC-2021-0139", # https://github.com/serai-dex/serai/228
|
||||
"RUSTSEC-2022-0061", # https://github.com/serai-dex/serai/227
|
||||
"RUSTSEC-2024-0370", # proc-macro-error is unmaintained
|
||||
]
|
||||
|
||||
[licenses]
|
||||
|
@ -101,5 +102,5 @@ allow-git = [
|
|||
"https://github.com/rust-lang-nursery/lazy-static.rs",
|
||||
"https://github.com/serai-dex/substrate-bip39",
|
||||
"https://github.com/serai-dex/substrate",
|
||||
"https://github.com/orcalabs/dockertest-rs",
|
||||
"https://github.com/alloy-rs/core",
|
||||
]
|
||||
|
|
|
@ -6,7 +6,7 @@ use k256::{Scalar, ProjectivePoint};
|
|||
use frost::{curve::Secp256k1, Participant, ThresholdKeys, tests::key_gen as frost_key_gen};
|
||||
|
||||
use alloy_core::{
|
||||
primitives::{Address, U256, Bytes, TxKind},
|
||||
primitives::{Address, U256, Bytes, Signature, TxKind},
|
||||
hex::FromHex,
|
||||
};
|
||||
use alloy_consensus::{SignableTransaction, TxLegacy};
|
||||
|
@ -69,7 +69,7 @@ pub async fn send(
|
|||
);
|
||||
|
||||
let mut bytes = vec![];
|
||||
tx.encode_with_signature_fields(&sig.into(), &mut bytes);
|
||||
tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes);
|
||||
let pending_tx = provider.send_raw_transaction(&bytes).await.ok()?;
|
||||
pending_tx.get_receipt().await.ok()
|
||||
}
|
||||
|
|
|
@ -91,7 +91,6 @@ async fn latest_block_hash(client: &RootProvider<SimpleRequest>) -> [u8; 32] {
|
|||
.unwrap()
|
||||
.header
|
||||
.hash
|
||||
.unwrap()
|
||||
.0
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ sp-application-crypto = { git = "https://github.com/serai-dex/substrate", defaul
|
|||
|
||||
ethereum-serai = { path = "../networks/ethereum", default-features = false, features = ["tests"] }
|
||||
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../tests/docker" }
|
||||
|
||||
[features]
|
||||
|
|
|
@ -437,8 +437,7 @@ impl<D: Db> Network for Ethereum<D> {
|
|||
.map_err(|_| NetworkError::ConnectionError)?
|
||||
.ok_or(NetworkError::ConnectionError)?
|
||||
.header
|
||||
.number
|
||||
.unwrap();
|
||||
.number;
|
||||
// Error if there hasn't been a full epoch yet
|
||||
if actual_number < 32 {
|
||||
Err(NetworkError::ConnectionError)?
|
||||
|
@ -467,7 +466,6 @@ impl<D: Db> Network for Ethereum<D> {
|
|||
.ok_or(NetworkError::ConnectionError)?
|
||||
.header
|
||||
.hash
|
||||
.unwrap()
|
||||
.into()
|
||||
};
|
||||
|
||||
|
@ -480,7 +478,7 @@ impl<D: Db> Network for Ethereum<D> {
|
|||
.ok_or(NetworkError::ConnectionError)?
|
||||
.header;
|
||||
|
||||
let end_hash = end_header.hash.unwrap().into();
|
||||
let end_hash = end_header.hash.into();
|
||||
let time = end_header.timestamp;
|
||||
|
||||
Ok(Epoch { prior_end_hash, start: start.try_into().unwrap(), end_hash, time })
|
||||
|
@ -813,7 +811,6 @@ impl<D: Db> Network for Ethereum<D> {
|
|||
.unwrap()
|
||||
.header
|
||||
.number
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap()
|
||||
}
|
||||
|
@ -921,13 +918,13 @@ impl<D: Db> Network for Ethereum<D> {
|
|||
.into(),
|
||||
};
|
||||
|
||||
use ethereum_serai::alloy::consensus::SignableTransaction;
|
||||
use ethereum_serai::alloy::{primitives::Signature, consensus::SignableTransaction};
|
||||
let sig = k256::ecdsa::SigningKey::from(k256::elliptic_curve::NonZeroScalar::new(key).unwrap())
|
||||
.sign_prehash_recoverable(tx.signature_hash().as_ref())
|
||||
.unwrap();
|
||||
|
||||
let mut bytes = vec![];
|
||||
tx.encode_with_signature_fields(&sig.into(), &mut bytes);
|
||||
tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes);
|
||||
let pending_tx = self.provider.send_raw_transaction(&bytes).await.ok().unwrap();
|
||||
|
||||
// Mine an epoch containing this TX
|
||||
|
|
|
@ -53,7 +53,7 @@ schnorrkel = { path = "../../crypto/schnorrkel", package = "frost-schnorrkel" }
|
|||
|
||||
tokio = "1"
|
||||
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../../tests/docker" }
|
||||
|
||||
[features]
|
||||
|
|
|
@ -39,6 +39,6 @@ borsh = { version = "1", features = ["de_strict_order"] }
|
|||
|
||||
tokio = { version = "1", features = ["time"] }
|
||||
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../docker" }
|
||||
serai-message-queue-tests = { path = "../message-queue" }
|
||||
|
|
|
@ -40,7 +40,7 @@ serai-client = { path = "../../substrate/client", features = ["serai"] }
|
|||
|
||||
tokio = { version = "1", features = ["time"] }
|
||||
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../docker" }
|
||||
serai-message-queue-tests = { path = "../message-queue" }
|
||||
serai-processor-tests = { path = "../processor" }
|
||||
|
|
|
@ -28,5 +28,5 @@ serai-primitives = { path = "../../substrate/primitives" }
|
|||
serai-message-queue = { path = "../../message-queue" }
|
||||
|
||||
tokio = { version = "1", features = ["time"] }
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../docker" }
|
||||
|
|
|
@ -48,6 +48,6 @@ tokio = { version = "1", features = ["time"] }
|
|||
|
||||
processor = { package = "serai-processor", path = "../../processor", features = ["bitcoin", "ethereum", "monero"] }
|
||||
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../docker" }
|
||||
serai-message-queue-tests = { path = "../message-queue" }
|
||||
|
|
|
@ -378,8 +378,7 @@ impl Coordinator {
|
|||
.unwrap()
|
||||
.unwrap()
|
||||
.header
|
||||
.number
|
||||
.unwrap();
|
||||
.number;
|
||||
// We mine 96 blocks to mine one epoch, then cause its finalization
|
||||
provider.raw_request::<_, ()>("anvil_mine".into(), [96]).await.unwrap();
|
||||
let end_of_epoch = start + 31;
|
||||
|
@ -389,8 +388,7 @@ impl Coordinator {
|
|||
.unwrap()
|
||||
.unwrap()
|
||||
.header
|
||||
.hash
|
||||
.unwrap();
|
||||
.hash;
|
||||
|
||||
let state = provider
|
||||
.raw_request::<_, String>("anvil_dumpState".into(), ())
|
||||
|
|
|
@ -305,7 +305,7 @@ impl Wallet {
|
|||
use std::sync::Arc;
|
||||
use ethereum_serai::{
|
||||
alloy::{
|
||||
primitives::{U256, TxKind},
|
||||
primitives::{U256, Signature, TxKind},
|
||||
sol_types::SolCall,
|
||||
simple_request_transport::SimpleRequest,
|
||||
consensus::{TxLegacy, SignableTransaction},
|
||||
|
@ -355,7 +355,7 @@ impl Wallet {
|
|||
.unwrap();
|
||||
|
||||
let mut bytes = vec![];
|
||||
tx.encode_with_signature_fields(&sig, &mut bytes);
|
||||
tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes);
|
||||
let _ = provider.send_raw_transaction(&bytes).await.unwrap();
|
||||
|
||||
provider.raw_request::<_, ()>("anvil_mine".into(), [96]).await.unwrap();
|
||||
|
@ -395,7 +395,7 @@ impl Wallet {
|
|||
.unwrap();
|
||||
|
||||
let mut bytes = vec![];
|
||||
tx.encode_with_signature_fields(&sig.into(), &mut bytes);
|
||||
tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes);
|
||||
|
||||
// We drop the bottom 10 decimals
|
||||
(
|
||||
|
|
|
@ -20,7 +20,7 @@ workspace = true
|
|||
rand_core = "0.6"
|
||||
hex = "0.4"
|
||||
|
||||
dockertest = "0.4"
|
||||
dockertest = "0.5"
|
||||
serai-docker-tests = { path = "../docker" }
|
||||
|
||||
tokio = { version = "1", features = ["time"] }
|
||||
|
|
Loading…
Reference in a new issue