Skip to content

Commit

Permalink
review: update payment state index consts names
Browse files Browse the repository at this point in the history
  • Loading branch information
laruh committed Nov 5, 2024
1 parent 77b7500 commit ed02392
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ERC20_MAKER_PAYMENT: &str = "erc20MakerPayment";
/// uint32 paymentLockTime;
/// MakerPaymentState state;
/// }
const MAKER_PAYMENT_STATE_INDX: usize = 2;
const MAKER_PAYMENT_STATE_INDEX: usize = 2;

struct MakerPaymentArgs {
taker_address: Address,
Expand Down Expand Up @@ -142,7 +142,7 @@ impl EthCoin {
Token::FixedBytes(swap_id.clone()),
&MAKER_SWAP_V2,
EthPaymentType::MakerPayments,
MAKER_PAYMENT_STATE_INDX,
MAKER_PAYMENT_STATE_INDEX,
)
.await?;

Expand Down
12 changes: 6 additions & 6 deletions mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const TAKER_PAYMENT_APPROVE: &str = "takerPaymentApprove";
/// uint32 paymentLockTime;
/// TakerPaymentState state;
/// }
const TAKER_PAYMENT_STATE_INDX: usize = 3;
const TAKER_PAYMENT_STATE_INDEX: usize = 3;

struct TakerFundingArgs {
dex_fee: U256,
Expand Down Expand Up @@ -164,7 +164,7 @@ impl EthCoin {
Token::FixedBytes(swap_id.clone()),
&TAKER_SWAP_V2,
EthPaymentType::TakerPayments,
TAKER_PAYMENT_STATE_INDX,
TAKER_PAYMENT_STATE_INDEX,
)
.await?;

Expand Down Expand Up @@ -241,7 +241,7 @@ impl EthCoin {
decoded[0].clone(),
&TAKER_SWAP_V2,
EthPaymentType::TakerPayments,
TAKER_PAYMENT_STATE_INDX,
TAKER_PAYMENT_STATE_INDEX,
)
.await
);
Expand Down Expand Up @@ -398,7 +398,7 @@ impl EthCoin {
decoded[0].clone(), // id from takerPaymentApprove
&TAKER_SWAP_V2,
EthPaymentType::TakerPayments,
TAKER_PAYMENT_STATE_INDX,
TAKER_PAYMENT_STATE_INDEX,
)
.await
.map_err(|e| SearchForFundingSpendErr::Internal(ERRL!("{}", e)))?;
Expand Down Expand Up @@ -430,7 +430,7 @@ impl EthCoin {
decoded[0].clone(),
&TAKER_SWAP_V2,
EthPaymentType::TakerPayments,
TAKER_PAYMENT_STATE_INDX,
TAKER_PAYMENT_STATE_INDEX,
)
.await
);
Expand Down Expand Up @@ -473,7 +473,7 @@ impl EthCoin {
decoded[0].clone(), // id from spendTakerPayment
&TAKER_SWAP_V2,
EthPaymentType::TakerPayments,
TAKER_PAYMENT_STATE_INDX,
TAKER_PAYMENT_STATE_INDEX,
)
.await?;
if taker_status == U256::from(TakerPaymentStateV2::MakerSpent as u8) {
Expand Down

0 comments on commit ed02392

Please sign in to comment.