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: chunk payments using UTXOs instead of DBCs #721

Merged
merged 4 commits into from Sep 12, 2023

Conversation

grumbach
Copy link
Member

@grumbach grumbach commented Sep 12, 2023

Description

Summary generated by Reviewpad on 12 Sep 23 04:49 UTC

This pull request includes the following changes:

  1. In the file sn_protocol/src/messages/mod.rs:

    • The utxo module was removed from the module imports.
    • The Utxo struct was removed from the public exports.
    • The Transfer struct was removed from the public exports.
  2. In the file api.rs:

    • Line 17: Import statement for sn_dbc::Token has been removed.
    • Line 27: Import statement for sn_transfers::client_transfers::SpendRequest has been added.
    • Line 29: Import statement for sn_transfers::wallet::Transfer has been added.
    • Line 50: The type of the payment parameter in the store_chunk method has been changed from Vec<Dbc> to Vec<Transfer>.
  3. In the file Cargo.toml:

    • Added the dependency rmp-serde with version 1.1.1.
    • Modified the sn_dbc dependency by commenting out the version 19.1.1 and adding a new line that specifies a path to the sn_dbc crate with the serdes feature.
    • Updated the sn_protocol dependency to version 0.6.4.
    • Updated the tokio dependency to version 1.32.0 with the features macros and rt.
    • Added the dependency thiserror with version 1.0.23.
  4. In the file error.rs:

    • In the Error enum, the RecordNotStored variant has been modified to include an additional String parameter.
      • Before: RecordNotStored(PrettyPrintRecordKey)
      • After: RecordNotStored(PrettyPrintRecordKey, String)
    • The UtxoSerialisationFailed and UtxoDecryptionFailed variants have been removed from the Error enum.
  5. In the file mod.rs:

    • Added a new module called utxo.
    • Exported the Transfer and Utxo types from the module utxo.
    • No other changes were made to the existing code.
  6. A new file named receive_transfer.rs has been added in the sn_node/src directory. This file contains a license header, which states that the SAFE Network Software is licensed under the General Public License (GPL), version 3. The license grants permissions and limitations for using the software.

  7. In the file sequential_transfers.rs:

    • Line 15: The import statement for create_transfer from sn_transfers::client_transfers has been changed to import create_offline_transfer.
    • Lines 34-37: The function create_transfer is replaced with create_offline_transfer in the code.
  8. In the file local_store.rs in the sn_transfers/src/wallet directory:

    • Imported Error, Transfer, and Utxo types from the current module.
    • Renamed create_transfer function to create_offline_transfer.
    • Updated function calls to create_offline_transfer.
    • Added new function create_transfers that creates transfers from the given DBCs.
    • Added new function decipher_transfer that deciphers a transfer using the secret key.
    • Added new function decipher_transfer_for_us that deciphers a transfer for us.
    • Added new function derive_key that derives a key using the derivation index.
  9. In the file sn_client/src/wallet.rs:

    • Imported wallet::Transfer from sn_transfers module.
    • Changed the function name get_payment_dbcs to get_payment_transfers.
    • Updated the return type of get_payment_transfers to Result<Vec<Transfer>>.
    • Added code to create transfers from DBCs.
  10. The file transfer.rs shows a change in the function name create_transfer to create_offline_transfer. Additionally, there are changes in the function parameters and their types. The available_dbcs parameter is now of type Vec<(Dbc, DerivedKey)>, the recipients parameter is of type Vec<(Token, PublicAddress, DerivationIndex)>, and the change_to parameter is of type PublicAddress.

  11. In the Cargo.toml file:

    • The dependency sn_dbc has been modified. It was previously version 19.1.1 with the feature "serdes", but now it is commented out and a new dependency with a path to ../../sn_dbc and the feature "serdes" has been added.
    • The version of the sn_client dependency has been updated to 0.88.9.
    • The version of the sn_logging dependency has been updated to 0.2.5.
    • The version of the sn_networking dependency has been updated to 0.5.9.

Please let me know if you have any questions or need further clarification.

@reviewpad reviewpad bot added the Large Large sized PR label Sep 12, 2023
@grumbach grumbach marked this pull request as ready for review September 12, 2023 06:58
@reviewpad reviewpad bot requested a review from bochaco September 12, 2023 06:58
@joshuef joshuef added this pull request to the merge queue Sep 12, 2023
Merged via the queue into maidsafe:main with commit bf60339 Sep 12, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Large Large sized PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants