1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use crate::{
self as fadroma,
prelude::Canonize,
cosmwasm_std::{self, HumanAddr, Binary, CosmosMsg, WasmMsg},
schemars::{self, JsonSchema}
};
use super::link::ContractLink;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Canonize, Clone, Debug, PartialEq, JsonSchema)]
pub struct Callback<A> {
pub msg: Binary,
pub contract: ContractLink<A>
}
impl Into<CosmosMsg> for Callback<HumanAddr> {
fn into(self) -> CosmosMsg {
CosmosMsg::Wasm(WasmMsg::Execute {
contract_addr: self.contract.address,
callback_code_hash: self.contract.code_hash,
msg: self.msg,
send: vec![]
})
}
}