Skip to content

Commit

Permalink
fix wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0rek committed Nov 21, 2024
1 parent 299ce05 commit d961f49
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 39 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ prost.workspace = true
celestia-grpc-macros = { version = "0.1.0", path = "grpc-macros" }

hex = "0.4.3"
serde = "1.0.215"
k256 = "0.13.4"
pbjson-types = "0.7.0"
serde = "1.0.215"
thiserror = "1.0.61"
tonic = { version = "0.12.3", default-features = false, features = [
"codegen", "prost"
]}
pbjson-types = "0.7.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
anyhow = "1.0.86"
Expand Down
30 changes: 0 additions & 30 deletions grpc/src/types/pagination.rs

This file was deleted.

2 changes: 1 addition & 1 deletion grpc/tests/tonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async fn submit_blob() {

let (address, keypair) = load_account(BRIDGE_0_DATA);
let namespace = Namespace::new_v0(&[1, 2, 3]).unwrap();
let blobs = vec![Blob::new(namespace, "Hello, World!".into(), AppVersion::V1).unwrap()];
let blobs = vec![Blob::new(namespace, "Hello, World!".into(), AppVersion::V3).unwrap()];
let chain_id = "private".to_string();
let account = client.get_account(address.clone()).await.unwrap();

Expand Down
2 changes: 0 additions & 2 deletions grpc/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ pub fn load_account(path: &str) -> (String, AccountKeypair) {

let account = fs::read_to_string(account_file).expect("file with account name to exists");
let hex_encoded_key = fs::read_to_string(key_file).expect("file with plaintext key to exists");
//let (_label, key_material) = SecretDocument::read_pem_file(key_file).expect("valid private key file");
//let key : EcPrivateKey = key_material.try_into().expect("valid key data");

let signing_key = SigningKey::from_slice(
&hex::decode(hex_encoded_key.trim()).expect("valid hex representation"),
Expand Down
1 change: 1 addition & 0 deletions proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static EXTERN_PATHS: &[(&str, &str)] = &[
(".tendermint", "::celestia_tendermint_proto::v0_34"),
(".google.protobuf.Timestamp", "::celestia_tendermint_proto::google::protobuf::Timestamp"),
(".google.protobuf.Duration", "::celestia_tendermint_proto::google::protobuf::Duration"),
#[cfg(feature = "tonic")]
(".google.protobuf.Any", "::pbjson_types::Any"),
];

Expand Down
3 changes: 3 additions & 0 deletions proto/src/serializers/option_any.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! [`serde`] serializer for the optional [`Any`].
#[cfg(feature = "tonic")]
use pbjson_types::Any;
#[cfg(not(feature = "tonic"))]
use prost_types::Any;

use serde::{Deserialize, Deserializer, Serialize, Serializer};
Expand Down
1 change: 0 additions & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ categories = [
[dependencies]
celestia-tendermint-proto.workspace = true
celestia-types.workspace = true
celestia-proto = { optional = true, workspace = true }
celestia-tendermint.workspace = true
prost.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ default = ["p2p"]
p2p = ["dep:libp2p-identity", "dep:multiaddr", "dep:serde_repr"]
test-utils = ["dep:ed25519-consensus", "dep:rand"]
wasm-bindgen = ["celestia-tendermint/wasm-bindgen"]
tonic = ["dep:pbjson-types"]
tonic = ["dep:pbjson-types", "celestia-proto/tonic"]

[package.metadata.docs.rs]
features = ["p2p", "test-utils"]
Expand Down
3 changes: 3 additions & 0 deletions types/src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! types related to accounts
#[cfg(feature = "tonic")]
use pbjson_types::Any;
#[cfg(not(feature = "tonic"))]
use prost_types::Any;
use prost::Message;

use celestia_proto::cosmos::crypto::ed25519::PubKey as Ed25519PubKey;
Expand Down
5 changes: 4 additions & 1 deletion types/src/tx.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//! Types associated with submitting and querying transaction
use celestia_tendermint_proto::Protobuf;
#[cfg(feature = "tonic")]
use pbjson_types::Any;
#[cfg(not(feature = "tonic"))]
use prost_types::Any;

use celestia_tendermint_proto::Protobuf;
use celestia_proto::cosmos::tx::v1beta1::{
AuthInfo as RawAuthInfo, Fee, SignerInfo, TxBody as RawTxBody,
};
Expand Down

0 comments on commit d961f49

Please sign in to comment.