mobilecoinofficial / full-service

A MobileCoin service for wallet implementations.
Other
46 stars 21 forks source link

Add Require Spend Subaddress #989

Closed sugargoat closed 5 months ago

sugargoat commented 6 months ago

Motivation

We would like to provide a guard rail for the use of subaddress_to_spend_from, so that an account can enforce that transactions using the Txos within the account adhere to the scheme of spending from any Txo regardless of which subaddress it was sent to (the turnstile model), or requiring that a subaddress to spend from is always specified (so the Txos don’t get mixed together and create inconsistent subaddress balances)

In this PR

Test Plan

Future Work

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 50.49505% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 55.61%. Comparing base (ab2af32) to head (c416c74). Report is 193 commits behind head on main.

Files Patch % Lines
full-service/src/json_rpc/v2/api/wallet.rs 54.05% 10 Missing and 7 partials :warning:
full-service/src/json_rpc/v2/api/request.rs 8.33% 10 Missing and 1 partial :warning:
full-service/src/service/account.rs 52.63% 2 Missing and 7 partials :warning:
full-service/src/service/transaction.rs 44.44% 0 Missing and 5 partials :warning:
full-service/src/db/account.rs 66.66% 1 Missing and 1 partial :warning:
...-service/src/json_rpc/v2/models/account_secrets.rs 33.33% 2 Missing :warning:
full-service/src/db/schema.rs 0.00% 0 Missing and 1 partial :warning:
full-service/src/json_rpc/v2/api/response.rs 0.00% 1 Missing :warning:
full-service/src/json_rpc/v2/models/account.rs 50.00% 1 Missing :warning:
full-service/src/service/gift_code.rs 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #989 +/- ## ========================================== - Coverage 60.12% 55.61% -4.51% ========================================== Files 88 124 +36 Lines 12356 16290 +3934 Branches 2010 2796 +786 ========================================== + Hits 7429 9060 +1631 - Misses 3238 5145 +1907 - Partials 1689 2085 +396 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

holtzman commented 6 months ago

@sugargoat I like the renaming, and while we are at it, what about if we make it:

This would be consistent and concise. If you are ok with this, I'd be happy to do the search-replace and push a commit.

sugargoat commented 5 months ago

@sugargoat I like the renaming, and while we are at it, what about if we make it:

  • spend_subaddress for the field that specifies which subaddress to spend from, and
  • require_spend_subaddress for the mode that requires it?

This would be consistent and concise. If you are ok with this, I'd be happy to do the search-replace and push a commit.

No worries - happy to get the renaming in order!