diff --git a/packages/data-requests/src/data_request.rs b/packages/data-requests/src/data_request.rs index 4cfa3606..1006cf0a 100644 --- a/packages/data-requests/src/data_request.rs +++ b/packages/data-requests/src/data_request.rs @@ -1,9 +1,10 @@ #[cfg(not(feature = "library"))] -use cosmwasm_std::{Deps, DepsMut, MessageInfo, Order, Response, StdResult}; +use cosmwasm_std::{to_binary, Deps, DepsMut, MessageInfo, Order, Response, StdResult}; use crate::state::{DATA_REQUESTS, DATA_REQUESTS_COUNT}; use crate::error::ContractError; +use crate::msg::PostDataRequestResponse; use common::msg::{GetDataRequestResponse, GetDataRequestsFromPoolResponse}; use common::state::DataRequest; use common::types::Hash; @@ -101,8 +102,13 @@ pub mod data_requests { })?; Ok(Response::new() - .add_attribute("action", "post_data_request") - .add_attribute("dr_id", posted_dr.dr_id)) + .set_data(to_binary(&PostDataRequestResponse { + dr_id: posted_dr.dr_id.clone(), + })?) + .add_attributes(vec![ + ("action", "post_data_request"), + ("dr_id", &posted_dr.dr_id), + ])) } /// Returns a data request from the pool with the given id, if it exists. diff --git a/packages/data-requests/src/msg.rs b/packages/data-requests/src/msg.rs index 35a55f31..00bbd136 100644 --- a/packages/data-requests/src/msg.rs +++ b/packages/data-requests/src/msg.rs @@ -1,3 +1,4 @@ +use common::types::Hash; use cosmwasm_schema::cw_serde; #[cw_serde] @@ -5,3 +6,8 @@ pub struct InstantiateMsg { pub token: String, pub proxy: String, } + +#[cw_serde] +pub struct PostDataRequestResponse { + pub dr_id: Hash, +}