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

MESH-1623/add memo field to portfolio #1004

Merged
merged 10 commits into from
May 31, 2021

Conversation

Neopallium
Copy link
Contributor

@Neopallium Neopallium commented May 25, 2021

TODO

  • Add tests for move_portfolio_funds with a memo. Right now the tests have None for the memo field.
  • Check docs to see if they need to be updated.

changelog

new features

  • Add optional memo field to portfolio.move_portfolio_funds. Each asset moved can have a memo added to the move.

modified API

  • Add memo field (Option<Memo>) to MovePortfolioItem struct.
  • Add memo field to MovedBetweenPortfolios event.

modified logic

  • Each asset that is moved between portfolios can have a memo attached to the move action.

pallets/portfolio/src/benchmarking.rs Outdated Show resolved Hide resolved
pallets/portfolio/src/lib.rs Show resolved Hide resolved
@Centril Centril added breaking-api-changes PR includes changes that break existing APIs release-notes Tag to use if PR needs to be reflected in release notes storage-modification-changes PR includes changes that modify storage and requires additional logic to upgrade labels May 25, 2021
@Neopallium Neopallium changed the title [WIP] MESH-1623/add memo field to portfolio MESH-1623/add memo field to portfolio May 31, 2021
@Centril Centril added the merge-after-ci PR can be merged after CI has completed label May 31, 2021
@poly-auto-merge poly-auto-merge bot merged commit bb27e57 into develop May 31, 2021
@poly-auto-merge poly-auto-merge bot deleted the MESH-1623/Add_memo_field_to_portfolio branch May 31, 2021 13:36
adamdossa pushed a commit that referenced this pull request Jun 17, 2021
* portfolio needs `Ord` on `Memo`

* Add memo field to portfolio.move_portfolio_funds.

TODO: Add tests with a memo.
TODO: Update docs.

* Add missing `memo` field in corporate-actions pallet

* code cleanup.

* Remove TODO comment.

* cargo fmt - fixup corporate-actions.

* Fix schema for `MovePortfolioItem` struct.

* Tests for `move_portfolio_funds` with memo.

Also checks for `MovedBetweenPortfolios` event.

