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

transfer_benefit: fix 'remaining' underflow #975

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 26, 2021

changelog

modified logic

  • Fixed a bug in Distribution::{claim, push_benefit} where remaining could underflow/wrap when sufficient tokens were locked but amount was too small.

@Centril Centril added the release-notes Tag to use if PR needs to be reflected in release notes label Mar 26, 2021
@Centril Centril requested a review from a team March 26, 2021 13:23
@maxsam4 maxsam4 added the merge-after-ci PR can be merged after CI has completed label Mar 30, 2021
@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #975 (99c70cc) into develop (50dfe42) will increase coverage by 0.15%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #975      +/-   ##
===========================================
+ Coverage    66.32%   66.47%   +0.15%     
===========================================
  Files           90       90              
  Lines        14707    14710       +3     
===========================================
+ Hits          9754     9779      +25     
+ Misses        4953     4931      -22     
Impacted Files Coverage Δ
pallets/corporate-actions/src/distribution/mod.rs 96.29% <100.00%> (+0.14%) ⬆️
primitives/src/asset_identifier.rs 96.96% <0.00%> (-0.61%) ⬇️
pallets/identity/src/lib.rs 86.89% <0.00%> (+0.20%) ⬆️
pallets/settlement/src/lib.rs 88.24% <0.00%> (+3.12%) ⬆️

@poly-auto-merge poly-auto-merge bot merged commit aef0461 into develop Mar 30, 2021
@poly-auto-merge poly-auto-merge bot deleted the claim-underflow-fix branch March 30, 2021 10:58
@maxsam4 maxsam4 mentioned this pull request Apr 7, 2021
maxsam4 added a commit that referenced this pull request Apr 7, 2021
* Fixed cargo.lock (#971)

* MESH-1545/Improve STO code coverage (#963)

* WIP

* revert logic changes

* fix timestamps

* comments

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

* unset PortfolioCustodian if custodian is owner (#976)

* transfer_benefit: fix 'remaining' underflow (#975)

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

* Expose constants in metadata (#972)

* Exposed constants in metadata

* fixed test build

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

* Minor GC related fixes (#973)

* minor fixes

* fixed tests

* linting

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

* MESH-1600, MESH-1601, MESH-1590, MESH-1591 (#974)

* mesh-1601: test asset limits

* mesh-1601: test portfolio limits

* mesh-1601: test contracts limits

* mesh-1601: test ballot limits

* mesh-1601: test pips limits

* mesh-1601: test sto limits

* mesh-1601: test settlement limits

* identity_test: some assert_err! -> assert_noop!

* various assert_err! -> assert_noop!

* mesh-1600: fix transactionality issues

* mesh-1601: test identity limits

* mesh-1591, mesh-1590: refactor tests

* import fixes

* benchmark fixes

* mesh-1601: address review comments

* mesh-1601: address review comments + refactor

* fixed build warning

* Fixed test build

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

* UT for `add_investor_uniqueness_claim_v2` (#970)

* New `Identity::add_investor_uniqueness_claim_v2`

This version uses the new PIUSv2 version from `confidential_identity`.

* Bug fix & benchmark

* ScopeId generated from `InvestorZKProofData`.

* minor fixes

* updated schema

* CodeReview fixes

* Fix error from last merge

* Add UT for add_investor_uniqueness_claim_v2

* Remove some intermedite changes

* Add `scope_id` verification

* CodeReview: Naming fixes

* Add `Claim::InvestorUniquenessV2`

* Fix WASM error in benchmark

* Remove `Scope` from `Claim::InvestorUniquenessV2`

* Fix Schema

* Add doc about new `revoke_claim_by_index`

* CodeReview: doc fixed

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

* Remove some unused RPCs (#980)

* added rpc check

* removed some unused RPCs

* removed unused function

* Update scripts/cli/util/rpc_u128_check.js

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

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

* Merge pull request #983 from PolymathNetwork/bump-versions

Bumped version to 3.0.1

Co-authored-by: CJP10 <cjpet10@gmail.com>
Co-authored-by: Vladimir Komendantskiy <komendantsky@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>
Co-authored-by: Francisco Miguel García <fmiguelgarcia@users.noreply.github.com>
This was referenced Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants