Use scale instead of bincode throughout processor-messages/processor DB

scale is canonical, bincode is not.
This commit is contained in:
Luke Parker
2023-09-02 07:53:14 -04:00
parent f7e49e1f90
commit 7d8e08d5b4
6 changed files with 39 additions and 43 deletions

View File

@@ -11,6 +11,7 @@ use frost::{
use log::{info, debug, warn, error};
use scale::Encode;
use messages::sign::*;
use crate::{
Get, DbTxn, Db,
@@ -74,7 +75,7 @@ impl<N: Network, D: Db> SignerDb<N, D> {
}
fn attempt_key(id: &SignId) -> Vec<u8> {
Self::sign_key(b"attempt", bincode::serialize(id).unwrap())
Self::sign_key(b"attempt", id.encode())
}
fn attempt(txn: &mut D::Transaction<'_>, id: &SignId) {
txn.put(Self::attempt_key(id), []);