Skip to content

Commit

Permalink
fix wasm ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0rek committed Nov 29, 2024
1 parent 55c5c5b commit 121e02d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 204 deletions.
196 changes: 1 addition & 195 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ void = "1.0.2"
web-time = "1.1.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
opendal = "0.50.2"

backoff = { version = "0.4.0", features = ["tokio"] }
blockstore = { workspace = true, features = ["redb"] }
tokio = { version = "1.38.0", features = ["fs", "rt-multi-thread", "time"] }
Expand Down
7 changes: 5 additions & 2 deletions types/src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ pub use self::msg_pay_for_blobs::MsgPayForBlobs;
pub use celestia_proto::celestia::blob::v1::MsgPayForBlobs as RawMsgPayForBlobs;
pub use celestia_proto::proto::blob::v1::BlobProto as RawBlob;
pub use celestia_proto::proto::blob::v1::BlobTx as RawBlobTx;
#[cfg(feature = "wasm-bindgen")]
#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
use wasm_bindgen::prelude::*;

/// Arbitrary data that can be stored in the network within certain [`Namespace`].
// NOTE: We don't use the `serde(try_from)` pattern for this type
// becase JSON representation needs to have `commitment` field but
// Protobuf definition doesn't.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen(getter_with_clone))]
#[cfg_attr(
all(feature = "wasm-bindgen", target_arch = "wasm32"),
wasm_bindgen(getter_with_clone)
)]
pub struct Blob {
/// A [`Namespace`] the [`Blob`] belongs to.
pub namespace: Namespace,
Expand Down
7 changes: 4 additions & 3 deletions types/src/blob/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use nmt_rs::NamespaceMerkleHasher;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use tendermint::crypto::sha256::HASH_SIZE;
use tendermint::{crypto, merkle};
#[cfg(feature = "wasm-bindgen")]
#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
use wasm_bindgen::prelude::*;

use crate::consts::appconsts;
Expand Down Expand Up @@ -53,15 +53,16 @@ use crate::{InfoByte, Share};
/// [`ExtendedDataSquare`]: crate::ExtendedDataSquare
/// [`share commitment rules`]: https://github.com/celestiaorg/celestia-app/blob/main/specs/src/specs/data_square_layout.md#blob-share-commitment-rules

#[cfg(not(feature = "wasm-bindgen"))]
#[cfg(not(all(feature = "wasm-bindgen", target_arch = "wasm32")))]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct Commitment {
pub hash: merkle::Hash,
}
#[cfg(feature = "wasm-bindgen")]
#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
#[wasm_bindgen]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct Commitment {
/// hash of the commitment
#[wasm_bindgen(skip)]
pub hash: merkle::Hash,
}
Expand Down
4 changes: 2 additions & 2 deletions types/src/nmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use cid::CidGeneric;
use multihash::Multihash;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use tendermint::hash::SHA256_HASH_SIZE;
#[cfg(feature = "wasm-bindgen")]
#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
use wasm_bindgen::prelude::*;

mod namespace_proof;
Expand Down Expand Up @@ -93,7 +93,7 @@ pub type Proof = nmt_rs::simple_merkle::proof::Proof<NamespacedSha2Hasher>;
/// - secondary reserved namespaces - those use version `0xff` so they are always placed after
/// user-submitted data.
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)]
#[cfg_attr(feature = "wasm-bindgen", wasm_bindgen)]
#[cfg_attr(all(feature = "wasm-bindgen", target_arch = "wasm32"), wasm_bindgen)]
pub struct Namespace(nmt_rs::NamespaceId<NS_SIZE>);

impl Namespace {
Expand Down

0 comments on commit 121e02d

Please sign in to comment.