Skip to content

Commit

Permalink
chore(quickstart): Add warning
Browse files Browse the repository at this point in the history
--- don't change below this line ---
ENG-4225 Took 5 minutes
  • Loading branch information
dianacarvalho1 committed Feb 26, 2025
1 parent 5082c88 commit 3dc8e0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions examples/quickstart/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,10 @@ fn encode(
};

// Encode the solution
let tx = encoder
encoder
.encode_router_calldata(vec![solution.clone()])
.expect("Failed to encode router calldata")[0]
.clone();

return tx;
.clone()
}

async fn get_tx_requests(
Expand Down Expand Up @@ -429,15 +427,15 @@ async fn get_tx_requests(
);
let data = encode_input(approve_function_signature, args.abi_encode());
let nonce = provider
.get_transaction_count(user_address.clone())
.get_transaction_count(user_address)
.await
.expect("Failed to get nonce");

let approval_request = TransactionRequest::default()
.from(user_address.clone())
.from(user_address)
.to(sell_token_address)
.input(TransactionInput { input: Some(AlloyBytes::from(data)), data: None })
.gas_limit(50_000u64.into())
.gas_limit(50_000u64)
.max_fee_per_gas(max_fee_per_gas.into())
.max_priority_fee_per_gas(max_priority_fee_per_gas.into())
.nonce(nonce);
Expand All @@ -449,7 +447,7 @@ async fn get_tx_requests(
.input(TransactionInput { input: Some(AlloyBytes::from(tx.data)), data: None })
.max_fee_per_gas(max_fee_per_gas.into())
.max_priority_fee_per_gas(max_priority_fee_per_gas.into())
.gas_limit(300_000u64.into())
.gas_limit(300_000u64)
.nonce(nonce + 1);

(approval_request, swap_request)
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl From<ProtocolComponent> for tycho_core::models::protocol::ProtocolComponent
id: hex::encode(component.id),
protocol_system: component.protocol_system,
protocol_type_name: component.protocol_type_name,
chain: component.chain.into(),
chain: component.chain,
tokens: component
.tokens
.into_iter()
Expand Down

0 comments on commit 3dc8e0a

Please sign in to comment.