pub enum SlashMsg {
AddSlasher {
addr: String,
},
RemoveSlasher {
addr: String,
},
Slash {
addr: String,
portion: Decimal,
},
}Expand description
A common (sort of) interface for adding/removing slashers and slashing.
This type exists so that contracts have an easy way of serializing these messages
and using something like encode_raw_msg.
Examples
use tg4::Tg4Contract;
use tg_utils::SlashMsg;
use cosmwasm_std::{to_binary, Addr, Response};
let tg_contract = Tg4Contract::new(Addr::unchecked("some_contract"));
let slash_msg = to_binary(&SlashMsg::AddSlasher {
addr: "some_other_contract".to_string(),
}).unwrap();
let res = Response::new()
.add_submessage(tg_contract.encode_raw_msg(slash_msg).unwrap());Variants
AddSlasher
Fields
addr: StringAdds slasher for contract if there are enough slasher_preauths left
RemoveSlasher
Fields
addr: StringRemoves slasher for contract
Slash
Slash engagement points from address
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for SlashMsg
impl UnwindSafe for SlashMsg
Blanket Implementations
Mutably borrows from an owned value. Read more