feat(royalties): make royalties payment to be 15% of the total storage cost #967
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #962
Description
Summary generated by Reviewpad on 14 Nov 23 14:23 UTC
This pull request includes the following changes:
The
event.rs
file has a change on line 925, where theerror!()
macro has been replaced withdebug!()
macro. This suggests a change in the logging level from error to debug.The
registers.rs
file now includes an additional variableroyalties_fees
in themain
function's assignment of(register, cost, royalties_fees)
.The changes in the file
genesis.rs
are related to the calculation and handling of network royalties. The constantGENESIS_CASHNOTE_AMOUNT
has been updated, a new functioncalculate_royalties_fee
has been added, and the visibility of the constantGENESIS_CASHNOTE_SK
has been changed to public.The
Files
implementation in thestorage.rs
file now accepts an additional parameterchunks: Vec<XorName>
in thepay_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.The changes in the
storage_payments.rs
file are related to the addition of the_royalties_fees
variable in thestorage_payment_register_creation_succeeds
andstorage_payment_register_creation_and_mutation_fails
functions.The
register.rs
file includes changes in multiple functions. Thecreate_register
function now returns an additional value of typeNanoTokens
. Thesync
function returns a tuple(NanoTokens, NanoTokens)
, and the variablesstorage_cost
,royalties_fees
, andcost
are now mutable.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.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.The
register.rs
file has changes related to thecreate_register
function, including variable renaming and updating println statements.The
api.rs
file now includes a new parameter in theClient::register_replica
function and returns a tuple(ClientRegister, NanoTokens, NanoTokens)
. These changes enhance the function to include the calculation and tracking oftotal_royalties
.The
lib.rs
file includes the addition of thecalculate_royalties_fee
function, as well as variables related to thegenesis
module andsn_transfers
library.The
put_validation.rs
file includes the addition of thecalculate_royalties_fee
function, rearranged import statements, and updated fee calculation and condition checks.The
mod.rs
file in thesubcommands/files
directory includes changes related to royalties fees calculation, output messages, and logging in theupload_files
function.Please review these changes and ensure they align with the intended functionality of the code.