Skip to content

Commit bb98e21

Browse files
committed
update tests and examples
1 parent 4e6fc1e commit bb98e21

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

examples/src/swap.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ pub async fn swap() {
3232

3333
let quote_res = client.get_quote(&quote).await.expect("Failed to get quote");
3434

35-
let payload = SwapRequest::new("input_your_wallet_address", quote_res);
35+
let payload = SwapRequest::new(
36+
"input_your_wallet_address",
37+
"payer_wallet_address",
38+
quote_res,
39+
);
3640
let swap_res: SwapResponse = client
3741
.get_swap_transaction(&payload)
3842
.await
@@ -96,7 +100,11 @@ pub async fn swap_with_instructions() {
96100
let quote_res = client.get_quote(&quote).await.expect("Failed to get quote");
97101

98102
// get swap instructions
99-
let payload = SwapRequest::new("EXBdeRCdiNChKyD7akt64n9HgSXEpUtpPEhmbnm4L6iH", quote_res);
103+
let payload = SwapRequest::new(
104+
"EXBdeRCdiNChKyD7akt64n9HgSXEpUtpPEhmbnm4L6iH",
105+
"payer_wallet_address",
106+
quote_res,
107+
);
100108

101109
let swap_instructions = client
102110
.get_swap_instructions(&payload)

tests/src/swap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ mod swap_tests {
131131

132132
match client.get_quote(&quote).await {
133133
Ok(quote_res) => {
134-
let swap = SwapRequest::new(TEST_USER_PUBKEY, quote_res);
134+
let swap = SwapRequest::new(TEST_USER_PUBKEY, TEST_USER_PUBKEY, quote_res);
135135

136136
assert_eq!(
137137
swap.user_public_key, TEST_USER_PUBKEY,
@@ -163,7 +163,7 @@ mod swap_tests {
163163
Err(err) => panic!("Failed to get quote for swap test: {:?}", err),
164164
};
165165

166-
let swap = SwapRequest::new(TEST_USER_PUBKEY, quote_res);
166+
let swap = SwapRequest::new(TEST_USER_PUBKEY, TEST_USER_PUBKEY, quote_res);
167167

168168
match client.get_swap_transaction(&swap).await {
169169
Ok(swap_res) => {

0 commit comments

Comments
 (0)