Skip to content

Commit

Permalink
fix!: Remove stdweb feature from instant crate to circumvent downst…
Browse files Browse the repository at this point in the history
…ream issues with `stdweb/wasm-bindgen` (#86)
  • Loading branch information
jsantell authored May 22, 2023
1 parent f75b00a commit 67ec64d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ucan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ base64 = "0.21"
bs58 = "0.4"
cid = "0.10"
futures = "0.3"
instant = { version = "0.1", features = ["wasm-bindgen", "stdweb"] }
instant = { version = "0.1", features = ["wasm-bindgen"] }
libipld-core = { version = "0.16", features = ["serde-codec", "serde"] }
libipld-json = "0.16"
log = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions ucan/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub trait UcanJwtStore: UcanStore<RawCodec> {
}

async fn read_token(&self, cid: &Cid) -> Result<Option<String>> {
let codec = RawCodec::default();
let codec = RawCodec;

if cid.codec() != u64::from(codec) {
return Err(anyhow!(
Expand Down Expand Up @@ -105,7 +105,7 @@ pub struct MemoryStore {
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl UcanStore<RawCodec> for MemoryStore {
async fn read<T: Decode<RawCodec>>(&self, cid: &Cid) -> Result<Option<T>> {
let codec = RawCodec::default();
let codec = RawCodec;
let dags = self.dags.lock().map_err(|_| anyhow!("poisoned mutex!"))?;

Ok(match dags.get(cid) {
Expand All @@ -118,7 +118,7 @@ impl UcanStore<RawCodec> for MemoryStore {
&mut self,
token: T,
) -> Result<Cid> {
let codec = RawCodec::default();
let codec = RawCodec;
let block = codec.encode(&token)?;
let cid = Cid::new_v1(codec.into(), Code::Blake2b256.digest(&block));

Expand Down
2 changes: 1 addition & 1 deletion ucan/src/ucan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl TryFrom<&Ucan> for Cid {
type Error = anyhow::Error;

fn try_from(value: &Ucan) -> Result<Self, Self::Error> {
let codec = RawCodec::default();
let codec = RawCodec;
let token = value.encode()?;
let encoded = codec.encode(token.as_bytes())?;

Expand Down

0 comments on commit 67ec64d

Please sign in to comment.