Skip to content

Commit

Permalink
Add pool id parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
telezhnaya committed May 27, 2024
1 parent 7fe9d40 commit d3a03ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ pub struct Opts {
/// FT account id
#[clap(long, env)]
pub ft_account_id: AccountId,
/// Pool id for swap command
#[clap(long, env)]
pub pool_id: u32,
/// Transaction kind
#[clap(long, env, value_enum, default_value = "token-transfer-default")]
pub transaction_kind: TransactionKind,
Expand Down
1 change: 1 addition & 0 deletions src/transaction/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ mod tests {
receiver_id: "dog.near".parse().unwrap(),
wrap_near_id: "frog.near".parse().unwrap(),
ft_account_id: "bear.near".parse().unwrap(),
pool_id: 0,
transaction_kind: TransactionKind::TokenTransferDefault,
period: Duration::from_millis(1),
metric_server_address: SocketAddr::from_str("0.0.0.0:9000").unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl TransactionSample for Swap {
nonce: Nonce,
block_hash: CryptoHash,
) -> RpcSendTransactionRequest {
let msg = format!("{{\"actions\":[{{\"pool_id\":3879,\"token_in\":\"{}\",\"token_out\":\"{}\",\"amount_in\":\"1000000000000000000000\",\"min_amount_out\":\"1\"}}]}}", opts.wrap_near_id, opts.ft_account_id);
let msg = format!("{{\"actions\":[{{\"pool_id\":{},\"token_in\":\"{}\",\"token_out\":\"{}\",\"amount_in\":\"1000000000000000000000\",\"min_amount_out\":\"1\"}}]}}", opts.pool_id, opts.wrap_near_id, opts.ft_account_id);
let transaction = Transaction {
signer_id: signer.account_id.clone(),
public_key: signer.public_key.clone(),
Expand Down

0 comments on commit d3a03ef

Please sign in to comment.