Skip to content

Commit 8280756

Browse files
committed
Updates
1 parent 4dabdbe commit 8280756

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/client/src/bin/http_server.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use options_rpc::data_structures::{
1111
async fn info(item: web::Json<ContractId>, args: Data<ClientArgs>) -> HttpResponse {
1212
let db = args.read_options_db();
1313
let e_cli = args.elements_cli();
14-
let contract = db.get(&item.id).unwrap();
14+
let contract = db.get(&item.contract_id).unwrap();
1515
let info = InfoResponse::from_contract(&contract, &e_cli);
1616
HttpResponse::Ok().json(info) // <- send response
1717
}
@@ -109,6 +109,7 @@ async fn main() -> std::io::Result<()> {
109109
.service(web::resource("/init").route(web::post().to(init)))
110110
.service(web::resource("/fund").route(web::post().to(fund)))
111111
.service(web::resource("/cancel").route(web::post().to(cancel)))
112+
.service(web::resource("/expire").route(web::post().to(expiry)))
112113
.service(web::resource("/expiry").route(web::post().to(expiry)))
113114
.service(web::resource("/exercise").route(web::post().to(exercise)))
114115
.service(web::resource("/settle").route(web::post().to(settle)))

src/client/src/data_structures.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::utils;
1919
#[derive(Args, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
2020
pub struct ContractId {
2121
/// Contract Id
22-
pub id: sha256::Hash,
22+
pub contract_id: sha256::Hash,
2323
}
2424

2525
#[derive(Debug, Clone, Args, Serialize, Deserialize)]
@@ -72,7 +72,7 @@ pub struct QueryResponse {
7272

7373
#[derive(Debug, Clone, Serialize, Deserialize)]
7474
pub struct InfoResponse {
75-
pub id: sha256::Hash,
75+
pub contract_id: sha256::Hash,
7676
pub coll_asset: AssetId,
7777
pub settle_asset: AssetId,
7878
pub contract_size: u64,
@@ -87,7 +87,7 @@ pub struct InfoResponse {
8787
impl InfoResponse {
8888
pub fn from_contract(contract: &OptionsContract, e_cli: &Client) -> Self {
8989
InfoResponse {
90-
id: contract.id(),
90+
contract_id: contract.id(),
9191
coll_asset: contract.params().coll_asset,
9292
settle_asset: contract.params().settle_asset,
9393
contract_size: contract.params().contract_size,

0 commit comments

Comments
 (0)