From 986276de9a4c643bb09f15e9f1076731d39316f8 Mon Sep 17 00:00:00 2001 From: billythedummy Date: Thu, 8 Feb 2024 18:02:25 +0800 Subject: [PATCH] pubkey ordering --- common/src/pda.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/pda.rs b/common/src/pda.rs index 54bff6f..3c20213 100644 --- a/common/src/pda.rs +++ b/common/src/pda.rs @@ -16,7 +16,11 @@ pub fn stake_pool_pair_amm_key_seeds<'seeds>( pool1: &'seeds Pubkey, pool2: &'seeds Pubkey, ) -> [&'seeds [u8]; 2] { - [pool1.as_ref(), pool2.as_ref()] + if pool1 < pool2 { + [pool1.as_ref(), pool2.as_ref()] + } else { + [pool2.as_ref(), pool1.as_ref()] + } } pub fn bridge_stake_seeds<'seeds>(