From d6dbb6003856f84291dd99a606128ac2e407b57e Mon Sep 17 00:00:00 2001 From: Piet Geursen Date: Fri, 16 Oct 2020 12:27:56 +1300 Subject: [PATCH] Upgrade to latest ssb-multiformats --- Cargo.toml | 2 +- src/go_offset_log.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5877f39..2552bd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde_bytes = "0.11.3" serde_cbor = "0.10.2" buffered_offset_reader = "0.6.0" bidir_iter = "0.2.1" -ssb-multiformats = "0.2.1" +ssb-multiformats = "0.4.0" [dev-dependencies] criterion = "0.3.0" diff --git a/src/go_offset_log.rs b/src/go_offset_log.rs index 9856dd3..cd96edf 100644 --- a/src/go_offset_log.rs +++ b/src/go_offset_log.rs @@ -8,7 +8,7 @@ use byteorder::{BigEndian, ReadBytesExt}; use serde_cbor::from_slice; use serde_cbor::Value as CborValue; use serde_json::{json, Value}; -use ssb_multiformats::multihash::{Multihash, Target}; +use ssb_multiformats::multihash::Multihash; use std::fs::{File, OpenOptions}; use std::io; use std::io::{Seek, SeekFrom}; @@ -47,7 +47,7 @@ impl<'a> GoMsgPackKey<'a> { pub fn to_legacy_string(&self) -> String { let mut arr = [0u8; 32]; arr.copy_from_slice(&self.hash[..32]); - let multi_hash = Multihash::from_sha256(arr, Target::Message); + let multi_hash = Multihash::Message(arr); multi_hash.to_legacy_string() } }