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

Improve docs on transfer() + minimum_balance() #540

Merged
merged 3 commits into from
Oct 26, 2020
Merged

Conversation

cmichi
Copy link
Collaborator

@cmichi cmichi commented Oct 24, 2020

Closes #538 by clearing up the confusion that lead to it.

@athei I think it makes sense to expose a getter for the subsistence_threshold from seal. Otherwise it's not possible to take this variable into consideration in the smart contract when calculating how much to transfer (like in the issue).

/// Subsistence threshold is the extension of the minimum balance (aka existential deposit) by the
/// tombstone deposit, required for leaving a tombstone.

(from here)

We already have the minimum_balance, so it seems consistent to expose the subsistence threshold as well. Wdyt?

@codecov-io
Copy link

codecov-io commented Oct 24, 2020

Codecov Report

Merging #540 into master will decrease coverage by 14.60%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #540       +/-   ##
===========================================
- Coverage   83.15%   68.55%   -14.61%     
===========================================
  Files         155      155               
  Lines        6811     6811               
===========================================
- Hits         5664     4669      -995     
- Misses       1147     2142      +995     
Impacted Files Coverage Δ
crates/env/src/api.rs 37.50% <ø> (ø)
crates/env/src/backend.rs 0.00% <ø> (ø)
crates/env/src/engine/off_chain/db/chain_spec.rs 100.00% <ø> (ø)
crates/lang/src/env_access.rs 0.00% <ø> (ø)
crates/lang/codegen/src/traits.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/ir/src/ir/contract.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/env.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/storage.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/contract.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/trait_def.rs 0.00% <0.00%> (-100.00%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bdbd54...b94113f. Read the comment docs.

Copy link
Collaborator

@Robbepop Robbepop left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks a lot for the docs improvements!

@Robbepop Robbepop merged commit 0b1be71 into master Oct 26, 2020
@Robbepop Robbepop deleted the cmichi-improve-docs branch October 26, 2020 08:14
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.

Unable to transfer contract balance to another account
3 participants