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:
Luke Parker
2023-11-25 04:02:47 -05:00
parent b296be8515
commit d60e007126
11 changed files with 23 additions and 26 deletions

View File

@@ -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);