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

feat(royalties): make royalties payment to be 15% of the total storage cost #967

Merged
merged 1 commit into from Nov 15, 2023

Conversation

bochaco
Copy link
Member

@bochaco bochaco commented Nov 14, 2023

Resolves #962

Description

Summary generated by Reviewpad on 14 Nov 23 14:23 UTC

This pull request includes the following changes:

  1. The event.rs file has a change on line 925, where the error!() macro has been replaced with debug!() macro. This suggests a change in the logging level from error to debug.

  2. The registers.rs file now includes an additional variable royalties_fees in the main function's assignment of (register, cost, royalties_fees).

  3. The changes in the file genesis.rs are related to the calculation and handling of network royalties. The constant GENESIS_CASHNOTE_AMOUNT has been updated, a new function calculate_royalties_fee has been added, and the visibility of the constant GENESIS_CASHNOTE_SK has been changed to public.

  4. The Files implementation in the storage.rs file now accepts an additional parameter chunks: Vec<XorName> in the pay_for_chunks function. The function also returns a tuple (NanoTokens, NanoTokens, NanoTokens) instead of (NanoTokens, NanoTokens). These changes improve the payment process for chunks and provide more information in the resulting tuple.

  5. The changes in the storage_payments.rs file are related to the addition of the _royalties_fees variable in the storage_payment_register_creation_succeeds and storage_payment_register_creation_and_mutation_fails functions.

  6. The register.rs file includes changes in multiple functions. The create_register function now returns an additional value of type NanoTokens. The sync function returns a tuple (NanoTokens, NanoTokens), and the variables storage_cost, royalties_fees, and cost are now mutable.

  7. The local_store.rs file includes changes related to the calculation of network royalties fees, removal of constants, initialization of variables, modification of loops, and usage of public constants.

  8. The changes in the rewards.rs file involve improvements and refinements to the rewards system for storing registers and chunks, as well as transferring notifications. Changes include variable renamings, tuple additions, and verification logic.

  9. The register.rs file has changes related to the create_register function, including variable renaming and updating println statements.

  10. The api.rs file now includes a new parameter in the Client::register_replica function and returns a tuple (ClientRegister, NanoTokens, NanoTokens). These changes enhance the function to include the calculation and tracking of total_royalties.

  11. The lib.rs file includes the addition of the calculate_royalties_fee function, as well as variables related to the genesis module and sn_transfers library.

  12. The put_validation.rs file includes the addition of the calculate_royalties_fee function, rearranged import statements, and updated fee calculation and condition checks.

  13. The mod.rs file in the subcommands/files directory includes changes related to royalties fees calculation, output messages, and logging in the upload_files function.

Please review these changes and ensure they align with the intended functionality of the code.

@reviewpad reviewpad bot added the Medium Medium sized PR label Nov 14, 2023
@bochaco bochaco force-pushed the feat-royalties-fee-15-percent branch 3 times, most recently from 7489270 to ffa9cc5 Compare November 14, 2023 15:10
@reviewpad reviewpad bot added Small Pull request is small and removed Medium Medium sized PR labels Nov 14, 2023
@bochaco bochaco force-pushed the feat-royalties-fee-15-percent branch 2 times, most recently from 433f6d9 to fde8017 Compare November 14, 2023 17:27
@bochaco bochaco marked this pull request as ready for review November 14, 2023 17:28
@reviewpad reviewpad bot requested a review from grumbach November 14, 2023 17:28
@bochaco bochaco force-pushed the feat-royalties-fee-15-percent branch from fde8017 to 521658d Compare November 14, 2023 17:40
@reviewpad reviewpad bot added Medium Medium sized PR and removed Small Pull request is small labels Nov 14, 2023
@bochaco bochaco force-pushed the feat-royalties-fee-15-percent branch from 9ede211 to 56664d7 Compare November 14, 2023 18:21
@bochaco bochaco force-pushed the feat-royalties-fee-15-percent branch from 56664d7 to 59043ff Compare November 14, 2023 18:49
Copy link
Member

@grumbach grumbach left a comment

Choose a reason for hiding this comment

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

LGTM

@grumbach grumbach added this pull request to the merge queue Nov 15, 2023
Merged via the queue into maidsafe:main with commit 3a729d9 Nov 15, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Medium sized PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update royalties + tests to ensure 15% of data payment value is the royalty fee
2 participants