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: Add Unitary Tests for update_member() #1905

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Conversation

lemunozm
Copy link
Contributor

Description

Add UTs to update_member() and remove unitary testing from integration tests related to it.

@wischli I've done over main because it should not conflict with the current lpv2 work. Maybe just a minor import.

@lemunozm lemunozm added the I4-tests Test needs fixing or improving. label Jul 10, 2024
@lemunozm lemunozm self-assigned this Jul 10, 2024
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.27%. Comparing base (e784233) to head (3fb84f8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1905      +/-   ##
==========================================
+ Coverage   46.11%   46.27%   +0.15%     
==========================================
  Files         179      179              
  Lines       13092    13078      -14     
==========================================
+ Hits         6038     6052      +14     
+ Misses       7054     7026      -28     

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

Copy link
Contributor

@wischli wischli left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! LGTM but let's not merge this before #1898 please

@lemunozm lemunozm enabled auto-merge (squash) July 11, 2024 15:07
@lemunozm lemunozm merged commit 2c1be11 into main Jul 11, 2024
10 checks passed
lemunozm added a commit that referenced this pull request Jul 15, 2024
lemunozm added a commit that referenced this pull request Jul 15, 2024
* 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
wischli pushed a commit that referenced this pull request Jul 25, 2024
fix: adapt passthrough router

fix: docs and hash

chore: rm unused test

Release v0.11.3 (#1886)

* Switch to full wasm execution

* feat: use correct encoded size.

* fix: lint

* refactor: reduce dev session duration from 6h to 2min

* chore: update centrifuge weights

* chore: update dev weights

* chore: update altair weights

* chore: update frame_system weights

* fmt

* fix: re-enable frame_system benches

* chore: bump spec version

* fmt: revert using latest nightly

* v0.11.3-rc1: revert checkmetadata ext

* feat: `CheckMetadataHash` extension (#1865)

* set dependency versions

* upgrade libs/*

* upgrade pallet-anchors

* upgrade pallet-fees

* upgrade pallet-bridge

* migrate simple pallets

* migrate pallet-order-book

* migrated collator-allowlist & swaps

* upgrade rewards

* upgraded pallet-mux

* upgrade transfer-allowlist

* fix hold reason in restricted tokens

* simplify set_balance removing the holding part

* upgrade restricted-xtokens

* upgrade some pallets

* upgrade pallet-ethereum-transaction

* upgrade pallet-loans

* upgrade pool-system

* upgrade pool-fees

* upgrade pool-registry

* upgrade liquidity-pools stuffs

* avoid duplicated polkadot-sdk repos

* minor fixes

* upgraded runtime-common

* CfgLocation to RestrictedTransferLocation

* restricted tokens with NativeIndex for native fungibles

* rename dependency

* upgraded development-runtime

* fix partially benchmarks

* fix benchmarks

* overpass xcmp-queue integrity tests

* minor coments

* upgrade altair & centrifuge

* remove some benchmarking pallets that are not needed

* fix runtime upgrades

* upgrade integration-test proc

* upgrade integration-tests framework

* upgraded all tests except liquidity pools

* 99% upgraded liquidity-pools tests

* fix lookup

* cargo fmt

* taplo fmt

* using nightly cargo in CI

* restore set_balance as it was

* allow nightly support in CI

* use restricted_tokens again to fetch from investement portfolio

* Install rust-src for docs

* fix tests

* remove unused restricted tokens

* fix block rewards

* fix WrongWitness for some tests in IT

* fix liquidity-pools

* minor fixes

* fix clippy

* remove unneeded tests

* feat: Update client to Polkadot v1.7.2 (#1844)

* wip: update client

* chore: update crate versions

* chore: update anchor rpc api

* chore: remove rewards, pools rpc

* chore: compile with development runtime

* fix: client for all runtimes

* fix: build spec

* feat: update relay docker images

* fix: apply deprecation of export genesis state to scripts

* fmt: taplo

* refactor: use xcm v4 sugar

* fix: revert tmp change in local para run

* refactor: simplify xcm v4 locations in chain spec

* cargo fmt

* fix clippy

* feat: Polkadot v1.7.2 migrations (#1849)

* feat: add hold reason migration

* feat: centrifuge migrations

* feat: altair migrations

* feat: dev + demo migrations

* fix: clippy

* fix: build

* fmt: fix using nightly

* last William iteration review

* increase passed blocks

* use rococo instead of polkadot-test-runtime

* fix tests

* remove line

* dirty fix to fix Hrmp test issue

* use default weights for treasury

* remove getrandom unused dep

* upgrade to last polkadot-sdk version

* feat: `CheckMetadataHash` extension

* fix it (#1866)

* fmt: taplo

* refactor: signed ext order

* fix: signed ext order for ITs

* IT: more support for router tests (#1885)

* move routers to its own module

* remove outdated markers

* for all runtimes

* remove previous tests

* minor fixes

* v0.11.2 rc

* panic if event is not found in the expected blocks (#1880)

* fix: ci

* remove generic module (#1887)

* revert check metadata hash disable

* fix: disable metadata hash check for integration tests

---------

Co-authored-by: lemunozm <lemunozm@gmail.com>

---------

Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Frederik Gartenmeister <mustermeiszer@posteo.de>
Co-authored-by: lemunozm <lemunozm@gmail.com>

Refactor: Decoupling routers from gateway (#1891)

* decoupling routers from gateway. Use Vec<u8>

* gateway adapted

* fix imports

* move test msg to cfg-traits

* fix imports

feat: Open Gov for Development and Altair Runtimes (#1828)

* chore: add OpenGov pallets to root toml

* feat: add OpenGov tracks to runtime common

* feat: add technical committee migration

tc: fix clippy

* refactor: move origins from primitives to common

common: fix typo

common: fix test after HalfOfCouncil refactor

* feat: add OpenGov to Development

fix: complete Development OpenGov

development: finalize opengov

development: add proxy calls

development: overwrite missing origins

dev: fix treasury spender

dev: remove crowdloan pallets

dev: taplo fmt

* feat: add OpenGov to Altair

fix: complete Altair OpenGov

fix: add missing technical fellowship weights Altair

altair: finalize opengov

altair: rename track tests

altair: gather imports

altair: remove crowdloan pallets

altair: taplo fmt

* feat: add OpenGov to Centrifuge chain

fix: centrifuge toml

chore: minor centrifuge chain improvements

refactor: Centrifuge OpenGov

centrifuge: finalize opengov

centrifuge: fix cargo tml

cfg: fix clippy test

* Revert "feat: add OpenGov to Centrifuge chain"

This reverts commit 4d78c10.

* fix: clippy

* tests: fix CouncilCollective import path

* fix: technical committee migrations

* altair: configure tc migration (incomplete)

* dev: configure tc migration

* chore: cleanup altair dep diff

* chore: remove unused getrandom crate from runtimes

* chore: add missing Altair TC members

* refactor: move to_ppm and to_percent to utils

* Merge remote-tracking branch 'origin/main' into feat/open-gov-2

* fix: issues after rebasing

* fmt

* fix: imports

* feat: v0.12.0 for altair RU

Altair: release v0.12.0 (#1896)

* fix: altair chain spec

* chore: update gov2 weights

* chore: update dev OpenGov weights

* fix: weight declaration

Fix RustDocs deployment & codecov patch checks (#1870)

* Fix deploy docs

* Make patch checks also informational (not fail)

LP Message with custom data format for serialization/deserialization (#1889)

* test compiling

* fix Domain serialization

* fix issues

* some reorganizations

* using bincode 2 with non-std support

* use custom trait

* tests passing for lp

* remove ENCODED_MSG constant

* fix runtimes compilation

* cargo fmt & taplo fmt

* cargo clippy

* minor change

* add custom serializer passing all tests

* no_std support

* minor renames

* cargo fmt

* cargo clippy

* minor comment change

* cargo fmt extra

Succeed when patch codecov fails (#1900)

Liquidity pools: Add UTs to for `update_token_price()` (#1890)

* add token price UTs

* update IT

* fix tests compilation

remove some unused code investment-related (#1902)

Release v0.13.0 (#1898)

* chore: update deps to enable metadata hash check

* chore: update srtool + add on-chain-release-build opts

* chore: bump spec versions + cleanup migrations

* fmt: taplo

* ci: fix srtool fmt

* ci: apply proper CLI

* attempt2 to enable on-chain-release-build

* change srtool build for chevdor/strool-actions action

* desperate attempts to get it working

* override workdir

* Try to set permissions wide open before running docker

* add RUST_BACKTRACE

* revert to our GHA manual process & add enhancements

* fix package name

* Output information about srtool

* Revert "desperate attempts to get it working"

This reverts commit a882fd9.

* fix: some scripts

* fix bad colon on echo command

* Fix missing colon and remove docker publish release

* upload wasm to release

* fix issue with gchr tags

* more semicolon issues

* unique name for delete untagged

* fix delete_untagged

* move delete_untagged under workflows

* move delete untagged to manual runs

* review bash syntax for wasm build

* recover cache and limit sanity check build time

---------

Co-authored-by: Guillermo Perez <gpmayorga@users.noreply.github.com>

cargo update (#1904)

add uts (#1905)

IT: Support `#ignore = reason` for `test_runtimes` macro (#1908)

* support #ignore = reason for test_runtimes macro

* fix clippy

ci: disable checks for drafts (#1913)

LP: Unitary testing for add_currency (#1912)

* port add-currency tests into uts

* remove LiquidityPoolsWrappedToken struct

* remove unused code

* fix compilation issues

* fix clippy

* fix clippy

feat: adatpt to latest version

LP: Unitary testing for all pending extrinsics (#1916)

* allow and disallow currency tests

* schedule_upgrade cancel_upgrade and update_tranche_token_metadata

Feat: Adapt proxy settings (#1922)

* feat: adapt proxy settings

* fix: match pattern

Small CI improvements (#1924)

LP: Unitary testing for inbound messages (#1927)

* tests inbound messages

* some cleanings

* some adjustements

fix: array size

fix: clippy + fmt

fix: update blake hash

fix: compilation

Refactor: Transform `TrancheCurrency` type in a tuple (#1926)

* remove TrancheCurrency type

* fix benchmarks

* fix clippy

fix: std import KeccakHasher
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
I4-tests Test needs fixing or improving.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants