/// Handle an incoming oracle request, providing a set of transactions to
/// respond with.
///
/// Test with:
///
/// ```text
/// $ curl --request POST http://127.0.0.1:23456/oracles/terra
/// ```
Handle an incoming oracle request, providing a set of transactions to
respond with.

Test with.


Handle an incoming oracle request providing a set of transactions to respond with . Test with .
pub async fn handle_request(self) -> Result<impl warp::Reply, Infallible> {
        let started_at = Instant::now();
        let msgs = self.get_vote_msgs().await;
        let msg_json = msgs
            .iter()
            .map(|msg| msg.to_json_value(&SCHEMA))
            .collect::<Vec<_>>();
        let tx = json!({
            "chain_id": CHAIN_ID,
            "fee": stdtx::StdFee::for_gas(GAS_AMOUNT),
            "memo": MEMO,
            "msgs": msg_json,
        });
        let response = json!({
            "status": "ok",
            "tx": vec![tx]
        });
        info!("t={:?}", Instant::now().duration_since(started_at));
        Ok(warp::reply::with_status(
            warp::reply::json(&response),
            StatusCode::OK,
        ))
    }
pub async fn handle_request ( self ) -> Result < impl warp :: Reply , Infallible > { let started_at = Instant :: now ( ) ; let msgs = self . get_vote_msgs ( ) . await ; let msg_json = msgs . iter ( ) . map ( | msg | msg . to_json_value ( & SCHEMA ) ) . collect :: < Vec < _ > > ( ) ; let tx = json ! ( { " " CHAIN_ID " " stdtx StdFee for_gas ( GAS_AMOUNT ) " " MEMO " " msg_json } ) ; let response = json ! ( { " " " " " " vec [ tx ] } ) ; info ! ( " " Instant now ( ) duration_since ( started_at ) ) ; Ok ( warp :: reply :: with_status ( warp :: reply :: json ( & response ) , StatusCode :: OK , ) ) }
Handle an incoming oracle request, providing a set of transactions to
respond with.
Handle an incoming oracle request providing a set of transactions to respond with .
self