Skip to content

Commit

Permalink
fix(proto): change buf export order to avoid file overwrite issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aelesbao committed Oct 31, 2024
1 parent 6048743 commit 39b27bc
Show file tree
Hide file tree
Showing 9 changed files with 8,856 additions and 9,437 deletions.
2 changes: 1 addition & 1 deletion packages/proto/src/gen/ARCHWAY_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.0.0-alpha.5
v9.0.0
2 changes: 1 addition & 1 deletion packages/proto/src/gen/COSMOS_SDK_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.50.9
v0.50.10
2 changes: 1 addition & 1 deletion packages/proto/src/gen/WASMD_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dba033ab1eeb6d18147493395c745af7d04309f4
v0.50.2-archway
209 changes: 65 additions & 144 deletions packages/proto/src/gen/cosmos.base.v1beta1.rs

Large diffs are not rendered by default.

9,006 changes: 4,393 additions & 4,613 deletions packages/proto/src/gen/cosmwasm.wasm.v1.abstract.rs

Large diffs are not rendered by default.

9,006 changes: 4,393 additions & 4,613 deletions packages/proto/src/gen/cosmwasm.wasm.v1.rs

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions packages/proto/src/gen/cosmwasm.wasm.v1.tonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,24 +302,6 @@ pub mod query_client {
));
self.inner.unary(req, path, codec).await
}
pub async fn build_address(
&mut self,
request: impl tonic::IntoRequest<super::QueryBuildAddressRequest>,
) -> std::result::Result<tonic::Response<super::QueryBuildAddressResponse>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/BuildAddress");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmwasm.wasm.v1.Query", "BuildAddress"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
Expand Down Expand Up @@ -381,10 +363,6 @@ pub mod query_server {
tonic::Response<super::QueryContractsByCreatorResponse>,
tonic::Status,
>;
async fn build_address(
&self,
request: tonic::Request<super::QueryBuildAddressRequest>,
) -> std::result::Result<tonic::Response<super::QueryBuildAddressResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct QueryServer<T: Query> {
Expand Down Expand Up @@ -908,45 +886,6 @@ pub mod query_server {
};
Box::pin(fut)
}
"/cosmwasm.wasm.v1.Query/BuildAddress" => {
#[allow(non_camel_case_types)]
struct BuildAddressSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryBuildAddressRequest> for BuildAddressSvc<T> {
type Response = super::QueryBuildAddressResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::QueryBuildAddressRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut =
async move { <T as Query>::build_address(&inner, request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = BuildAddressSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => Box::pin(async move {
Ok(http::Response::builder()
.status(200)
Expand Down
2 changes: 1 addition & 1 deletion proto-build/src/commands/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pub fn export(submodules_dir: &Path, proto_dir: &Path) {
fs::remove_dir_all(proto_dir).unwrap();
}

run_buf_export(submodules_dir, WASMD_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, ARCHWAY_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, COSMOS_SDK_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, IBC_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, WASMD_DIR, proto_dir).unwrap();
}
3 changes: 1 addition & 2 deletions proto-build/src/commands/update_submodules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use crate::utils::run::run_git;
use std::path::Path;

pub fn update_submodules(submodules_dir: &Path) {
run_git(["submodule", "update", "--init"]).unwrap();
run_git(["submodule", "foreach", "git", "fetch"]).unwrap();
run_git(["submodule", "update", "--init", "--remote", "--checkout"]).unwrap();

println!("Updating archway-network/archway submodule...");
let archway_dir = submodules_dir.join(ARCHWAY_DIR);
Expand Down

0 comments on commit 39b27bc

Please sign in to comment.