Skip to content

Commit

Permalink
increase gas limit for maker ERC20_SEND_PAYMENT, handle allowance tim…
Browse files Browse the repository at this point in the history
…e in send_maker_payment_and_refund_timelock_erc20 test
  • Loading branch information
laruh committed Sep 16, 2024
1 parent 1a214bd commit 05f1e74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ pub mod gas_limit_v2 {
/// Gas limits for maker operations in EtomicSwapMakerV2 contract
pub mod maker {
pub const ETH_SEND_PAYMENT: u64 = 65_000;
pub const ERC20_SEND_PAYMENT: u64 = 115_000;
pub const ERC20_SEND_PAYMENT: u64 = 200_000;
pub const ETH_TAKER_SPEND: u64 = 65_000;
pub const ERC20_TAKER_SPEND: u64 = 65_000;
pub const ETH_MAKER_REFUND_TIMELOCK: u64 = 65_000;
Expand Down
3 changes: 2 additions & 1 deletion mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,7 @@ fn send_maker_payment_and_refund_timelock_erc20() {
let taker_secret_hash = sha256(&taker_secret).to_vec();
let maker_secret = vec![1; 32];
let maker_secret_hash = sha256(&maker_secret).to_vec();
let payment_time_lock = now_sec() - 1000;
let payment_time_lock = now_sec() + 29; // this time lock is used for erc20 allowance

let taker_pub = &taker_coin.derive_htlc_pubkey_v2(&[]);

Expand Down Expand Up @@ -2180,6 +2180,7 @@ fn send_maker_payment_and_refund_timelock_erc20() {
watcher_reward: false,
amount: trading_amount,
};
thread::sleep(Duration::from_secs(30));
let payment_tx_refund = block_on(maker_coin.refund_maker_payment_v2_timelock(refund_args)).unwrap();
log!(
"Maker refunded ERC20 payment after timelock, tx hash: {:02x}",
Expand Down

0 comments on commit 05f1e74

Please sign in to comment.