Skip to content

Commit

Permalink
add whirlpool instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
googolmo committed May 5, 2022
1 parent 57d85f1 commit 3926070
Show file tree
Hide file tree
Showing 6 changed files with 510 additions and 153 deletions.
6 changes: 6 additions & 0 deletions src/program-rust/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ pub enum ProtocolError {
#[error("invalid crema swap account data")]
InvalidCremaSwapAccountData,

#[error("invalid whirlpool info account data")]
InvalidWhirlpoolInfoAccountData,

#[error("overflow")]
Overflow,
}
Expand Down Expand Up @@ -332,6 +335,9 @@ impl PrintProgramError for ProtocolError {
ProtocolError::InvalidPoolMint => {
msg!("Error: InvalidPoolMint")
}
ProtocolError::InvalidWhirlpoolInfoAccountData => {
msg!("Error: InvalidWhirlpoolInfoAccountData")
}
ProtocolError::Overflow => {
msg!("Error: Overflow")
}
Expand Down
4 changes: 2 additions & 2 deletions src/program-rust/src/exchanger/whirlpool/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ mod test {
sqrt_price_limit: 79226673515401279992447579055,
exact_input: true,
a_to_b: false,
}).pack();
})
.pack();
assert_eq!(data1, data2)
}
}

Loading

0 comments on commit 3926070

Please sign in to comment.