Skip to content

Commit

Permalink
Merge pull request #943 from bifrost-finance/fix-moonriver-remarkwith…
Browse files Browse the repository at this point in the history
…event

fix-moonriver-remarkwithevent
  • Loading branch information
yooml authored Mar 29, 2023
2 parents 6d6fbb1 + 34f051d commit 440b75d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions pallets/slp/src/agents/moonbeam_agent/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,15 @@ impl<T: Config> MoonbeamAgent<T> {
.ok_or(Error::<T>::DelegatorNotExist)?;

// Temporary wrapping remark event in Moonriver/Moonbeam for ease use of backend service.
let remark_call =
MoonbeamCall::System(MoonbeamSystemCall::RemarkWithEvent(Box::new(query_id.encode())));
let remark_call = if currency_id == MOVR {
MoonbeamCall::System(MoonbeamSystemCall::MoonriverRemarkWithEvent(Box::new(
query_id.encode(),
)))
} else {
MoonbeamCall::System(MoonbeamSystemCall::MoonbeamRemarkWithEvent(Box::new(
query_id.encode(),
)))
};

let call_batched_with_remark =
MoonbeamCall::Utility(Box::new(MoonbeamUtilityCall::BatchAll(Box::new(vec![
Expand Down
4 changes: 3 additions & 1 deletion pallets/slp/src/agents/moonbeam_agent/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ pub enum MoonbeamXtokensCall<T: Config> {

#[derive(Encode, Decode, RuntimeDebug, Clone)]
pub enum MoonbeamSystemCall {
#[codec(index = 7)]
MoonriverRemarkWithEvent(Box<Vec<u8>>),
#[codec(index = 8)]
RemarkWithEvent(Box<Vec<u8>>),
MoonbeamRemarkWithEvent(Box<Vec<u8>>),
}

#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
Expand Down

0 comments on commit 440b75d

Please sign in to comment.