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

LP v2: fix integration tests #1915

Merged
merged 18 commits into from
Jul 18, 2024
Merged

LP v2: fix integration tests #1915

merged 18 commits into from
Jul 18, 2024

Conversation

wischli
Copy link
Contributor

@wischli wischli commented Jul 16, 2024

Description

  • Fixes more ITs
    • The last 5 ignored ones are mysterious - will dig deeper into those after updating Dev chain with our current LPv2 PoC
  • Updates Solidity submodule to latest state

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works

@wischli wischli self-assigned this Jul 16, 2024
@wischli wischli changed the base branch from main to feat/lp-v2 July 16, 2024 17:40
@@ -0,0 +1,578 @@
// Copyright 2024 Centrifuge Foundation (centrifuge.io).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Code moved and improved from lp/mod.rs following Solidity structure

@@ -0,0 +1,966 @@
// Copyright 2024 Centrifuge Foundation (centrifuge.io).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Code moved and improved from lp/mod.rs following Solidity structure

@@ -0,0 +1,310 @@
// Copyright 2024 Centrifuge Foundation (centrifuge.io).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Code moved and improved from lp/mod.rs

@wischli wischli marked this pull request as ready for review July 18, 2024 07:54
@wischli wischli requested a review from lemunozm July 18, 2024 07:54
@wischli wischli marked this pull request as draft July 18, 2024 08:05
@wischli wischli marked this pull request as ready for review July 18, 2024 08:06
Copy link
Contributor

@lemunozm lemunozm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great William!

I'm not an expert at all in the EVM part, so I could not notice nothing wrong on it.

Added some super NIT things that can be skipped perfectly.