* Add note about memo to `move_portfolio_funds` docs.
@adamdossa adamdossa mentioned this pull request Jun 17, 2021
adamdossa added a commit that referenced this pull request Jul 29, 2021
* MESH-1597: Split issuance and token creation (#981)

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Update pallets/asset/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* remove create_asset_and_mint

* remove create_asset_and_mint

* formatting

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Mesh 1543/coverage bridge (#979)

* Refactor following TA

* Freeze/Unfreeze txs UT added

* Add `batch_propose_bridge_tx` UT

* CodeReview: Use constant

* CodeReview: Use `base_` prefix

* CodeREview: misc

* CodeREview: remove `box_syntax`

* MESH-1603: allow portfolio custodians unilaterally quit (#977)

* quit_portfolio_custody WIP

* refactoring fix

* fixed quit test

* fixed the quit benchmark

* update comment

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

* minor change

* minor change

Co-authored-by: Joel Moore <47923231+JMoore96@users.noreply.github.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: poly-auto-merge[bot] <65769705+poly-auto-merge[bot]@users.noreply.github.com>

* MESH-1598/ use expect/assert in benchmarks (#986)

* removed '?' in benchmarks and changed ensure to assert

* minor changes

* minor change

* fixed linting issue

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* comment correction

Co-authored-by: CJP10 <cjpet10@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* minor change

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* fixed linting and made minor changes

* minor changes and linting

* minor changes

* minor change

* minor changes

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: CJP10 <cjpet10@gmail.com>

* Fixed a bug preventing some operators from changing commission (#987)

* Fixed commission change bug

* Update pallets/runtime/tests/src/staking/mod.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: poly-auto-merge[bot] <65769705+poly-auto-merge[bot]@users.noreply.github.com>

* Add ITN details to README (#989)

Co-authored-by: poly-auto-merge[bot] <65769705+poly-auto-merge[bot]@users.noreply.github.com>

* MESH-1593/Fix `payout_stakers` benchmarks (#988)

* WIP

* WIP

* Add audit report (#995)

* MESH-1542/Improve code coverage for Identity module (#990)

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Update pallets/runtime/tests/src/identity_test.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Mesh 1581: External Agents (#978)

* wip

* wip

* wip

* wip

* wip

* wip

* cargo fmt

* mesh-1581: improve docs

* wip

* wip

* wip

* wip

* move asset Trait to common

* mesh-1581: add benchmarks, mesh-1585

* fix rebase problems

* fix asset bench

* mesh-1581: add EA module docs

* mesh-1581: fix schema

* mesh-1581: reduce dependencies for EA module

* mesh-1618: add Except to SubsetRestriction

* mesh-1582: map groups to perms

* cargo fmt

* wip!

* wip

* tweak benchmarks

* tweak any EA prop logic

* fix owner migration

* EAs: use refcount for anti-orphaning

* fix cli tests

* test EA refcount more

* eas: improve internal docs

* fix cli tests more

* lattice_cmp: fix bug & add comments

* EA -> ExternalAgents

* MESH-1587: move Alcyone & general genesis identity balances to the bridge (#966)

* updated general genesis

* missing instance fix

* changed develop runtime pallet order to fix 0 balance

* added CDD claims to fix a bridge genesis error

* typo

* fixed TooLong in benchmarks

* fixed ComplianceRequirementTooComplex in compliance benchmark

* updated testnet genesis config

* using complete_txs and README updates

* changed module boot order in testnet, removed dead code

* added testnet JSON genesis config

* fmt

* Apply suggestions from code review

Co-authored-by: Mudit Gupta <guptamudit@ymail.com>

* removed a comment

* removed testnet JSONs

* minor changes

* Give perms to genesis secondary keys

* Make genesis accounts rich

* Fun more genesis accounts

* minor refactoring

* removed unused import

Co-authored-by: Mudit Gupta <guptamudit@ymail.com>

* polymesh_schema: fix missing changes due to EA (#1005)

* polymesh_schema: fix missing changes due to EA

* Update polymesh_schema.json

* Fix bug in primary key (PK) rotation where key already being attached to DID was allowed. (#1006)

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* Mesh 1196/refactor JS integration tests to TS (#915)

* Typed init.ts and modifying tsconfig

* modified init and create identities scripts

* added 1_poly_transfer.ts and helper files

* added 2_key_management .ts and helper files

* added 3_auth_join_did.ts and minor changes

* added 4_permission_management.ts, helper files, and formatted scripts

* added 5_claim_management.ts

* added 6_create_assets.ts

* minor change to fix complianceRequirement issue

* added 7_create_claim_compliance.ts and helper file

* added 8_asset_minting.ts

* added 9_bridge_transfer.ts and helper file

* added 10_governance_management.ts and help files

* added 11_A_settlement.ts and helper file

* added 11_B_settlement.ts

* general improvements

* improved error handling for identity script and helper

* minor changes

* improved error handling for poly_transfer script and asset helper

* improved error handling for key_management script and helper

* add catch to promises

* added @polkadot/typegen

* changes based around @polkadot/typegen

* minor change

* removed handle function

* minor changes

* Added Api Singleton Class and removed Api as a parameter from the scripts

* removed usage of unknown

* standardized on using signer and formatting

* removed .catch from lower levels

* added type safety to catch clause in scripts

* added offchain_worker_script.ts and made minor changes

* minor changes to comments and package.json

* minor change in asset_helper

* minor change

* removed old JS test scripts

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* MESH-1623/add memo field to portfolio (#1004)

* portfolio needs `Ord` on `Memo`

* Add memo field to portfolio.move_portfolio_funds.

TODO: Add tests with a memo.
TODO: Update docs.

* Add missing `memo` field in corporate-actions pallet

* code cleanup.

* Remove TODO comment.

* cargo fmt - fixup corporate-actions.

* Fix schema for `MovePortfolioItem` struct.

* Tests for `move_portfolio_funds` with memo.

Also checks for `MovedBetweenPortfolios` event.

* Add note about memo to `move_portfolio_funds` docs.

* MESH-1620/refactor (#1011)

* Move stand-alone fn to methods.

* Move with_call_metadata into dispatch_call.

* Refactor batch and batch_atomic.

* Refactor for loop into filter_map.

Not sure if this is more readable then the for loop.

* cargo fmt

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* ExternalAgents: Fix schema + `fn agent_permissions` (#1012)

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* MESH-1619/Allow rescheduling failed Settlements (#996)

* first draft

* first draft

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* WIP

* WIP

* WIP

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* WIP

* WIP

* WIP

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Update pallets/runtime/tests/src/settlement_test.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* WIP

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Update pallets/settlement/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* WIP

* WIP

* WIP

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* MESH-1621/Script to create snapshot of all user balances  (#1000)

* created script to get user balances and store them in a csv file

* added secondary keys and progress bar

* removed CSV and duplication while adding new field isPrimaryKey

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* MESH-1622/ create script to distribute POLYX (#1010)

* added script to distribute POLYX

* minor changes

* Bump lodash from 4.17.15 to 4.17.21 in /scripts/event-listener (#998)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* MESH-1620/improve batch functions (EventCounts, ErrorAt) (#1003)

* API change - Return a vector of event counts from the batch functions.

* code cleanup.

* Add `EventCounts` and `ErrorAt` types to schema.

* Fix ident.

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* Fix CI integration test. (#1020)

* MESH-1628/issue with duplicate secondary keys (#1018)

* Add more tests for `remove_secondary_key`

* Try adding the same key multiple times with different permissions.

* Add adding dup key with `add_secondary_keys_with_authorization`

* Improve `remove_secondary_keys_test`

* Add test for `set_permission_to_signer` with many tokens.

* cargo fmt

* Use reverse order for bulk permissions.

* Fix issue with remove_secondary_keys.

* Copy test from MESH-1640.

* Fix `PartialEq` impl for `SecondaryKey`

This fixes the dedup of the secondary_keys list.

* Only charge the fee after all checks.

* Check for duplicate secondary key before adding it.

This removes the need for the sort/dedup in `add_secondary_keys`.
Add tests for `join_identity`.

* cargo fmt

* Change `PartialEq` back.

The `PartialEq` impl is not used any more for preventing duplicate secondary keys.

* fix comment.

* Use default `PartialEq` impl.  Remove `Ord`

* code cleanup.

* Reduce redundant work.

* Some test cleanup.

* cargo fmt

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* MESH-1637/SecondaryKeyPermissionsUpdated event emits new permissions in both params (#1017)

* WIP

* WIP

* WIP

* WIP

* Fix linting errors

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>

* MESH-1642/Debug: Fuzz Settlement Tests (#1027)

* WIP

* WIP

* MESH-1638/Add a reverse map to allow an easy lookup from IdentityId to list of assets for which the identity is an EA (#1021)

* WIP

* WIP

* WIP

* Update pallets/external-agents/src/lib.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* WIP

* WIP

* WIP

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>

* Update spec version and release version

* Fix migrations (#1061)

Co-authored-by: CJP10 <cjpet10@gmail.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Francisco Miguel García <fmiguelgarcia@users.noreply.github.com>
Co-authored-by: Vladimir Komendantskiy <komendantsky@gmail.com>
Co-authored-by: Joel Moore <47923231+JMoore96@users.noreply.github.com>
Co-authored-by: poly-auto-merge[bot] <65769705+poly-auto-merge[bot]@users.noreply.github.com>
Co-authored-by: Mudit Gupta <guptamudit@ymail.com>
Co-authored-by: Robert Gabriel Jakabosky <rjakabosky+github@neoawareness.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Gabriel Jakabosky <rjakabosky+neopallium@neoawareness.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-api-changes PR includes changes that break existing APIs merge-after-ci PR can be merged after CI has completed release-notes Tag to use if PR needs to be reflected in release notes storage-modification-changes PR includes changes that modify storage and requires additional logic to upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants