Skip to content

Commit

Permalink
Fix missed items in version API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrit committed Jul 10, 2023
1 parent a90e19e commit a5cf674
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 66 deletions.
1 change: 0 additions & 1 deletion proto/steward/v4/steward.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import "cellar_v2.proto";
service ContractCallService {
// Handles scheduled contract call submission
rpc Schedule(ScheduleRequest) returns (ScheduleResponse) {}
rpc Status(StatusRequest) returns (StatusResponse) {}
}

/*
Expand Down
16 changes: 1 addition & 15 deletions src/cork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use crate::{
ErrorKind::{self, *},
},
prelude::APP,
proto::{
self, schedule_request::CallData::*, ScheduleRequest, ScheduleResponse, StatusRequest,
StatusResponse,
},
proto::{self, schedule_request::CallData::*, ScheduleRequest, ScheduleResponse},
somm_send,
};
use abscissa_core::{
Expand All @@ -19,7 +16,6 @@ use abscissa_core::{
use deep_space::{Coin, Contact};
use ethers::types::H160;
use gravity_bridge::gravity_proto::cosmos_sdk_proto::cosmos::base::abci::v1beta1::TxResponse;
use lazy_static::lazy_static;
use sha3::{Digest, Keccak256};
use somm_proto::cork::Cork;
use std::time::Duration;
Expand All @@ -32,10 +28,6 @@ pub mod proposals;
const MESSAGE_TIMEOUT: Duration = Duration::from_secs(10);
const CHAIN_PREFIX: &str = "somm";

lazy_static! {
static ref STEWARD_VERSION: &'static str = env!("CARGO_PKG_VERSION");
}

pub struct CorkHandler;

#[async_trait]
Expand Down Expand Up @@ -85,12 +77,6 @@ impl proto::contract_call_service_server::ContractCallService for CorkHandler {
id: id_hash(height, &cellar_id, encoded_call),
}))
}

async fn status(&self, _: Request<StatusRequest>) -> Result<Response<StatusResponse>, Status> {
Ok(Response::new(StatusResponse {
version: STEWARD_VERSION.to_string(),
}))
}
}

pub fn get_encoded_call(request: ScheduleRequest) -> Result<Vec<u8>, Error> {
Expand Down
Binary file modified src/gen/proto/descriptor.bin
Binary file not shown.
50 changes: 0 additions & 50 deletions src/gen/proto/steward.v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3041,21 +3041,6 @@ pub mod contract_call_service_client {
http::uri::PathAndQuery::from_static("/steward.v4.ContractCallService/Schedule");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn status(
&mut self,
request: impl tonic::IntoRequest<super::StatusRequest>,
) -> Result<tonic::Response<super::StatusResponse>, 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("/steward.v4.ContractCallService/Status");
self.inner.unary(request.into_request(), path, codec).await
}
}
impl<T: Clone> Clone for ContractCallServiceClient<T> {
fn clone(&self) -> Self {
Expand Down Expand Up @@ -3209,10 +3194,6 @@ pub mod contract_call_service_server {
&self,
request: tonic::Request<super::ScheduleRequest>,
) -> Result<tonic::Response<super::ScheduleResponse>, tonic::Status>;
async fn status(
&self,
request: tonic::Request<super::StatusRequest>,
) -> Result<tonic::Response<super::StatusResponse>, tonic::Status>;
}
#[doc = ""]
#[doc = " Service for handling Cellar contract calls"]
Expand Down Expand Up @@ -3281,37 +3262,6 @@ pub mod contract_call_service_server {
};
Box::pin(fut)
}
"/steward.v4.ContractCallService/Status" => {
#[allow(non_camel_case_types)]
struct StatusSvc<T: ContractCallService>(pub Arc<T>);
impl<T: ContractCallService> tonic::server::UnaryService<super::StatusRequest> for StatusSvc<T> {
type Response = super::StatusResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::StatusRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).status(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let interceptor = inner.1.clone();
let inner = inner.0;
let method = StatusSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = if let Some(interceptor) = interceptor {
tonic::server::Grpc::with_interceptor(codec, interceptor)
} else {
tonic::server::Grpc::new(codec)
};
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => Box::pin(async move {
Ok(http::Response::builder()
.status(200)
Expand Down

0 comments on commit a5cf674

Please sign in to comment.