Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eth-swap): maker tpu v2 implementation #2211

Merged
merged 48 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e485de2
create eth_swap_v2 module, and refactor eth_swap_v2.rs to eth_taker_s…
laruh Aug 20, 2024
6593dc7
maker ops: send_maker_payment_v2_impl added
laruh Aug 28, 2024
9eac0fd
WIP: validate_maker_payment_v2_impl
laruh Aug 30, 2024
4fc3971
remove unused import
laruh Aug 30, 2024
45d4726
maker tpu v2: validate_maker_payment_v2_impl
laruh Aug 30, 2024
619359a
maker tpu v2: refund timelock and secret
laruh Sep 1, 2024
a6e17b4
maker tpu v2: wait_for_maker_payment_spend TODO
laruh Sep 1, 2024
e16bf49
maker tpu v2: spend_maker_payment_v2_impl
laruh Sep 2, 2024
b35e68f
eth maker tpu v2: wait_for_maker_payment_spend_impl
laruh Sep 2, 2024
f73b5de
eth maker v2 docker tests
laruh Sep 3, 2024
e53c028
remove clone for now
laruh Sep 5, 2024
3815d08
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Sep 5, 2024
7498eec
maker swap v2 docker tests (on sepolia)
laruh Sep 8, 2024
b1626f7
set taker and maker gas limits V2
laruh Sep 9, 2024
ce7903d
taker gas limits v2
laruh Sep 10, 2024
f1063c7
move prepare erc20 payment data above allowance, impl handle_allowance
laruh Sep 10, 2024
60f11f8
start using `nft_maker_swap_v2_contract` from EthCoin in Nft maker sw…
laruh Sep 10, 2024
0c96992
nft maker gas limits v2
laruh Sep 11, 2024
8f983ec
update taker time
laruh Sep 11, 2024
6961d50
update gas limit fields names
laruh Sep 16, 2024
5d9d1de
add sepolia test features
laruh Sep 16, 2024
d57abdb
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Sep 19, 2024
1ef0f43
provide SEPOLIA_TESTS_LOCK
laruh Sep 19, 2024
638afd2
UtxoStandardCoin wait_for_maker_payment_spend
laruh Sep 24, 2024
be1eab0
call crate BigDecimal method is_positive
laruh Sep 25, 2024
4bada4f
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Sep 25, 2024
ab0f961
fix clippy
laruh Sep 26, 2024
b3ed7ba
review: gas limit traits
laruh Sep 26, 2024
9b388a2
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Oct 3, 2024
3dce044
review: remove traits
laruh Oct 7, 2024
eeead52
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Oct 7, 2024
f7eab3c
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Oct 15, 2024
5f1e38c
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Oct 24, 2024
a5a0834
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Oct 24, 2024
db6b2e7
remove wait_for_maker_payment_spend
laruh Nov 1, 2024
da12b97
increase v2 ERC20_PAYMENT consts to 150_000
laruh Nov 1, 2024
2b81855
review: consts for TAKER/MAKER state indexes
laruh Nov 1, 2024
72ed306
review: create separate Refund Args structures for Timelock and Secre…
laruh Nov 1, 2024
a9a5c47
review: remove unreachable
laruh Nov 3, 2024
1ccfc77
review: split token_address and gas_limit funcs logic
laruh Nov 3, 2024
6e42e34
review: adjust gas limit consts
laruh Nov 3, 2024
1e6dacb
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Nov 4, 2024
ce15cd8
review: prioritize errors
laruh Nov 4, 2024
57e75ed
review: remove unnecessary as_ref, map functions
laruh Nov 4, 2024
1e6ea8e
review: use ref to a fixed-size array in Validation Args
laruh Nov 4, 2024
77b7500
Merge remote-tracking branch 'origin/dev' into eth-maker-tpu-v2
laruh Nov 5, 2024
ed02392
review: update payment state index consts names
laruh Nov 5, 2024
1301084
review: remove redundant validation
laruh Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions mm2src/coins/coin_errors.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::eth::eth_swap_v2::{PaymentStatusErr, ValidatePaymentV2Err};
use crate::eth::nft_swap_v2::errors::{Erc721FunctionError, HtlcParamsError, PrepareTxDataError};
use crate::eth::eth_swap_v2::{PaymentStatusErr, PrepareTxDataError, ValidatePaymentV2Err};
use crate::eth::nft_swap_v2::errors::{Erc721FunctionError, HtlcParamsError};
use crate::eth::{EthAssocTypesError, EthNftAssocTypesError, Web3RpcError};
use crate::{utxo::rpc_clients::UtxoRpcError, NumConversError, UnexpectedDerivationMethod};
use enum_derives::EnumFromStringify;
use futures01::Future;
use mm2_err_handle::prelude::MmError;
use spv_validation::helpers_validation::SPVError;
use std::num::TryFromIntError;
use std::{array::TryFromSliceError, num::TryFromIntError};

/// Helper type used as result for swap payment validation function(s)
pub type ValidatePaymentFut<T> = Box<dyn Future<Item = T, Error = MmError<ValidatePaymentError>> + Send>;
Expand All @@ -24,7 +24,9 @@ pub enum ValidatePaymentError {
"NumConversError",
"UnexpectedDerivationMethod",
"keys::Error",
"PrepareTxDataError"
"PrepareTxDataError",
"ethabi::Error",
"TryFromSliceError"
)]
borngraced marked this conversation as resolved.
Show resolved Hide resolved
InternalError(String),
/// Problem with deserializing the transaction, or one of the transaction parts is invalid.
Expand All @@ -49,8 +51,7 @@ pub enum ValidatePaymentError {
WatcherRewardError(String),
/// Input payment timelock overflows the type used by specific coin.
TimelockOverflow(TryFromIntError),
#[display(fmt = "Nft Protocol is not supported yet!")]
NftProtocolNotSupported,
ProtocolNotSupported(String),
InvalidData(String),
}

Expand All @@ -77,7 +78,9 @@ impl From<Web3RpcError> for ValidatePaymentError {
| Web3RpcError::Timeout(internal)
| Web3RpcError::NumConversError(internal)
| Web3RpcError::InvalidGasApiConfig(internal) => ValidatePaymentError::InternalError(internal),
Web3RpcError::NftProtocolNotSupported => ValidatePaymentError::NftProtocolNotSupported,
Web3RpcError::NftProtocolNotSupported => {
ValidatePaymentError::ProtocolNotSupported("Nft protocol is not supported".to_string())
},
}
}
}
Expand Down
Loading
Loading