mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Add a binaries feature to the processor to reduce dependencies when used as a lib
processor isn't intended to be used as a library, yet serai-processor-tests does pull it in as a lib. This caused serai-processor-tests to need to compile rocksdb, which added multiple minutes to the compilation time.
This commit is contained in:
@@ -23,9 +23,10 @@ hex = "0.4"
|
||||
scale = { package = "parity-scale-codec", version = "3" }
|
||||
scale-info = { version = "2", optional = true }
|
||||
|
||||
sp-core = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-runtime = { git = "https://github.com/serai-dex/substrate" }
|
||||
serai-runtime = { path = "../runtime", version = "0.1" }
|
||||
|
||||
sp-core = { git = "https://github.com/serai-dex/substrate" }
|
||||
subxt = { version = "0.29", default-features = false, features = ["jsonrpsee-ws"], optional = true }
|
||||
|
||||
bitcoin = { version = "0.31", optional = true }
|
||||
|
||||
@@ -168,15 +168,14 @@ impl Serai {
|
||||
const TX_VERSION: u32 = 1;
|
||||
const EXTRINSIC_FORMAT_VERSION: u8 = 4;
|
||||
|
||||
let era = subxt::config::substrate::Era::Immortal;
|
||||
let era = sp_runtime::generic::Era::Immortal;
|
||||
let extra = (era, Compact(nonce), tip);
|
||||
let genesis = self.0.genesis_hash();
|
||||
let mortality_checkpoint = genesis;
|
||||
let mut signature_payload =
|
||||
(call, extra, SPEC_VERSION, TX_VERSION, genesis, mortality_checkpoint).encode();
|
||||
if signature_payload.len() > 256 {
|
||||
use subxt::config::Hasher;
|
||||
signature_payload = BlakeTwo256::hash(&signature_payload).0.to_vec();
|
||||
signature_payload = sp_core::blake2_256(&signature_payload).to_vec();
|
||||
}
|
||||
let signature = signer.sign(&signature_payload);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ serai-primitives = { path = "../../primitives", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false }
|
||||
|
||||
[features]
|
||||
std = ["zeroize", "borsh?/std", "serde/std", "scale/std", "scale-info/std", "sp-runtime/std", "serai-primitives/std"]
|
||||
std = ["zeroize", "borsh?/std", "serde?/std", "scale/std", "scale-info/std", "sp-runtime/std", "serai-primitives/std"]
|
||||
borsh = ["dep:borsh", "serai-primitives/borsh"]
|
||||
serde = ["dep:serde", "serai-primitives/serde"]
|
||||
default = ["std"]
|
||||
|
||||
Reference in New Issue
Block a user