-
Notifications
You must be signed in to change notification settings - Fork 87
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
Client integration tests against framework modules #677
Conversation
This looks good, I will do a thorough review once we have the governance on testnet devnet issue resolved for local client tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
Main thing here is that the client_l1move_l2move.rs
tests are testing with the old AtomicBridgeInitiator
/ Counterparty contract I believe. The abis used in the client handler fns are those contracts not AtomicBridgeInitiatorMOVE
.
However, this successfully proves that clients are able to to call the framework functions as expected.
The lack of configurability of ABI on ETH side could cause issues. We assume right now they are the same, which is why this works, but if there were updates to the AtomicBridgeInitiatorMOVE
contract, the Clients would break, becase they are always using the sol type AtomicBridgeInitiator
.
Before testing e2e we should add this configurability. I'm happy to add this onto this PR if you like while we switch.
bridge_transfer_id.extend_from_slice(random_suffix.as_bytes()); | ||
|
||
Self { | ||
initiator: b"32Be343B94f860124dC4fEe278FDCBD38C102D88".to_vec(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this address come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the dummy valid EIP-55 address used in the framework modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a comment.
protocol-units/bridge/integration-tests/tests/client_l1move_l2move.rs
Outdated
Show resolved
Hide resolved
protocol-units/bridge/integration-tests/tests/client_l1move_l2move.rs
Outdated
Show resolved
Hide resolved
) -> Result<(), anyhow::Error> { | ||
let _ = tracing_subscriber::fmt().with_max_level(tracing::Level::DEBUG).try_init(); | ||
|
||
let _ = tracing_subscriber::fmt().with_max_level(tracing::Level::DEBUG).try_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dup line here.
protocol-units/bridge/integration-tests/tests/client_l1move_l2move.rs
Outdated
Show resolved
Hide resolved
} | ||
|
||
#[tokio::test] | ||
async fn test_eth_client_should_successfully_call_initiate_transfer_only_weth() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be testing the MOVE.sol contracts seems like they are initialised currently with the old Initiator contracts. In other words this it AtomicBridgeInitiator
-> COIN. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't touch the Eth client tests, I think I had gotten it in my mind that we were using the E2E tests to tests the .sol
contracts; I was just using the client tests to check the Movement client against the framework.
One thing I notice on main
is that there aren't Eth tests in
client_movement_eth` anymore. Not sure why or how they disappeared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about this, I'm going to make sure the .sol MOVE contrats are supported by the relayer in a seperate PR. Right now it only uses the old ABIs for WETH contracts.
On second thought, let me add the configurability in a follow up PR, to reduce the scope creep on this. I will add a fast followup PR after this goes in. |
Sounds good, looking into the diff to see how to fix the E2E test |
I followed the testing steps written above and all the client tests are passing 🥳 |
I've triggered all the CI to ensure that bumping aptos doesn't introduce any failure, it shouldn't as its only the framework code. After those pass will be good to approve this. |
Summary
aptos-core
Changelog
client_l2move_l1move
andclient_l1move_l2move
files with tests against framework.get_bridge_transfer_details_counterparty
which was returning a struct with initiator and recipient address types reversed. Implemented aBridgeTransferDetailsCounterparty
struct to achieve this.Testing
To run client tests:
movement
repo, checkout theandygolay/framework-client-tests
branch, and start a local Suzuka node:Note, if you have any
.movement
directories present, e.g. when re-running tests, the directories must be deleted before starting the node..movement
directory, there will be aconfig.yaml
. In that file, changef90391c81027f03cdea491ed8b36ffaced26b6df208a9b569e5baf2590eb9b16
to0xA550C18
so the file looks like:L1 Move to L2 Move:
L2 Move to L1 Move:
Outstanding issues
refund
andabort
tests have a sleep of 20 seconds before callingrefund
orabort
. Just a heads up.extract_bridge_transfer_id_framework
call, where it won't find a matching transaction. I don't know why that happens but restarting the node and re-running steps 1 and 2 of the above test directions appears to fix it so tests pass.client_l1move_l2_move test_movement_client_complete_transfer
. The fix I implemented for it is rather hacky. That test should be cleaned up but perhaps in a later iteration.