Skip to content

Commit

Permalink
chore: bump protos
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrobot committed Feb 12, 2025
1 parent a0a5f45 commit b34157b
Show file tree
Hide file tree
Showing 32 changed files with 2,410 additions and 2,235 deletions.
43 changes: 43 additions & 0 deletions packages/injective-std/src/aux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use cosmwasm_std::{Binary, CosmosMsg, Deps, QueryRequest, StdResult};
use prost_types::Timestamp as TimestampGen;
use serde::de::DeserializeOwned;

/// makes a stargate query by a given path and req and returns a response deserialised into a
/// given response model.
///
/// * **req** is a proto request model. Most likely it's a result of proto code generation;
/// * **path** is an RPC request path. Should be one of allowlisted stargate query paths;
///
/// Since stargate query results are JSON-encoded instead of protobuf-encoded, the Res is
/// expected to have a serde::de::DeserializeOwned trait. Why JSON, not proto? See the link:
/// <https://github.com/CosmWasm/wasmd/blob/6f6be7880f1caa666b86aaafea625208d70675dc/x/wasm/keeper/query_plugins.go#L360>
pub fn make_stargate_query<Req, Res>(deps: Deps, path: &str, req: Req) -> StdResult<Res>
where
Req: prost::Message,
Res: DeserializeOwned,
{
deps.querier.query(&QueryRequest::Stargate {
path: path.to_string(),
data: req.encode_to_vec().into(),
})
}

/// creates a CosmosMsg::Stargate with given request payload and path.
///
/// * **req** is a proto request model. Most likely it's a result of proto code generation;
/// * **path** is an RPC request path. See Msg service definitions in neutron modules' proto files
/// for additional info.
pub fn create_stargate_msg<Req: prost::Message, T>(path: &str, req: Req) -> CosmosMsg<T> {
CosmosMsg::Stargate::<T> {
type_url: path.to_string(),
value: Binary::from(req.encode_to_vec()),
}
}

/// creates a prost_types::Timestamp from a given unix timestamp value in seconds.
pub(crate) fn proto_timestamp_from_i64(timestamp: i64) -> TimestampGen {
TimestampGen {
seconds: timestamp,
nanos: 0,
}
}
2 changes: 0 additions & 2 deletions packages/injective-std/src/types/cosmos/auth/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion packages/injective-std/src/types/cosmos/auth/module/mod.rs

This file was deleted.

29 changes: 0 additions & 29 deletions packages/injective-std/src/types/cosmos/auth/module/v1.rs

This file was deleted.

Loading

0 comments on commit b34157b

Please sign in to comment.