runtime/integration-tests/src/cases/lp/transfers.rs Outdated Show resolved Hide resolved
runtime/integration-tests/src/cases/lp/transfers.rs Outdated Show resolved Hide resolved
@@ -156,7 +155,7 @@ mod with_pool_currency {
use super::{utils, *};
use crate::cases::lp::utils as lp_utils;

#[test_runtimes([development], ignore = "solidity mismatch")]
#[test_runtimes([development])]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: There is a TODO 10 lines above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's from @mustermeiszer and not related to the LPv2 refactor I have applied.

@lemunozm
Copy link
Contributor

Let's wait to see everything green before merging, if possible 🙏🏻

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 45.93%. Comparing base (e7eb61c) to head (4192dd7).

Files Patch % Lines
pallets/liquidity-pools/src/lib.rs 50.00% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           feat/lp-v2    #1915      +/-   ##
==============================================
- Coverage       45.97%   45.93%   -0.04%     
==============================================
  Files             179      179              
  Lines           12793    12791       -2     
==============================================
- Hits             5881     5876       -5     
- Misses           6912     6915       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wischli
Copy link
Contributor Author

wischli commented Jul 18, 2024

@mustermeiszer @lemunozm @hieronx FYI: I am taking this state for our Dev deployment today. It reflects the latest state of our branch feat/lp-v2. Once the CI is green, we will merge this branch into our feature one. I have prefixed the tag with nightly to distinguish it from normal releases. The next prod RU will have v0.14.0 while this one is technically v0.13.1.

Comment on lines +96 to +102
/// Represents Solidity enum Domain.Centrifuge
pub const DOMAIN_CENTRIFUGE: u8 = 0;

/// Represents Solidity enum Domain.Evm
pub const DOMAIN_EVM: u8 = 1;
/// Represents Centrifuge Chain id which is 0
pub const CENTRIFUGE_CHAIN_ID: u8 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@wischli wischli merged commit 976eebe into feat/lp-v2 Jul 18, 2024
14 checks passed
@wischli wischli deleted the lpv2/fix-integration-tests branch July 25, 2024 14:57
lemunozm added a commit that referenced this pull request Aug 1, 2024
* feat: LPv2 message reorder (#1892)

* wip: add new msgs + reorder

* refactor: apply renaming

* fix: ITs

* feat: UpdateRestriction message

* fix: cancel_unprocessed_investment IT

* fix: fmt

* fix: clippy

* tests: reanchor solidity to reorder branch

* feat: apply hook to AddTranche msg

* tests: fix pool_management ITs

* wip: fix lp investments

* fmt

* fix: Tranche namespace

* refactor: remove fulfilled from FulfilledRedeemRequest

* chore: update lp submodule

* minor cleanup

* chore: update lp submodule

* chore: add missing cleanup

* fixes + ignore failing tests

* fmt

* tests: fix message indices

* ignore failing tests (#1910)

* LPv2: ForeignInvestments changes (#1895)

* add uts (#1905)

* main changes for FI

* fix correlation precission

* minor renames

* update investment UTs

* update redemption UTs

* miscelaneous UTs

* minor renames

* simplify correlation and embed to the only needed place

* doc change

* remove unused bound

* swapping calls into entities.rs file

* merge SwapDone methods into FulfilledSwapHook

* fix events

* working without pallet-swaps

* remove boilerplate for removing entries

* minor msg change

* minor simplification

* correct fulfilled sum after last collect

* check OrderIdToSwapId storage

* sending the message inside Info closure is not really a problem

* send msgs from the entities

* remove same currency check in impl.rs

* unify hooks

* remove pallet-swaps

* minor fmt

* add docs

* add architecture diagram

* return cancelled foreign amount from FI interface

* update liquidity-pools

* add messages to diagram

* implement hooks

* fix runtimes

* adapt integration-tests

* fix docs

* fix clippy

* fix clippy

* fix tests after merge

* fix foreign investment tests (#1918)

* ignore failing tests (#1919)

* fix previous merge

* LP v2: fix integration tests (#1915)

* chore: update submodule to latest `main` 6d7f242c0dd83b1b5a4f6d506370a1f3ecbef9ce

* wip: fix ITs

* chore: update submodule

* fix: remove sender param from `Transfer*` messages

* chore: cleanup

* docs: setup evm

* fix: msg tests

* fix: more ITs

* fix: missing refactor after rebase

* chore: update submodule to 223a0f36edabc675f8c74c47b20e366178df7ca3

* chore: improvements

* fmt

* Apply suggestions from code review

* chore: bump spec_version

* fmt: taplo

* LPv2: Batch Message serialization (#1920)

* custo serialize/deserialize for batch

* compiling solution

* serialization/deserialization working for batch message

* remove gmpf changes

* add batch nested protection

* faster serialization for submessages

* correct termination

* add tests for deserialize batch of batch

* add into_iter

* remove unused Box and add pack methods

* fix non_std compilation

* non_std

* fix max_encoded_len recursion issue

* fix submodules

* reduce batch limit

* feat: add domain hook storage (#1928)

* refactor: add domain hook address storage

* tests: add gateway lp admin account checks

* refactor: use GetByKey

* fix: outboundq mock

* refactor: hook 20 bytes instead of 32

* fix cargo fmt

* Feat/lp v2 gateway queue (#1930)

* pallets: Add LP Gateway queue pallet

* lp-gateway-queue: Add benchmarks

* integration-tests: Add LP gateway tests

* docs: Update LP gateway queue entry

* lp-gateway-queue: Use default weight for PostDispatchInfo

* lp-gateway-queue: Add DEFAULT_WEIGHT_REF_TIME const, extract message processing logic, use BaseArithmetic for nonce

* runtime: Add defensive weights for LP gateway queue

* lint: Obey

* taplo: Obey

* pallet: Use DispatchResult for extrinsics

* runtime: Update benchmarks and weight info

* benchmarks: Add default for Message type (wip)

* pallet: Add Default bound to Message type

* lp-v2: fix message fields (#1933)

* fix: add remark call to borrow proxy

* fix: add missing message fields

* chore: bump to v0.13.3

* chore: update submodule

* chore: enable fixed tests

---------

Co-authored-by: Frederik Gartenmeister <mustermeiszer@posteo.de>

* refactor: cleanup my leftovers (#1935)

* LPv2: Bump-up foreign investment. Fix failing investment ITs  (#1934)

* increase version for foreign investments

* fix investment issue

* fix solidity call for transfers_tokens

* fix tests

* minimize required tranche investors for IT

* fix docs

* fix docs

* docs: fix hyperlink

* refactor: enable ITs for centrifuge + dev runtimes (#1938)

* fix: enable ITs for centrifuge + dev runtimes

* fmt

* fix: revert some centrifuge ITs

* fmt

* revert centrifuge addition to ITs

---------

Co-authored-by: William Freudenberger <w.freude@icloud.com>

---------

Co-authored-by: William Freudenberger <w.freude@icloud.com>
Co-authored-by: Cosmin Damian <17934949+cdamian@users.noreply.github.com>
Co-authored-by: Frederik Gartenmeister <mustermeiszer@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants