Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hyper-transport url #488

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
* Fixed `HyperTransport` endpoint construction (`//` in the format `/api/v2//canister/5v3p4-iyaaa-aaaaa-qaaaa-cai/query`)

## [0.30.0] - 2023-11-07

Expand Down
10 changes: 5 additions & 5 deletions ic-agent/src/agent/http_transport/hyper_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ where
) -> AgentFuture<()> {
Box::pin(async move {
let url = format!(
"{}/canister/{effective_canister_id}/call",
"{}canister/{effective_canister_id}/call",
self.route_provider.route()?
);
self.request(Method::POST, url, Some(envelope)).await?;
Expand All @@ -226,7 +226,7 @@ where
) -> AgentFuture<Vec<u8>> {
Box::pin(async move {
let url = format!(
"{}/canister/{effective_canister_id}/read_state",
"{}canister/{effective_canister_id}/read_state",
self.route_provider.route()?
);
self.request(Method::POST, url, Some(envelope)).await
Expand All @@ -236,7 +236,7 @@ where
fn read_subnet_state(&self, subnet_id: Principal, envelope: Vec<u8>) -> AgentFuture<Vec<u8>> {
Box::pin(async move {
let url = format!(
"{}/subnet/{subnet_id}/read_state",
"{}subnet/{subnet_id}/read_state",
self.route_provider.route()?
);
self.request(Method::POST, url, Some(envelope)).await
Expand All @@ -246,7 +246,7 @@ where
fn query(&self, effective_canister_id: Principal, envelope: Vec<u8>) -> AgentFuture<Vec<u8>> {
Box::pin(async move {
let url = format!(
"{}/canister/{effective_canister_id}/query",
"{}canister/{effective_canister_id}/query",
self.route_provider.route()?
);
self.request(Method::POST, url, Some(envelope)).await
Expand All @@ -255,7 +255,7 @@ where

fn status(&self) -> AgentFuture<Vec<u8>> {
Box::pin(async move {
let url = format!("{}/status", self.route_provider.route()?);
let url = format!("{}status", self.route_provider.route()?);
self.request(Method::GET, url, None).await
})
}
Expand Down
Loading