Skip to content

Commit 7e53875

Browse files
committed
Add: splitted helper in sent and not sent from maker
1 parent 9ee3063 commit 7e53875

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/order.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ impl Order {
256256

257257
/// Check if the sender is the creator of the order
258258
pub fn sent_from_maker(&self, sender: PublicKey) -> Result<(), CantDoReason> {
259+
let sender = sender.to_string();
260+
if self.creator_pubkey != sender {
261+
return Err(CantDoReason::InvalidPubkey);
262+
}
263+
Ok(())
264+
}
265+
266+
/// Check if the sender is the creator of the order
267+
pub fn not_sent_from_maker(&self, sender: PublicKey) -> Result<(), CantDoReason> {
259268
let sender = sender.to_string();
260269
if self.creator_pubkey == sender {
261270
return Err(CantDoReason::InvalidPubkey);

0 commit comments

Comments
 (0)