-
Notifications
You must be signed in to change notification settings - Fork 39
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(sdk): token and group queries #2449
base: v2.0-dev
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request makes extensive modifications across multiple packages. It increases the number of versioned message types in the gRPC configuration and adds new TransportRequest implementations. Conditional compilation is introduced for serializing test fixtures, and significant updates are made to genesis state generation and SDK test data creation functions. New FromProof implementations, query builders, and public API modules for token and group management are added. Additionally, the PR improves error handling, updates Docker build arguments, refines WASM bindings, and revises state transition builders for fungible tokens. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant GRPC_Client
participant Drive
Client->>GRPC_Client: Send request (e.g., GetTokenStatusesRequest)
GRPC_Client->>Drive: Forward request for proof verification
Drive-->>GRPC_Client: Return verified proof and query result
GRPC_Client-->>Client: Deliver response with token statuses
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
5d54570
to
21de3a4
Compare
@CodeRabbit review |
✅ Actions performedReview triggered.
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (25)
packages/rs-drive-proof-verifier/src/tokens/token_total_supply.rs (1)
30-35
: Consider future-proofing version handling.Currently, the code only handles
Version::V0
. If future versions are introduced, you may want to include a fallback match arm or a more explicit error message for unsupported versions.packages/rs-drive-proof-verifier/src/tokens/token_status.rs (1)
36-45
: Account for potential new versions.Similar to the token total supply logic, consider adding a match arm for future versions, or provide an explicit error for unsupported versions to make this more robust.
packages/rs-sdk/src/platform/tokens/identity_token_balances.rs (2)
14-21
: Consider validating non-empty token IDs.If your business logic requires at least one token, add checks or return a more explicit error when
token_ids
is empty.
44-50
: Validate identity IDs if needed.If your use case mandates at least one identity, ensure the code handles an empty
identity_ids
array appropriately.packages/rs-sdk/src/platform/group_actions.rs (1)
50-105
: Potential code duplication among multiple queries
GroupInfosQuery
and similar query structs below share a near-identical pattern of defining a struct with optional fields and implementingQuery<...>
. If code reuse or maintainability becomes an issue, consider a macro or templated approach to reduce boilerplate.packages/rs-drive-proof-verifier/src/tokens/identity_token_balance.rs (1)
132-198
: Consistent approach in multi-identity proof
Themaybe_from_proof_with_metadata
method follows the same robust verification pattern. The repeated logic might benefit from a shared utility function if this pattern continues in other modules.packages/rs-drive-proof-verifier/src/tokens/token_info.rs (2)
85-85
: Potential debug printing
There's aprintln!
statement at line 85 that logs the proof in hex. Consider removing or gating it behind a debug feature flag to prevent unintentional large or sensitive logs in production.- println!("{:?}", hex::encode(&proof.grovedb_proof)); + // println!("{:?}", hex::encode(&proof.grovedb_proof));
133-198
: Robust multi-identity info verification
Again, the pattern of verifying the proof, mapping errors, and returning(Option<Self>, ResponseMetadata, Proof)
is well-written. If you foresee more repeated proof-verification flows, refactoring into a shared helper might further optimize code reuse.packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs (3)
50-103
: Consider splitting or renaming this function for improved clarity.The
create_data_for_group_token_queries
function performs a variety of operations (identity registration, data contract creation, token minting, freezing, pausing, and adding group actions). This goes beyond simply "creating data." Splitting it into smaller functions or clarifying the name can help enhance readability and maintainability.
72-82
: Clarify the comment on which token is being paused."Pause token 2" might be confusing if you are referring to the token indexed at
TOKEN_ID_2
. Currently, the code usesTOKEN_ID_1
, which is the "second" token in a zero-based index. Consider adjusting the comment for consistency:- // Pause token 2 + // Pause the second token (TOKEN_ID_1)
120-121
: Confirm the handling of private keys.There's a comment hinting that private keys may be printed, but no actual logging takes place. If printing or logging is needed for debugging, add the relevant code. Otherwise, remove or revise the comment to avoid confusion.
packages/rs-drive-proof-verifier/src/group_actions.rs (1)
87-167
: Consider factoring out shared logic.This logic for extracting request fields, verifying proofs, and mapping results repeats across the file. Extracting it into a helper method or utility could reduce duplication and enhance maintainability.
packages/rs-sdk/src/platform/tokens/mod.rs (1)
3-4
: Fix incorrect documentation comment.The documentation comment for
token_info
module is incorrect as it's a copy of theidentity_token_balances
module's comment.Apply this diff to fix the documentation:
-/// Identity token balances queries +/// Token information queriespackages/rs-drive-proof-verifier/src/tokens/mod.rs (1)
1-2
: Maintain consistent module naming across packages.The module name
identity_token_balance
(singular) in the proof verifier differs fromidentity_token_balances
(plural) in the SDK. Consider using consistent naming to improve maintainability.Apply this diff to align with the SDK's naming:
-pub mod identity_token_balance; +pub mod identity_token_balances;packages/rs-sdk/tests/fetch/tokens/token_total_supply.rs (1)
8-14
: Consider adding more test cases.While the test setup is correct, consider adding test cases for:
- Invalid token IDs
- Error handling scenarios
- Edge cases with different supply values
packages/rs-sdk/src/platform/tokens/token_total_supply.rs (1)
7-20
: Consider adding input validation.While the Query implementation is correct, consider adding validation for the token ID before creating the request.
impl Query<GetTokenTotalSupplyRequest> for Identifier { fn query(self, prove: bool) -> Result<GetTokenTotalSupplyRequest, Error> { + if self.is_empty() { + return Err(Error::InvalidInput("Token ID cannot be empty".into())); + } let request = GetTokenTotalSupplyRequest { version: Some(get_token_total_supply_request::Version::V0(packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs (1)
17-32
: Consider adding logging for test data generation.While the implementation is correct, adding debug logs would help track test data generation during testing.
pub(super) fn create_sdk_test_data( &self, block_info: &BlockInfo, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { + log::debug!("Creating SDK test data for local network"); if self.config.network != Network::Regtest { return Err(Error::Execution(ExecutionError::CorruptedCodeExecution( "create_sdk_test_data must be called only on local network", ))); } self.create_data_for_group_token_queries(block_info, transaction, platform_version)?; + log::debug!("SDK test data creation completed"); Ok(()) }packages/rs-sdk/tests/fetch/tokens/token_status.rs (1)
21-22
: Improve error handling in test expectation.The current error message doesn't match the actual operation being performed.
.await - .expect("fetch identity token infos"); + .expect("fetch token statuses");packages/rs-sdk/src/platform.rs (1)
3-6
: Consider documenting new modules.While the module additions align with the PR objectives, they should be documented similar to other modules in the file. Also, the TODO comment suggests a future refactor - consider creating a tracking issue.
Would you like me to help create a tracking issue for the TODO regarding proper user-facing API design?
Also applies to: 20-21
packages/rs-sdk/tests/fetch/group_actions.rs (2)
60-87
: Consider removing the debug print statement.The test effectively validates group fetching with pagination. However, the
dbg!
statement on line 78 should be removed as it's not necessary for the test.- dbg!(&groups);
126-156
: Consider removing the debug print statement.The test effectively validates group action fetching. However, the
dbg!
statement on line 148 should be removed as it's not necessary for the test.- dbg!(&group_actions);
packages/rs-sdk/src/mock/requests.rs (1)
287-424
: Consider reducing code duplication in mock implementations.The serialization/deserialization logic is very similar across
IdentityTokenInfos
,IdentitiesTokenInfos
,TokenStatuses
, andGroupActions
. Consider extracting the common pattern into a macro or helper function.Example macro approach:
macro_rules! impl_mock_response_for_retrieved_values { ($type:ty, $value_type:ty) => { impl MockResponse for $type { fn mock_serialize(&self, sdk: &MockDashPlatformSdk) -> Vec<u8> { let vec: Vec<(Identifier, Option<$value_type>)> = self.iter().map(|(k, v)| (*k, v.clone())).collect(); platform_encode_to_vec(vec, BINCODE_CONFIG, sdk.version()) .expect(concat!("encode ", stringify!($type))) } fn mock_deserialize(sdk: &MockDashPlatformSdk, buf: &[u8]) -> Self where Self: Sized, { let vec: Vec<(Identifier, Option<$value_type>)> = platform_versioned_decode_from_slice(buf, BINCODE_CONFIG, sdk.version()) .expect(concat!("decode ", stringify!($type))); RetrievedValues::from_iter(vec) } } }; } // Usage: impl_mock_response_for_retrieved_values!(IdentityTokenInfos, IdentityTokenInfo); impl_mock_response_for_retrieved_values!(IdentitiesTokenInfos, IdentityTokenInfo); impl_mock_response_for_retrieved_values!(TokenStatuses, TokenStatus); impl_mock_response_for_retrieved_values!(GroupActions, GroupAction);packages/rs-sdk/Cargo.toml (1)
62-63
: Track the TODO comment about removing features from default.The comment indicates that
mocks
andoffline-testing
should be removed from default features in the future.Would you like me to create an issue to track this technical debt?
packages/rs-sdk/README.md (2)
96-98
: Clarify Test Vector Generation InstructionsThe updated steps clearly instruct developers to (1) uncomment the
create_sdk_test_data(...)
call, (2) run thegenerate_test_vectors.sh
script, and (3) optionally commit the generated vectors.Suggestion: Consider adding a brief note clarifying whether generated test vector files should be committed or ignored (for example, via a .gitignore rule) to prevent accidental pollution of the repository.
146-147
: Review Duplicate Checklist StepsThe checklist now contains duplicate instructions for:
- Uncommenting
create_sdk_test_data(...)
(see step 2 on line 96 and step 15 on line 146), and- Generating test vectors (step 3 on line 97 versus step 16 on line 147).
Please confirm whether both occurrences are necessary or if these steps can be consolidated to avoid confusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (82)
packages/dapi-grpc/build.rs
(3 hunks)packages/rs-dapi-client/src/transport/grpc.rs
(1 hunks)packages/rs-dpp/src/balances/total_single_token_balance/mod.rs
(1 hunks)packages/rs-dpp/src/tokens/info/mod.rs
(2 hunks)packages/rs-dpp/src/tokens/info/v0/mod.rs
(1 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs
(2 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs
(1 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs
(1 hunks)packages/rs-drive-proof-verifier/Cargo.toml
(1 hunks)packages/rs-drive-proof-verifier/src/group_actions.rs
(1 hunks)packages/rs-drive-proof-verifier/src/lib.rs
(1 hunks)packages/rs-drive-proof-verifier/src/tokens/identity_token_balance.rs
(1 hunks)packages/rs-drive-proof-verifier/src/tokens/mod.rs
(1 hunks)packages/rs-drive-proof-verifier/src/tokens/token_info.rs
(1 hunks)packages/rs-drive-proof-verifier/src/tokens/token_status.rs
(1 hunks)packages/rs-drive-proof-verifier/src/tokens/token_total_supply.rs
(1 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_33_46-3251.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_00-10108.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_04-10384.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_08-10643.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_12-10937.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_20-11458.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_23-11733.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_25-11999.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_26-12247.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_28-12710.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_29-12958.txt
(0 hunks)packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_30-13195.txt
(0 hunks)packages/rs-platform-value/src/types/identifier.rs
(1 hunks)packages/rs-sdk/Cargo.toml
(2 hunks)packages/rs-sdk/README.md
(3 hunks)packages/rs-sdk/src/mock/requests.rs
(6 hunks)packages/rs-sdk/src/mock/sdk.rs
(1 hunks)packages/rs-sdk/src/platform.rs
(1 hunks)packages/rs-sdk/src/platform/group_actions.rs
(1 hunks)packages/rs-sdk/src/platform/tokens/identity_token_balances.rs
(1 hunks)packages/rs-sdk/src/platform/tokens/mod.rs
(1 hunks)packages/rs-sdk/src/platform/tokens/token_info.rs
(1 hunks)packages/rs-sdk/src/platform/tokens/token_status.rs
(1 hunks)packages/rs-sdk/src/platform/tokens/token_total_supply.rs
(1 hunks)packages/rs-sdk/tests/fetch/config.rs
(3 hunks)packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs
(1 hunks)packages/rs-sdk/tests/fetch/generated_data.rs
(1 hunks)packages/rs-sdk/tests/fetch/group_actions.rs
(1 hunks)packages/rs-sdk/tests/fetch/mod.rs
(1 hunks)packages/rs-sdk/tests/fetch/tokens/identity_token_balances.rs
(1 hunks)packages/rs-sdk/tests/fetch/tokens/mod.rs
(1 hunks)packages/rs-sdk/tests/fetch/tokens/token_info.rs
(1 hunks)packages/rs-sdk/tests/fetch/tokens/token_status.rs
(1 hunks)packages/rs-sdk/tests/fetch/tokens/token_total_supply.rs
(1 hunks)packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/data_contract-e668c659af66aee1e72c186dde7b5b7e0a1d712a09c40d5721f622bf53c53155.json
(1 hunks)packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
(0 hunks)
⛔ Files not processed due to max files limit (31)
- packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_identity_token_info/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_multiple_identities_token_balances/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_multiple_identities_with_unknown_token_balance/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_multiple_identity_token_balances/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_token_status/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
- packages/rs-sdk/tests/vectors/test_token_total_supply/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
💤 Files with no reviewable changes (28)
- packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_33_46-3251.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_04-10384.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_00-10108.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_20-11458.txt
- packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_23-11733.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_12-10937.txt
- packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_08-10643.txt
- packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-029045172fbebcf97290db8879490a48ac0d1d60e249d031b5ad79e3e46e3fca.json
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_25-11999.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_29-12958.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_26-12247.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_30-13195.txt
- packages/rs-platform-serialization-derive/rustc-ice-2024-02-20T10_35_28-12710.txt
✅ Files skipped from review due to trivial changes (1)
- packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/data_contract-e668c659af66aee1e72c186dde7b5b7e0a1d712a09c40d5721f622bf53c53155.json
🧰 Additional context used
📓 Learnings (9)
packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
🪛 Biome (1.9.4)
packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
[error] 1-1: String values must be double quoted.
(parse)
🔇 Additional comments (70)
packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Intentional Test Vector Hash AdditionThe added hash value is used as a test vector for validating data contract reads. The file intentionally does not follow standard JSON formatting, which aligns with project-specific practices for mock test data.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Intentional Non-Standard JSON Format for Test DataThe file introduces a single-line hash value without the typical double quotes expected in standard JSON. This deviation is intentional according to the project's testing framework, which accepts non-standard JSON formats for mock data files.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Intentionally Non-Standard JSON Format is AcceptableThe file contains a hash value in plain text without double quotes, which deviates from strict JSON formatting. This is intentional for test vectors in this directory—as noted in previous learnings—even though static analysis flags it. The added newline at the end ensures proper file termination.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-drive-proof-verifier/src/tokens/token_total_supply.rs (1)
44-63
: Implementation looks correct.The logic properly verifies the token total supply proof and aggregated identity balance, and the error handling for GroveDB proof parsing appears solid.
packages/rs-drive-proof-verifier/src/tokens/token_status.rs (1)
54-64
: Approach looks valid.Your approach to verifying token statuses and mapping errors to
GroveDBError
is consistent with the rest of the codebase.packages/rs-sdk/src/platform/tokens/identity_token_balances.rs (1)
52-69
: Well-structured query construction.The creation of gRPC request objects and integration with the
FetchMany
trait aligns nicely with the SDK's existing patterns.packages/rs-sdk/src/platform/group_actions.rs (5)
23-30
: Well-structured group query definition
TheGroupQuery
struct and its fields are clearly documented and self-explanatory. Nice use of doc comments to clarify each field's purpose.
32-45
: Proper request construction
Theimpl Query<GetGroupInfoRequest>
cleanly instantiates the request struct. Consider adding additional validation logic (e.g., whethergroup_contract_position
is valid) if there's a possibility of out-of-range values.Would you like me to generate a script to search for all potential out-of-range casts of
GroupContractPosition
?
46-49
: Simple, consistent fetch interface
Usingimpl Fetch for Group
is straightforward for bridging the entity with the request type.
106-132
: Handled optional start action ID effectively
Your approach of mapping(Identifier, StartAtIncluded)
directly into the request struct is clean and readable. Make sure that usage in other modules is consistent with how optional start IDs are handled here.
134-168
: Consistent approach for group action signers
TheGroupActionSignersQuery
struct and itsQuery<GetGroupActionSignersRequest>
implementation mirror the earlier patterns, keeping the codebase consistent. Good job ensuring all relevant fields (contract ID, position, status, action ID) map to the request.packages/rs-drive-proof-verifier/src/tokens/identity_token_balance.rs (3)
17-39
: Clean newtype for identity token balances
WrappingRetrievedObjects<Identifier, TokenAmount>
inIdentityTokenBalances
is a neat way to provide domain-specific meaning. This pattern helps keep the code self-documenting.
41-107
: Robust proof verification flow
Theimpl FromProof<GetIdentityTokenBalancesRequest>
carefully validates the request, checks for missing metadata, and callsDrive::verify_token_balances_for_identity_id
. The error mapping forGroveDBError
to a custom error type is well done. This ensures precise error reporting.
108-130
: Same pattern extended for multiple identities
Similar toIdentityTokenBalances
,IdentitiesTokenBalances
wrapsRetrievedObjects<Identifier, TokenAmount>
. TheFromIterator
implementation is a nice convenience, allowing flexible construction.packages/rs-drive-proof-verifier/src/tokens/token_info.rs (3)
17-39
: Clear domain structure for token infos
IdentityTokenInfos
provides a straightforward domain type for mapping token IDs toIdentityTokenInfo
. DerivingFrom
andDeref
is a simple yet powerful design, facilitating easy iteration and access.
41-107
: Solid request and proof handling
Theimpl FromProof<GetIdentityTokenInfosRequest>
workflow is carefully laid out, including error handling for invalid 32-byte conversions and thorough proof checks. Great attention to detail with returningError::RequestError
when conversions fail.
110-130
: Similar approach for multiple identities
IdentitiesTokenInfos
mirrors the single-identity struct, which is helpful for maintaining a uniform mental model of token info retrieval.packages/rs-drive-proof-verifier/src/group_actions.rs (3)
21-82
: Implementation looks clear and correct.The proof verification flow and error handling are well structured.
172-278
: Implementation aligns with the established pattern.Everything here follows the same approach as previous blocks, ensuring consistency and clarity. No specific issues found.
283-368
: No issues detected here.Code is consistent with other proof-verification methods in this file.
packages/rs-sdk/tests/fetch/tokens/mod.rs (1)
1-4
: Modules look good.These new modules logically partition token-related tests, improving test organization.
packages/rs-drive-proof-verifier/src/lib.rs (1)
18-21
: LGTM!The new module declarations are properly documented and well-organized.
packages/rs-dpp/src/tokens/info/v0/mod.rs (1)
3-4
: LGTM!The conditional serialization support is properly implemented with appropriate feature flags.
Also applies to: 7-7
packages/rs-sdk/tests/fetch/tokens/token_total_supply.rs (2)
1-7
: LGTM! All necessary imports are present.The imports cover all required dependencies for testing token total supply functionality.
16-26
: Verify the hardcoded test values.The test asserts specific values (100200) for both
token_supply
andaggregated_token_account_balances
. Ensure these values match the expected test data setup.Run this script to verify the test data setup:
✅ Verification successful
Test values confirmed as correct.
The grep results show that the aggregated test data for token supply is consistently set to 100200. Although the identity token balances test for TOKEN_ID_0 expects 100100, note that the total supply calculation (based on aggregation) for TOKEN_ID_0 returns 100200—which aligns with the test data setup (matching the value for TOKEN_ID_1 in identity token balances). The hardcoded values in the token_total_supply test (both fortoken_supply
andaggregated_token_account_balances
) correctly reflect the intended test data.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify test data setup for token supply values # Search for token supply constant definitions or test data setup rg -A 5 "TOKEN_ID_0|100200" packages/rs-sdk/tests/Length of output: 5312
packages/rs-sdk/tests/fetch/mod.rs (1)
21-22
: LGTM! New modules are properly organized.The new modules
generated_data
,group_actions
, andtokens
are correctly placed under themocks
feature flag, maintaining consistency with the existing structure.Also applies to: 30-30
packages/rs-sdk/src/platform/tokens/token_total_supply.rs (1)
22-24
: LGTM! Fetch trait implementation is correct.The implementation correctly associates TotalSingleTokenBalance with GetTokenTotalSupplyRequest.
packages/rs-sdk/src/platform/tokens/token_status.rs (1)
26-28
: LGTM! FetchMany trait implementation is correct.The implementation correctly associates TokenStatus with GetTokenStatusesRequest.
packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs (1)
23-27
: LGTM! Good network restriction check.The function correctly restricts test data generation to local networks only, with appropriate error handling.
packages/rs-sdk/tests/fetch/tokens/token_status.rs (1)
24-29
: LGTM! Comprehensive test assertions.The test effectively verifies all token status scenarios including existing, non-existing, and paused tokens.
packages/rs-dpp/src/tokens/info/mod.rs (1)
9-10
: LGTM! Well-structured conditional serialization.The addition of serialization traits under the "fixtures-and-mocks" feature flag is appropriate and well-implemented.
Also applies to: 27-27
packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs (2)
10-10
: LGTM! New test module added.The addition of the test module aligns with the PR objectives for implementing token and group queries.
46-51
: Improved error handling with future test data generation support.Good improvements:
- Using the
?
operator for better error propagation- The commented code indicates planned support for SDK test data generation, which aligns with the PR objectives.
Please ensure the
create_sdk_test_data
function in the test module is properly implemented and tested before uncommenting line 49.packages/rs-dpp/src/balances/total_single_token_balance/mod.rs (1)
3-6
: LGTM! Clean implementation of conditional serialization.The addition of
Encode
andDecode
traits with feature flag is well-structured and follows Rust best practices.Also applies to: 11-11
packages/rs-sdk/src/platform/tokens/token_info.rs (3)
12-39
: LGTM! Well-structured implementation of IdentityTokenInfosQuery.The implementation is clean, type-safe, and follows SDK patterns for query handling.
41-68
: LGTM! Well-structured implementation of IdentitiesTokenInfosQuery.The implementation properly handles multiple identity IDs for a single token.
70-70
: Address the TODO comment for Fetch trait implementation.The Fetch trait implementation is missing and should be completed for full functionality.
Would you like me to help implement the Fetch trait or create an issue to track this task?
packages/rs-sdk/tests/fetch/generated_data.rs (3)
7-9
: Consider moving DPNS_DASH_TLD_DOCUMENT_ID to data-contracts crate.The TODO comment suggests a valid improvement in code organization.
Would you like me to help create an issue to track moving this constant to the data-contracts crate?
14-33
: LGTM! Well-documented constants with clear references.The constants are well-organized and properly documented with references to their initialization code.
34-45
: LGTM! Efficient use of LazyLock for token IDs.Good use of
LazyLock
for computing token IDs lazily, which improves performance by calculating values only when needed.packages/rs-sdk/tests/fetch/tokens/token_info.rs (3)
13-38
: LGTM! Well-structured test with good coverage.The test effectively validates token info fetching for both frozen and non-existent tokens, with clear assertions and pattern matching.
40-68
: LGTM! Good test coverage for unknown token scenarios.The test effectively validates that unknown token IDs return
None
for all identities, with clear assertions.
70-100
: LGTM! Comprehensive test for token info across multiple identities.The test effectively validates token info fetching using a calculated token ID, with good coverage of both frozen and non-existent cases.
packages/rs-sdk/tests/fetch/tokens/identity_token_balances.rs (3)
15-38
: LGTM! Well-structured test with precise balance assertions.The test effectively validates token balances for both existing and unknown tokens, with clear numeric assertions.
40-73
: LGTM! Good test coverage for unknown token scenarios.The test effectively validates that unknown token IDs return
None
for all identities, with clear assertions.
75-110
: LGTM! Comprehensive test for token balances across multiple identities.The test effectively validates various balance states using a calculated token ID, with good coverage of different scenarios (large balance, small balance, and no balance).
packages/rs-sdk/tests/fetch/group_actions.rs (5)
18-34
: LGTM! Good negative test case.The test effectively validates the behavior when attempting to fetch a non-existing group.
36-58
: LGTM! Well-structured test with good pattern matching.The test effectively validates the structure and content of an existing group.
89-124
: LGTM! Comprehensive test for fetching multiple groups.The test effectively validates fetching multiple groups with inclusive start position, with good pattern matching for each group's structure.
158-188
: LGTM! Well-structured test for paginated group action fetching.The test effectively validates fetching a single group action with pagination parameters.
190-211
: LGTM! Clear test for group action signers.The test effectively validates fetching and verifying group action signers.
packages/rs-sdk/tests/fetch/config.rs (1)
185-185
: LGTM! Good improvement to builder flexibility.Making the builder mutable allows for better configuration flexibility during SDK setup.
packages/rs-platform-value/src/types/identifier.rs (1)
147-147
: Great optimization using const fn!Converting
new
to a const function allows for compile-time evaluation of identifiers, which can improve performance in scenarios where identifiers are created as constants.packages/dapi-grpc/build.rs (1)
50-91
: LGTM! New request and response types added for token and group queries.The changes properly extend the versioned messages support with new token and group-related types. The duplicate checking ensures message uniqueness is maintained.
Also applies to: 98-138
packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs (1)
110-110
: LGTM! Updated error message format in test.Test updated to match the new transport error message format, maintaining test accuracy.
packages/rs-sdk/src/mock/requests.rs (1)
229-230
: LGTM! Improved code clarity by removing unnecessary parentheses.The change improves readability without affecting functionality.
Also applies to: 245-246
packages/rs-sdk/src/mock/sdk.rs (1)
201-230
: LGTM! The implementation of new token and group request types is well-structured.The changes properly integrate token and group-related request types into the mock SDK, following the established patterns and maintaining consistent error handling.
packages/rs-dapi-client/src/transport/grpc.rs (1)
518-606
: LGTM! The gRPC transport implementations for token and group requests are well-implemented.The changes properly implement the
TransportRequest
trait for all new request types, following the established patterns and using appropriate default settings.packages/rs-drive-proof-verifier/Cargo.toml (1)
33-33
: LGTM! The addition of the state-transition-signing feature enhances security.The new feature is properly integrated into the dpp dependency features list.
packages/rs-sdk/Cargo.toml (1)
72-72
: LGTM! The addition of fixtures-and-mocks feature enhances testing capabilities.The new feature is properly integrated into the mocks feature list.
packages/rs-sdk/README.md (1)
16-16
: Correct Dependency DeclarationThe dependency declaration for
dash-sdk
now correctly points to the GitHub repository (https://github.com/dashpay/platform
). Please verify that this URL and its branch or version alignment meet the project's expectations.packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Mock Data File ReviewThis file contains a single hash value that does not adhere to standard JSON formatting (e.g. lacking double quotes). According to our established testing framework and prior learnings, such deviations are intentional for these mock data files.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Mock Data File ReviewThe appended hash string serves as a test vector. Although it does not conform to standard JSON syntax (e.g. missing double quotes), this is acceptable for the project's mock data format.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Mock Data File ReviewThe single-line hash value in this file is intended as mock data. Despite not using standard JSON double quoting, this format is in line with the project's testing guidelines.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Mock Data File ReviewThis test vector file contains a hash string that deviates from strict JSON formatting (e.g. missing double quotes). Such formatting is intentional and acceptable for mock data as per the project's standards.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Intentionally Non-Standard JSON Format for Mock DataThe file introduces a hash value intended for use in test vectors. Although static analysis suggests that string values should be double quoted, this non-standard formatting is intentional and accepted within the project's testing framework.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Valid Mock Data Entry with Intentional FormatThis file adds a new hash value used as mock data for scenarios where contested resource vote states are not found. Despite the static analysis note regarding double quoting, the retrieved learnings confirm that the current format is by design.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Consistent Mock Data Format for Document List Drive QueryThe file contains a single hash value intended for testing document list drive queries. The format, while not standard JSON due to the lack of double quotes, is acceptable per the project’s established pattern for mock data files.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Appropriate Test Vector for Document Read (No Document) ScenarioThis file adds a hash value for a document-read test case where no document is found. Although static analysis flags the missing double quotes, this non-standard representation is intentional and conforms with the project's testing framework for mock files.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json (1)
1-1
: Valid and Consistent Mock Data for Document ReadThe file introduces a hash value for the document read test vector. The format chosen here—omitting double quotes—is intentional for test robustness and aligns with our project's practices for mock JSON files.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
...list/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
Outdated
Show resolved
Hide resolved
...rent/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
Outdated
Show resolved
Hide resolved
...-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs
Outdated
Show resolved
Hide resolved
impl Query<GetTokenStatusesRequest> for Vec<Identifier> { | ||
fn query(self, prove: bool) -> Result<GetTokenStatusesRequest, Error> { | ||
let request = GetTokenStatusesRequest { | ||
version: Some(get_token_statuses_request::Version::V0( | ||
GetTokenStatusesRequestV0 { | ||
token_ids: self | ||
.into_iter() | ||
.map(|identifier| identifier.to_vec()) | ||
.collect(), | ||
prove, | ||
}, | ||
)), | ||
}; | ||
|
||
Ok(request) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider adding validation for token IDs collection.
The Query implementation should validate the input vector:
- Check for empty vector
- Check for duplicate token IDs
- Consider adding a reasonable limit on the number of token IDs
impl Query<GetTokenStatusesRequest> for Vec<Identifier> {
fn query(self, prove: bool) -> Result<GetTokenStatusesRequest, Error> {
+ if self.is_empty() {
+ return Err(Error::InvalidInput("Token IDs vector cannot be empty".into()));
+ }
+ if self.len() > 100 { // Adjust limit as needed
+ return Err(Error::InvalidInput("Too many token IDs requested".into()));
+ }
+ let unique_ids: std::collections::HashSet<_> = self.iter().collect();
+ if unique_ids.len() != self.len() {
+ return Err(Error::InvalidInput("Duplicate token IDs are not allowed".into()));
+ }
let request = GetTokenStatusesRequest {
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
impl Query<GetTokenStatusesRequest> for Vec<Identifier> { | |
fn query(self, prove: bool) -> Result<GetTokenStatusesRequest, Error> { | |
let request = GetTokenStatusesRequest { | |
version: Some(get_token_statuses_request::Version::V0( | |
GetTokenStatusesRequestV0 { | |
token_ids: self | |
.into_iter() | |
.map(|identifier| identifier.to_vec()) | |
.collect(), | |
prove, | |
}, | |
)), | |
}; | |
Ok(request) | |
} | |
} | |
impl Query<GetTokenStatusesRequest> for Vec<Identifier> { | |
fn query(self, prove: bool) -> Result<GetTokenStatusesRequest, Error> { | |
if self.is_empty() { | |
return Err(Error::InvalidInput("Token IDs vector cannot be empty".into())); | |
} | |
if self.len() > 100 { // Adjust limit as needed | |
return Err(Error::InvalidInput("Too many token IDs requested".into())); | |
} | |
let unique_ids: std::collections::HashSet<_> = self.iter().collect(); | |
if unique_ids.len() != self.len() { | |
return Err(Error::InvalidInput("Duplicate token IDs are not allowed".into())); | |
} | |
let request = GetTokenStatusesRequest { | |
version: Some(get_token_statuses_request::Version::V0( | |
GetTokenStatusesRequestV0 { | |
token_ids: self | |
.into_iter() | |
.map(|identifier| identifier.to_vec()) | |
.collect(), | |
prove, | |
}, | |
)), | |
}; | |
Ok(request) | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it in a separate task for all queries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shumkov Understood. Would you like me to create an issue to track the implementation of input validation across all queries?
✏️ Learnings added
Learnt from: shumkov
PR: dashpay/platform#2449
File: packages/rs-sdk/src/platform/tokens/token_status.rs:8-24
Timestamp: 2025-02-14T04:33:23.489Z
Learning: Input validation for query implementations (empty checks, duplicates, size limits) should be implemented consistently across all query types rather than individually.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@shumkov I've created an issue to track the implementation of consistent input validation across all query implementations. The issue outlines the key validation requirements we discussed and links back to this PR discussion for context.
🏁 Script executed:
#!/bin/bash
gh issue create \
--title "Implement consistent input validation across all query implementations" \
--body "Add input validation consistently across all query implementations to ensure data integrity and prevent potential issues.
**Validation requirements:**
- Check for empty collections
- Check for duplicate entries
- Enforce reasonable size limits
This came up during review of query implementations in PR #2449 (https://github.com/dashpay/platform/pull/2449#discussion_r1938794039).
The validation should be implemented in a consistent way across all query types rather than adding it individually to maintain code consistency and ensure all queries have the same level of input validation."
Length of output: 747
@shumkov The issue has been created successfully at #2461.
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
...ract/quorum_pubkey-106-1e36eadee30940f5c42271ceb15ed97c58eb057410158b392ceec4d4631eff63.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🔭 Outside diff range comments (1)
packages/rs-sdk/src/platform/transition/transfer.rs (1)
16-26
: 🛠️ Refactor suggestionUpdate documentation to reflect new return type.
The function documentation needs to be updated to reflect that the method now returns a tuple containing both the sender's and receiver's final balances, not just a single balance.
Apply this diff to update the documentation:
/// Function to transfer credits from an identity to another identity. Returns the final - /// identity balance. + /// balances of both the sender and receiver identities. /// /// If signing_transfer_key_to_use is not set, we will try to use one in the signer that is /// available for the transfer. /// /// This method will resolve once the state transition is executed. /// /// ## Returns /// - /// Final balance of the identity after the transfer. + /// A tuple containing (sender_balance, receiver_balance) after the transfer.
♻️ Duplicate comments (3)
packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:⚠️ Potential issueFormat the JSON file properly.
The file content should follow proper JSON format with quoted strings.
Apply the same JSON formatting fix as suggested for the previous file.
Additionally, let's verify the hash format:
#!/bin/bash # Description: Verify the hash value format and consistency across test vector files # Check if the hash length is consistent (96 bytes / 192 hex chars) echo "Checking hash length..." echo "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" | wc -c # Find all test vector files with this hash echo "Checking hash usage across test vectors..." rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors/"🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:⚠️ Potential issueFix JSON formatting.
The file has the same formatting issues as the previous file.
Apply the same fix to properly format the JSON string:
-a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38 +"a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38"🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_group_action_signers/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:⚠️ Potential issueFix JSON formatting.
The file has the same formatting issues as the previous files.
Apply the same fix to properly format the JSON string:
-a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38 +"a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38"Since this hash is used across multiple test vectors, let's verify its usage in the test framework:
#!/bin/bash # Description: Verify how this hash is used in the test framework # Find test files that reference this hash fd -e rs . packages/rs-sdk/tests -x grep -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" {} \; # Look for test helper functions or fixtures that might be using this hash ast-grep --pattern 'fn $test_name($params) { $$$ $hash = "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" $$$ }'🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
🧹 Nitpick comments (14)
packages/js-grpc-common/lib/server/error/VerboseInternalGrpcError.js (1)
16-27
: Consider enhancing the stack trace parsing robustness.While the changes improve error handling by checking for stack existence and providing fallbacks, consider these enhancements:
if (originalError.stack) { - let [, errorPath] = originalError.stack.toString() - .split(/\r\n|\n/); + // Use a more specific pattern to extract the first line after the error message + let [, errorPath] = originalError.stack.toString() + .split(/\r\n|\n/) + .filter(line => line.trim().startsWith('at ')); if (!errorPath) { errorPath = originalError.stack; } message = `${message} ${errorPath.trim()}`; - rawMetadata['stack-bin'] = cbor.encode(originalError.stack); + try { + rawMetadata['stack-bin'] = cbor.encode(originalError.stack); + } catch (e) { + // Log encoding error but don't throw to maintain the original error + console.warn('Failed to encode stack trace:', e); + } }packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mint.rs (1)
19-19
: LGTM! Consider consistent syntax for attribute.The change to use
js_class
in thewasm_bindgen
attribute is correct, but the syntax differs slightly from other files.For consistency with other token transition files, consider adding spaces around
=
:-#[wasm_bindgen(js_class=TokenMintTransition)] +#[wasm_bindgen(js_class = TokenMintTransition)]packages/rs-sdk/src/platform/transition/fungible_tokens/freeze.rs (2)
47-47
: Address the token position validation TODO.The TODO comment indicates missing validation for the token position parameter.
Would you like me to help implement the token position validation or create an issue to track this task?
101-101
: Address the group actions simplification TODO.The TODO comment suggests an opportunity to improve group action handling by automating position finding.
Would you like me to help implement the group action position automation or create an issue to track this task?
packages/rs-sdk/src/platform/transition/fungible_tokens/mint.rs (1)
76-76
: Address the destination validation TODO.The TODO comment indicates missing validation for the
minting_allow_choosing_destination
feature, which could have security implications.Would you like me to help implement the destination validation or create an issue to track this security-related task?
packages/rs-sdk/src/platform/transition/fungible_tokens/transfer.rs (1)
54-54
: Implement token position validation.The TODO comment indicates missing validation for token positions, which could lead to runtime errors if invalid positions are provided.
Would you like me to help implement the token position validation or create an issue to track this task?
packages/rs-sdk/src/platform/transition/fungible_tokens/emergency_action.rs (1)
46-46
: Address TODO comments for validation and group actions.There are two TODO comments that need attention:
- Token position validation is missing, which could lead to runtime errors.
- Group actions could be simplified by automatically finding the position.
Would you like me to help implement these improvements or create issues to track these tasks?
Also applies to: 130-130
packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs (4)
85-101
: Consider making the action ID configurable.The group action ID is hardcoded with
[32; 32]
. Consider making this configurable or deriving it deterministically based on other parameters for better test maintainability.- let action_id = Identifier::new([32; 32]); + // Derive from block info or make it a constant + let action_id = Identifier::new([ + block_info.height.to_le_bytes()[0]; 32 + ]);
124-128
: Consider conditional logging of private keys.While logging private keys is useful for debugging tests, consider wrapping it in a debug assertion or feature flag to prevent accidental logging in production.
- tracing::info!( + debug_assert!({ + tracing::info!( key = ?key, private_key, "Generated random {} key {} for test identity {}", key.purpose(), key.id(), id); + true + });
182-226
: Consider diversifying token configurations for better test coverage.The current implementation uses identical token configurations for all tokens with many default values. Consider varying the configurations (e.g., different decimals, supply limits, rules) to ensure broader test coverage.
let tokens = [ - (0, token_configuration.clone()), - (1, token_configuration.clone()), - (2, token_configuration), + (0, TokenConfiguration::V0(TokenConfigurationV0 { + conventions: TokenConfigurationConventionV0 { + decimals: 8, + ..Default::default() + }.into(), + base_supply: 100000, + ..token_configuration.into_v0() + })), + (1, TokenConfiguration::V0(TokenConfigurationV0 { + conventions: TokenConfigurationConventionV0 { + decimals: 6, + ..Default::default() + }.into(), + base_supply: 200000, + max_supply: Some(1000000), + ..token_configuration.into_v0() + })), + (2, TokenConfiguration::V0(TokenConfigurationV0 { + conventions: TokenConfigurationConventionV0 { + decimals: 4, + ..Default::default() + }.into(), + base_supply: 300000, + start_as_paused: true, + ..token_configuration.into_v0() + })), ]
292-304
: Simplify single-element loop.The single-element loop with
#[allow(clippy::single_element_loop)]
can be simplified to a direct call.- #[allow(clippy::single_element_loop)] - for (token_id, mint_amount) in [(*TOKEN_ID_1, 100)] { - self.drive.token_mint( - token_id.to_buffer(), - IDENTITY_ID_3.to_buffer(), - mint_amount, - false, - block_info, - true, - transaction, - platform_version, - )?; - } + self.drive.token_mint( + TOKEN_ID_1.to_buffer(), + IDENTITY_ID_3.to_buffer(), + 100, + false, + block_info, + true, + transaction, + platform_version, + )?;packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js (2)
58-73
: Handle missing or invalid Data Contract
Currently, ifdataContractResponse
is empty or invalid, the code may fail deeper in the flow. Consider adding defensive checks and meaningful error messages for missing/invalid data contracts.const dataContractResponse = await driveClient.getDataContract(dataContractRequest); +if (!dataContractResponse || !dataContractResponse.getV0().hasDataContract()) { + throw new Error(`Data contract not found or invalid for ID: ${dataContractIdString}`); +}
268-269
: Remove or gate debug logging
The TODO indicates that this debug statement should be removed or guarded behind a debug flag to avoid leaking internal data in production logs.-// TODO: Remove logging -console.dir(request.toObject(), { depth: null }); +// Consider toggling via environment variable or remove entirely +if (process.env.DEBUG_LOGS === 'true') { + console.dir(request.toObject(), { depth: null }); +}packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs (1)
327-348
: Verify token history document existence.The code properly verifies token history documents when history keeping is enabled. However, consider adding logging to help with debugging when document verification fails.
if token_config.keeps_history() { + log::debug!("Verifying token history document for token {}", token_id); let query = SingleDocumentDriveQuery { contract_id: token_history_contract.id().into_buffer(), document_type_name: token_history_document_type_name, document_type_keeps_history: false, document_id: token_transition .historical_document_id(owner_id, identity_contract_nonce) .to_buffer(), block_time_ms: None, //None because we want latest contested_status: SingleDocumentDriveQueryContestedStatus::NotContested, };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (80)
.pnp.cjs
(1 hunks)Dockerfile
(1 hunks)packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js
(4 hunks)packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js
(1 hunks)packages/dapi/package.json
(1 hunks)packages/dapi/scripts/api.js
(1 hunks)packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js
(3 hunks)packages/js-grpc-common/lib/server/error/VerboseInternalGrpcError.js
(1 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs
(2 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs
(1 hunks)packages/rs-drive/src/drive/tokens/balance/queries.rs
(1 hunks)packages/rs-drive/src/drive/tokens/info/queries.rs
(1 hunks)packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v0/mod.rs
(1 hunks)packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs
(4 hunks)packages/rs-drive/tests/supporting_files/contract/tokens/token-example-contract.json
(1 hunks)packages/rs-sdk/src/platform/transition.rs
(0 hunks)packages/rs-sdk/src/platform/transition/builder.rs
(0 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/burn.rs
(2 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/destroy.rs
(2 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/emergency_action.rs
(2 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/freeze.rs
(2 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/mint.rs
(2 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/transfer.rs
(2 hunks)packages/rs-sdk/src/platform/transition/fungible_tokens/unfreeze.rs
(2 hunks)packages/rs-sdk/src/platform/transition/transfer.rs
(3 hunks)packages/rs-sdk/tests/fetch/tokens/token_info.rs
(1 hunks)packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_fetch_1_groups_since_0/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_fetch_all_group_actions/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_fetch_all_groups_since_1_inclusive/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_fetch_group_action_signers/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_fetch_one_group_action_since_existing_one_with_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_group_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_group_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identities_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identities_unknown_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_identity_token_info/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_multiple_identities_token_balances/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_multiple_identities_with_unknown_token_balance/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_multiple_identity_token_balances/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_token_status/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/rs-sdk/tests/vectors/test_token_total_supply/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
(1 hunks)packages/token-history-contract/lib/systemIds.js
(1 hunks)packages/token-history-contract/schema/v1/token-history-contract-documents.json
(2 hunks)packages/wasm-dpp/src/data_contract/tokens.rs
(2 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/mod.rs
(1 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/destroy.rs
(1 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/freeze.rs
(1 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mint.rs
(1 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mod.rs
(4 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/transfer.rs
(1 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/unfreeze.rs
(1 hunks)packages/wasm-dpp/test/integration/document/DocumentFacade.spec.js
(2 hunks)
💤 Files with no reviewable changes (2)
- packages/rs-sdk/src/platform/transition.rs
- packages/rs-sdk/src/platform/transition/builder.rs
✅ Files skipped from review due to trivial changes (1)
- packages/token-history-contract/lib/systemIds.js
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/rs-sdk/tests/fetch/tokens/token_info.rs
👮 Files not reviewed due to content moderation or server errors (2)
- packages/rs-sdk/tests/vectors/test_multiple_identity_token_balances/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
- packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
🧰 Additional context used
🧠 Learnings (16)
packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_fetch_1_groups_since_0/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_fetch_all_groups_since_1_inclusive/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_fetch_one_group_action_since_existing_one_with_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_group_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_group_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_identities_unknown_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_multiple_identities_with_unknown_token_balance/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
packages/rs-sdk/tests/vectors/test_token_status/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
Learnt from: lklimek
PR: dashpay/platform#2030
File: packages/rs-sdk/tests/vectors/test_asset_lock_proof/quorum_pubkey-100-4ce7fd81273c2b394c0f32367374fc5b09ba912e017aacb366d2171e9ca6f9d5.json:1-1
Timestamp: 2024-12-10T10:56:26.215Z
Learning: In the `packages/rs-sdk/tests/vectors/test_asset_lock_proof/` directory, files with the `.json` extension are mock data that may not follow standard JSON format; this is intentional and acceptable within the project's testing framework.
🪛 Biome (1.9.4)
packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_1_groups_since_0/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_all_group_actions/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_all_groups_since_1_inclusive/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_group_action_signers/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_one_group_action_since_existing_one_with_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_group_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_group_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identities_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identities_unknown_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_balance_revision_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_public_keys_all_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_token_info/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_multiple_identities_token_balances/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_multiple_identities_with_unknown_token_balance/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_multiple_identity_token_balances/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_protocol_version_vote_count/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_protocol_version_votes_limit_2/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_protocol_version_votes_none/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_protocol_version_votes_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_protocol_version_votes_zeros/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_token_status/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_token_total_supply/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
[error] 1-1: String values must be double quoted.
(parse)
⏰ Context from checks skipped due to timeout of 90000ms (19)
- GitHub Check: Rust packages (rs-dapi-client) / Unused dependencies
- GitHub Check: Rust packages (rs-dapi-client) / Tests
- GitHub Check: Rust packages (rs-dapi-client) / Linting
- GitHub Check: Rust packages (rs-dapi-client) / Formatting
- GitHub Check: Rust packages (rs-dapi-client) / Check each feature
- GitHub Check: Rust packages (drive-abci) / Unused dependencies
- GitHub Check: Rust packages (drive-abci) / Tests
- GitHub Check: Rust packages (drive-abci) / Linting
- GitHub Check: Rust packages (drive-abci) / Check each feature
- GitHub Check: Rust packages (drive) / Tests
- GitHub Check: Rust packages (drive) / Linting
- GitHub Check: Rust packages (dpp) / Unused dependencies
- GitHub Check: Rust packages (dpp) / Tests
- GitHub Check: Rust packages (dash-sdk) / Tests
- GitHub Check: Rust packages (dash-sdk) / Check each feature
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build JS packages / Build JS
🔇 Additional comments (79)
packages/rs-sdk/src/platform/transition/transfer.rs (2)
48-48
: LGTM!The implementation signature correctly matches the trait definition.
63-78
: LGTM! Clean implementation with thorough error handling.The code correctly:
- Destructures the broadcast result into sender and receiver identities
- Handles potential missing balances with clear error messages
- Returns both balances in a tuple
.pnp.cjs (1)
2606-2606
:✅ Verification successful
LGTM! Verify workspace package exists.
The addition of the token history contract dependency is correctly formatted and aligns with the PR objectives for implementing token queries.
Let's verify that the workspace package exists to prevent build failures:
🏁 Script executed:
#!/bin/bash # Description: Verify that the token history contract package exists in the workspace # Check if the package directory exists if [ -d "packages/token-history-contract" ]; then echo "✓ Token history contract package exists" # Check if package.json exists and contains the correct name if [ -f "packages/token-history-contract/package.json" ]; then name=$(cat packages/token-history-contract/package.json | jq -r .name) if [ "$name" = "@dashevo/token-history-contract" ]; then echo "✓ Package name matches in package.json" else echo "✗ Package name mismatch in package.json" exit 1 fi else echo "✗ package.json not found" exit 1 fi else echo "✗ Package directory not found" exit 1 fiLength of output: 460
LGTM! The token history contract dependency has been correctly added and the workspace package exists as expected.
- The new dependency is correctly placed between
@dashevo/grpc-common
and@dashevo/wasm-dpp
in the Yarn Plug'n'Play configuration.- The workspace package directory (
packages/token-history-contract
) and itspackage.json
containing the proper name (@dashevo/token-history-contract
) have been successfully verified, ensuring no build failures.packages/js-grpc-common/lib/server/error/VerboseInternalGrpcError.js (2)
13-14
: LGTM! Clean variable initialization with proper fallbacks.The code follows best practices by using destructuring and providing a fallback for
rawMetadata
.
29-34
: LGTM! Proper error instantiation and message setting.The code follows correct inheritance patterns and properly sets the error message.
packages/dapi/package.json (1)
41-41
:✅ Verification successful
LGTM! The new dependency aligns with the PR objectives.
The addition of
@dashevo/token-history-contract
as a workspace dependency is consistent with the implementation of token queries and follows the project's dependency management patterns.Let's verify that this dependency is actually used in the codebase:
🏁 Script executed:
#!/bin/bash # Search for imports or requires of the token-history-contract package rg -l "@dashevo/token-history-contract"Length of output: 197
LGTM!
The addition of@dashevo/token-history-contract
as a workspace dependency is correctly aligned with the PR objectives. Our verification confirms that the package is indeed in use—specifically, it's imported inpackages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js
—and is integrated consistently with the project's dependency management practices.packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v0/mod.rs (1)
41-41
: LGTM! API simplification looks good.The removal of the
with_absence_proof
suffix from theGroveDb
method calls simplifies the API while maintaining the same functionality. The changes are consistent across both the subset and regular query verification paths.Also applies to: 43-43
packages/rs-drive/tests/supporting_files/contract/tokens/token-example-contract.json (4)
2-2
: Format version upgrade and schema changes look good.The format version upgrade to "1" and the addition of empty document schemas indicate a more structured approach to token definitions.
Also applies to: 6-6
8-20
: Token conventions structure provides better localization support.The new hierarchical structure with conventions and localizations improves internationalization support. The decimals field is properly defined for token precision.
21-24
: Verify supply limits configuration.The introduction of
baseSupply
andmaxSupply
fields with a 5x ratio between them seems reasonable, but please verify these values align with the business requirements.Could you confirm if:
- The base supply of 1,000,000 is sufficient for initial distribution?
- The max supply of 5,000,000 provides enough room for future growth?
- The 5x ratio between base and max supply aligns with the tokenomics plan?
25-60
: Review security implications of rule configurations.All rule sets (freeze, unfreeze, destroyFrozenFunds, emergency) follow a consistent pattern with
ContractOwner
as both the authorized party and admin action taker. However, this centralized control model needs careful consideration:
- The
self_changing_admin_action_takers_allowed
is set tofalse
across all rules, which is good for security.- Both
changing_authorized_action_takers_to_no_one_allowed
andchanging_admin_action_takers_to_no_one_allowed
are set tofalse
, which means these permissions can be revoked.Please confirm if:
- The centralized control model with
ContractOwner
aligns with the governance requirements?- Should we consider a more distributed governance model for some of these actions?
- Is it intentional that permissions can be permanently revoked (due to
changing_*_to_no_one_allowed: false
)?packages/rs-sdk/tests/vectors/test_data_contracts_2_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:⚠️ Potential issue✅ Verification successful
Format the hash value as a valid JSON string.
The file has a .json extension but the content is not properly formatted as JSON. The hash value should be wrapped in double quotes.
Apply this diff to fix the JSON formatting:
-a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38 +{ + "hash": "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" +}Also, please verify that this hash value is correct for the test vector. Let's check if this hash is referenced in the test code:
🏁 Script executed:
#!/bin/bash # Description: Search for references to this hash in the test code rg -A 5 "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38"Length of output: 10778
Ensure Valid JSON Format for Test Vector Hash
The file currently includes a raw hash value rather than valid JSON. Since the file has a JSON extension and similar test vectors use the same hash, please update the file to wrap the hash in proper JSON formatting. For example:
-a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38 +{ + "hash": "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" +}This change will ensure that the file is valid JSON. Additionally, note that the same hash value is referenced in multiple test vector files, indicating consistency; however, please verify that the hash value remains correct for the intended test scenarios.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs (2)
10-10
: LGTM: Test module additionThe addition of the test module aligns with the PR's objective to support SDK test data generation.
46-46
: LGTM: Improved error handlingThe use of the
?
operator for error propagation is more idiomatic Rust and improves code readability while maintaining the same functionality.packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/freeze.rs (1)
16-16
:❓ Verification inconclusive
LGTM! Verify JavaScript interoperability.
The change to use
js_class
in thewasm_bindgen
attribute aligns with the struct'sjs_name
and maintains a clear connection between Rust and JavaScript.Please verify that the JavaScript class name is correctly exposed by running:
🏁 Script executed:
#!/bin/bash # Description: Check if the JavaScript class is correctly exposed # Expected: Should find references to TokenFreezeTransition in the generated JavaScript code # Find the generated JavaScript file fd -t f -e js TokenFreezeTransition # Check the content of found files fd -t f -e js TokenFreezeTransition -x cat {}Length of output: 87
LGTM! Please manually verify the generated JavaScript output.
The change to use
#[wasm_bindgen(js_class = TokenFreezeTransition)]
is consistent with the Rust-to-JavaScript binding pattern. However, since the automated check didn't produce any output, please manually inspect the generated JavaScript files to ensure that theTokenFreezeTransition
class is correctly exposed.packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/transfer.rs (1)
16-16
: LGTM! Consistent with other token transitions.The change to use
js_class
in thewasm_bindgen
attribute maintains consistency with other token transition implementations.packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/unfreeze.rs (1)
16-16
: LGTM! Maintains consistency across token transitions.The change to use
js_class
in thewasm_bindgen
attribute follows the established pattern for token transitions.packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mod.rs (3)
1-8
: LGTM! Consistent module visibility changes.Making token-related modules public aligns with the PR objectives and enables proper access to token functionality.
19-19
: LGTM! Well-organized imports.The new imports properly support the added functionality for historical document handling and identity contract nonce.
Also applies to: 24-26
74-74
: LGTM! Well-implemented token transition enhancements.The new methods properly expose historical document handling and identity contract functionality to JavaScript while maintaining consistent naming conventions and proper type conversions.
Note: The implementation aligns well with the PR objectives to enhance token management capabilities.
Also applies to: 96-115
packages/rs-sdk/src/platform/transition/fungible_tokens/burn.rs (2)
124-124
: LGTM! Improved accessibility of the sign method.The change to make the
sign
method public aligns with the SDK's goal of providing direct access to token transition signing capabilities.
136-143
:❓ Verification inconclusive
Verify the impact of the nonce retrieval change.
The
get_identity_contract_nonce
call now usestrue
for the third argument, which could affect state transition validation.
🏁 Script executed:
#!/bin/bash # Description: Search for other instances of get_identity_contract_nonce to verify consistent usage rg -A 2 'get_identity_contract_nonce\(' --type rustLength of output: 4378
Impact Confirmation Required: Please verify that using
true
as the third argument in theget_identity_contract_nonce
call in the fungible tokens burn transition is intentional and does not cause unintended side effects during state transition validation. In particular, check that:
- The change aligns with similar transitions (e.g., in emergency action, transfer, freeze, and unfreeze) where nonce retrieval is performed.
- The revised parameter value (
true
) is properly covered by tests and does not break consensus or state validation logic.Location to review:
•packages/rs-sdk/src/platform/transition/fungible_tokens/burn.rs
(lines 136–143)packages/rs-sdk/src/platform/transition/fungible_tokens/destroy.rs (1)
132-132
: LGTM! Consistent implementation with other token transition builders.The changes to the
sign
method visibility and nonce retrieval behavior maintain consistency with other token transition implementations.Also applies to: 148-148
packages/rs-sdk/src/platform/transition/fungible_tokens/transfer.rs (1)
159-201
:✅ Verification successful
LGTM! Verify the nonce behavior change.
The changes to make the
sign
method public and update the nonce behavior look good. However, let's verify the impact of passingtrue
toget_identity_contract_nonce
.
🏁 Script executed:
#!/bin/bash # Description: Search for other calls to get_identity_contract_nonce to ensure consistent behavior. # Test: Search for all calls to get_identity_contract_nonce rg -A 5 'get_identity_contract_nonce'Length of output: 20991
Action: Confirm nonce behavior change consistency.
The search results confirm that the
get_identity_contract_nonce
method is consistently called withtrue
for thebump_first
(nonce behavior) parameter across multiple files (e.g., in transfers, document updates, etc.). The modification in thesign
method, making it public and updating the nonce behavior, aligns with the established pattern in the codebase. No further changes are needed.packages/rs-sdk/src/platform/transition/fungible_tokens/emergency_action.rs (1)
161-201
: LGTM! Changes align with token transfer implementation.The changes to make the
sign
method public and update the nonce behavior are consistent with the changes in the token transfer implementation.packages/rs-sdk/src/platform/transition/fungible_tokens/unfreeze.rs (1)
132-132
:❓ Verification inconclusive
Verify the impact of making the
sign
method public.The visibility change of the
sign
method from private to public could be a breaking change. Please confirm if this change is intentional and aligns with the PR objectives which state "no breaking changes".Let's verify if this is a breaking change by checking for external usages:
🏁 Script executed:
#!/bin/bash # Search for any external usage of the sign method rg -A 5 "TokenUnfreezeTransitionBuilder.*sign\(" --type rustLength of output: 62
Action Required: Manually Verify Public Method Exposure and Nonce Retrieval Change
The updated code now makes the
sign
method public and changes the nonce retrieval call to passtrue
instead offalse
. While the initial script did not reveal any external usage ofsign
, this result is inconclusive. Please manually verify the following:
- Public
sign
Method Exposure: Confirm whether makingsign
public is intentional and safe, and that no external components depend on its previous private visibility.- Nonce Retrieval Parameter Change: Ensure that updating the third argument of
get_identity_contract_nonce
totrue
is documented and aligns with the expected behavior for state transition signing.packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs (2)
63-71
: LGTM! The identity ID matches the comment.The code correctly uses
IDENTITY_ID_2
to freeze tokens for identity 2.
49-308
: LGTM! Well-structured test implementation.The implementation provides comprehensive test coverage for token and group queries with a clear and maintainable structure. The orchestration of test setup is logical and the code is well-documented.
packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js (4)
14-15
: EnsuretokensHistoryContractIdString
is valid before decoding
While this approach is reasonable, consider verifying thattokensHistoryContractIdString
contains a valid base58-encoded value. If the string is malformed,bs58.decode
will throw, potentially breaking the flow if not properly caught.Would you like to add a small safety check or fallback behavior here?
Also applies to: 23-24
37-37
: Good usage ofconst
for caching
Switching fromlet
toconst
fordataContractsCache
helps avoid accidental reassignment and clarifies intent.
53-56
: Confirm string conversion ofdataContractId
Calling.toString()
on the Data Contract ID might result in an unexpected string format if it’s not strictly base58 or hex. Ensure this conversion aligns with other areas of the code expecting this format (e.g., keys indataContractsCache
).
77-164
: Comprehensive token transition handling
The switch logic accounts for multiple token transition types including history vs. no-history cases. Ensure that each transition type is adequately tested, especially for edge cases (e.g., missing recipient ID, zero token supply).Would you like to run a quick script to confirm each token transition type is covered by your integration tests?
packages/wasm-dpp/src/data_contract/tokens.rs (2)
1-1
: Import usage looks appropriate
The newTokenConfigurationV0Getters
import appears properly aligned with the code changes below.
21-27
: Exposekeeps_history
method for WASM usage
This new method cleanly bridges Rust’skeeps_history()
to JavaScript. Ensure that your WASM tests cover scenarios where tokens do and do not keep history.Do you need assistance creating or updating test cases for this method?
packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/destroy.rs (1)
16-16
: Confirm references to updatedjs_class
name
Renaming the exported JS class toTokenDestroyFrozenFundsTransition
is a good clarity improvement. Verify that any code referencing the old class name is updated accordingly to avoid runtime issues.packages/rs-drive/src/drive/tokens/info/queries.rs (1)
15-18
: LGTM! Query limit optimization added.The addition of an explicit limit improves query performance and resource utilization by ensuring only one result is returned.
packages/rs-drive/src/drive/tokens/balance/queries.rs (2)
16-19
: LGTM! Query limit optimization added.The addition of an explicit limit improves query performance and resource utilization by ensuring only one result is returned.
110-118
: LGTM! Query limit optimization added for merged queries.The explicit limit of 2 is appropriate for the merged query of token supply and aggregated balances.
packages/wasm-dpp/test/integration/document/DocumentFacade.spec.js (1)
11-11
: LGTM! Class renamed for better clarity.The renaming from
DocumentsBatchTransition
toBatchTransition
maintains functionality while improving naming consistency.Also applies to: 110-110
packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js (2)
31-46
: LGTM! Proper WASM DPP initialization added.The addition of proper WASM DPP initialization with BLS adapter and state repository mocks improves test setup and makes it more realistic.
105-119
: LGTM! Test refactored to use actual document fixtures.The test now uses actual document fixtures and creates a real state transition instead of using mocks, making the test more realistic and maintainable.
packages/dapi/scripts/api.js (1)
134-134
:❓ Verification inconclusive
Verify the impact of protocol version change.
The protocol version has been updated from 1 to 9. This significant version jump could potentially affect compatibility with existing clients and systems.
Run the following script to check for version-dependent code:
🏁 Script executed:
#!/bin/bash # Description: Search for protocol version checks or version-dependent code. # Search for protocol version checks rg -A 5 'protocol.*version|version.*protocol' # Search for version-specific code paths ast-grep --pattern 'if ($version == $_) { $$$ }'Length of output: 107068
Protocol Version Update – Verify Dependent Compatibility
The update to use protocol version 9 in the DashPlatformProtocol initialization appears to be in line with the broader protocol version enhancements across the repository (see corresponding entries in the CHANGELOG and version management files such as those in packages/rs-platform-version). However, given the significant jump from version 1 to 9, please verify that all dependent modules and clients (e.g., the dapi-grpc implementations and any version-sensitive logic) are fully compatible with this change. Running a thorough regression suite and cross-checking version-dependent code paths is strongly recommended.
packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js (1)
98-98
: LGTM!The addition of the
dpp
parameter tofetchProofForStateTransition
aligns with the protocol version update and enhances the functionality.packages/wasm-dpp/src/document/state_transition/batch_transition/mod.rs (1)
37-39
: LGTM! Improved module visibility.Making these modules public enhances code reusability and aligns with the PR's objective of implementing token and group queries support.
packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs (1)
312-322
: LGTM! Enhanced token history verification.The changes improve token history handling by:
- Using system data contracts instead of static identifiers
- Adding proper type name resolution
- Implementing robust contract loading
packages/token-history-contract/schema/v1/token-history-contract-documents.json (1)
155-155
: LGTM! Description accurately reflects the minting operation.The description change from "burned" to "minted" correctly aligns with the semantic meaning of the mint operation.
packages/rs-sdk/tests/vectors/contested_resource_vote_states_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: LGTM! Test vectors consistently updated.The same hash value has been added across multiple test vector files, maintaining consistency in test data. The non-standard JSON format is intentional for test vectors in this project.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:✅ Verification successful
LGTM! Test vectors added for token and identity queries.
The hash value is consistently used across all test vector files, which is appropriate for testing various token and identity-related scenarios. Based on the project's conventions (as per retrieved learnings), the non-standard JSON format is intentional and acceptable for mock data in the test vectors directory.
Let's verify the consistency of the hash value across all test vector files:
🏁 Script executed:
#!/bin/bash # Description: Verify that the hash value is consistent across all test vector files # Search for files containing the hash value and count occurrences echo "Files containing the hash value:" rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors/" echo -e "\nVerifying hash value consistency:" rg "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors/"Length of output: 17347
Hash value consistency verified – LGTM!
The verification confirms that the hash value
a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38
is consistently used across all the test vector files in the
packages/rs-sdk/tests/vectors/
directory. This consistency, along with the intentional non-standard JSON format for mock data based on project conventions, supports the current implementation for both token and identity queries. No additional changes are necessary.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_multiple_identities_token_balances/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:❓ Verification inconclusive
Verify hash consistency across test vectors.
The same hash value is used consistently across multiple test vector files, which is good for maintaining test data integrity. However, let's verify that this hash value is valid and properly generated.
🏁 Script executed:
#!/bin/bash # Description: Verify the consistency of the hash value across test vectors # Search for the hash value in all test vector files echo "Checking hash consistency across test vectors..." rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors" # Check if there are any test vectors with different hash values echo "Checking for test vectors with different hash values..." find packages/rs-sdk/tests/vectors -name "quorum_pubkey-106-*.json" -type f -exec sh -c ' for file do if ! grep -q "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "$file"; then echo "Different hash found in: $file" cat "$file" fi done ' sh {} +Length of output: 15171
Hash consistency discrepancy detected across test vectors
The hash
a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38
is used consistently in many test vector files (including the one in this PR).However, several test vector files (notably under directories like
vote_polls_by_ts_*
,contested_*
, etc.) are using a different hash:
90e4366ffd8062dfcd46717d137c9c6c8c312c2622f508c6f3e713f256b7786c3ed8382b2f5fa9710fe592b668a4313a
.Please verify whether these two hash values are generated intentionally for distinct scenarios or if the discrepancy represents an issue in the hash generation process. This verification is critical to ensure the reliability and integrity of the test vectors.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_multiple_identities_with_unknown_token_balance/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Identical content to previously reviewed file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identities_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Identical content to previously reviewed file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identities_unknown_token_infos/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Identical content to previously reviewed file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_read_by_key/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Identical content to previously reviewed file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_token_status/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:✅ Verification successful
LGTM! Test vectors added for token and group queries.
The hash value appears to be a valid SHA-384 hash and is consistently used across multiple test scenarios, which is good for maintaining test coverage across different edge cases.
Let's verify the hash format and its usage in the codebase:
🏁 Script executed:
#!/bin/bash # Description: Verify the hash format and its usage in test vectors # Test 1: Verify the hash length matches SHA-384 (96 hex characters) echo "Verifying hash length..." HASH="a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" if [ ${#HASH} -eq 96 ]; then echo "Hash length is correct for SHA-384" else echo "Hash length mismatch" fi # Test 2: Check for other occurrences of this hash in the codebase echo "Checking hash usage..." rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" # Test 3: Find all test vector files with similar naming pattern echo "Finding related test vectors..." fd "quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json"Length of output: 13337
LGTM: SHA-384 hash verified as valid and consistently used in test vectors.
- The hash
"a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38"
is confirmed to be 96 hex characters long, matching the expected SHA-384 format.- A search across the codebase shows that this hash is consistently utilized in multiple test vector files, ensuring comprehensive coverage for token and group queries.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:❓ Verification inconclusive
LGTM! Test vectors added for token and group queries.
The hash value
a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38
has been consistently added across multiple test vector files to support the implementation of token and group queries in the RS SDK. The test vectors cover various scenarios including epoch fetching, group actions, and related functionalities.Let's verify the consistency of the hash value across all test vector files:
🏁 Script executed:
#!/bin/bash # Description: Verify that the hash value is consistent across all test vector files # Search for the hash value in all JSON files under packages/rs-sdk/tests/vectors rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors/**/*.json"Length of output: 226
Action Required: Manual Verification of Test Vector File Paths
The hash value
a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38
appears to support token and group queries consistently. However, our automated search did not locate any matching files under the expected directory (packages/rs-sdk/tests/vectors
). This indicates that either the file path or directory structure has changed, or there might be an issue with the file naming pattern.Please verify manually that:
- The test vector files (including the one referenced in the snippet) exist in the intended directory.
- The specified hash is consistently applied across all relevant test vector files.
No modifications are required if, upon manual review, the file locations and hash implementations are correct.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_one_group_action_since_existing_one_with_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: LGTM! Test vector follows established pattern.The test vector hash is correctly formatted and follows the project's testing framework conventions. The same hash value is consistently used across different test scenarios, which is appropriate for testing various group query functionalities with the same quorum pubkey.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_all_groups_since_1_inclusive/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Consistent with other test vectors.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_group_fetch/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Consistent with other test vectors.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_list_limit/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Consistent with other test vectors.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_1_groups_since_0/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Consistent with other test vectors.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_group_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:✅ Verification successful
LGTM! Test vectors are consistent across all files.
The hash value is consistently used across all test vector files, which is appropriate for testing different scenarios with the same quorum public key. The format aligns with the project's testing framework conventions.
Let's verify the consistency of the test vectors across all files:
🏁 Script executed:
#!/bin/bash # Description: Verify that all test vector files contain the same hash value # and follow the same naming pattern # Find all test vector files with the same quorum public key fd 'quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json' packages/rs-sdk/tests/vectors/ --exec md5sum {} \;Length of output: 7983
Validation Complete: All Test Vectors Confirmed Consistent Across Files
The MD5 checksum verification confirms that all test vector files—including the one in
packages/rs-sdk/tests/vectors/test_group_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
—contain the identical quorum public key hash. This consistency aligns with the project's testing framework conventions and is ideal for exercising various test scenarios using the same key.LGTM!
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:✅ Verification successful
LGTM! Hash value is consistent across test vectors.
The hash value
a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38
is consistently used across multiple test scenarios:
- Protocol version votes (none, zeros, limit)
- Group action signers
- Prefunded specialized balance
The format appears to be a valid SHA-384 hash (96 characters in hexadecimal), which is appropriate for cryptographic verification in test vectors.
Let's verify the hash format and its consistency across all test vector files:
🏁 Script executed:
#!/bin/bash # Description: Verify hash format and consistency across test vector files # Test 1: Verify that all files contain the same hash echo "Verifying hash consistency across files..." rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors" # Test 2: Verify hash length (should be 96 characters for SHA-384) echo "Verifying hash length..." rg -o "^[a-f0-9]{96}$" "packages/rs-sdk/tests/vectors"Length of output: 24725
Hash Consistency Verified
The SHA‑384 hash in the reviewed file has been confirmed as valid (96 hexadecimal characters) and is used consistently with related test scenarios (e.g. protocol version votes, group action signers, prefunded specialized balance). Our shell checks verified that files like
•packages/rs-sdk/tests/vectors/test_prefunded_specialized_balance_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
• and others for protocol version votes ("none", "zeros", "nx")
contain the same hash value (a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38
).LGTM!
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
Dockerfile (1)
372-372
:✅ Verification successful
LGTM! The token-history-contract package is properly integrated.
The package is consistently added across all necessary build stages (build-planner, build-drive-abci, build-js, dashmate-helper, and dapi), maintaining the alphabetical order and ensuring it's available for both Rust and JavaScript builds.
Let's verify that the package is properly referenced in all required stages:
Also applies to: 439-439, 530-530, 651-651, 727-727
🏁 Script executed:
#!/bin/bash # Description: Verify token-history-contract package references # Check for any potential missing references to token-history-contract rg -i "token.?history.?contract" --type dockerfileLength of output: 87
Below is a revised verification step using a modified shell script that avoids using an unrecognized file type:
Please run the above script to confirm that the package is referenced at the expected lines in all Dockerfiles. Once you verify that the token-history-contract package appears in the build-planner (line 372), build-drive-abci (line 439), build-js (line 530), dashmate-helper (line 651), and the final dapi stage (line 727), we can approve this PR.
LGTM! The token-history-contract package appears to be integrated across all the necessary build stages once the verification confirms its presence.
- The package is added consistently in the Dockerfile stages: build-planner, build-drive-abci, build-js, dashmate-helper, and dapi.
- The alphabetical order is maintained.
- Both Rust and JavaScript build stages now include the package.
Please manually verify the script’s output to ensure all expected references are present.
🏁 Script executed:
[run_scripts] #!/bin/bash # Re-run check for token-history-contract package references in Dockerfiles # This script uses a file glob search for "Dockerfile" files and then looks for the desired pattern. fd --type file --name "Dockerfile" | while read -r dockerfile; do echo "Checking $dockerfile" rg -i "token.?history.?contract" "$dockerfile" doneLength of output: 428
Below is an updated verification step that avoids using the unsupported
--name
flag. Please run the script below and manually verify that thetoken-history-contract
package is referenced in all required Dockerfile sections:LGTM! The
token-history-contract
package appears to be consistently added across all build stages (build-planner, build-drive-abci, build-js, dashmate-helper, and dapi) per the PR objectives. Please manually verify that its references appear at the expected lines (372, 439, 530, 651, 727) in the Dockerfile(s).
🏁 Script executed:
[run_scripts] #!/bin/bash # Re-run check for token-history-contract package references in Dockerfiles using find. find . -type f -name "Dockerfile" | while read -r dockerfile; do echo "Checking $dockerfile" rg -i "token.?history.?contract" "$dockerfile" doneLength of output: 791
LGTM! The token-history-contract package is correctly integrated across all the required build stages.
- The main Dockerfile reveals multiple occurrences of
packages/token-history-contract \
and the corresponding COPY commands for the dashmate-helper and dapi stages.- This confirms that the package has been incorporated in the build-planner, build-drive-abci, build-js, dashmate-helper, and dapi stages as expected.
- The additional Dockerfile in the .devcontainer directory does not appear to include this package, which is acceptable if it's not part of the intended changes.
No further modifications are needed. Please verify the output manually against your expected line numbers if necessary.
packages/rs-sdk/tests/vectors/contested_resource_identity_votes_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
:✅ Verification successful
LGTM! Test vectors added consistently across different test scenarios.
The same hash value has been consistently added across multiple test vector files for quorum pubkey 106, which is appropriate for testing various scenarios like identity votes, document queries, and contract reads. Based on the retrieved learnings, the format without double quotes is intentional and acceptable within the project's testing framework.
Let's verify the consistency of the hash value across all test vectors:
🏁 Script executed:
#!/bin/bash # Description: Verify that the hash value is consistent across all test vector files # Search for files containing the hash value rg -l "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors" # Count unique hash values to ensure consistency rg "a381714ef6dafe41764ec6e1144fb9bea13a3741b5c5bd8b7c30ca3bf5e0a308a9c0d65123da84b6e330dbb0908b9f38" "packages/rs-sdk/tests/vectors" -n | sort | uniq -cLength of output: 17637
Verification Passed: Consistent Hash Value in Test Vectors
The hash value is used consistently across all test vector files for quorum pubkey 106, as confirmed by the search results. The one-line format without double quotes is intentional and aligns with the project's testing framework.
- The same hash value appears in all relevant test vector files.
- The file format and test vector structure remain as intended.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_token_info/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Test vectors added for token and group queries.The consistent hash value across multiple test scenarios provides comprehensive coverage for the new token and group query functionality. The test vectors follow the project's established patterns for mock data organization.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Test vector consistent with related scenarios.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_contract/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Test vector consistent with related scenarios.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_read_no_document/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Test vector consistent with related scenarios.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Test vector consistent with related scenarios.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contracts_1_ok_1_nx/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: LGTM! Test vectors added for token and group queries.The hash values added to these test vector files align with the PR's objective of implementing token and group queries in the RS SDK. The consistent hash value across different test scenarios suggests a well-structured approach to mocking responses for various test cases.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_current/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Skip review - identical to previous file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_fetch_future/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Skip review - identical to previous file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_epoch_list/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Skip review - identical to previous file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_fetch_all_group_actions/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Skip review - identical to previous file.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_document_query/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: LGTM! Test vectors added for token and group queries.The addition of these test vectors aligns with the PR's objective of implementing token and group queries in the RS SDK. The consistent use of the same hash value across multiple test scenarios suggests a comprehensive test coverage for the new functionality.
Note: The non-standard JSON format is intentional and acceptable within the project's testing framework, as confirmed by previous feedback.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/document_list_drive_query/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Duplicate test vector.This test vector is identical to the one in
document_list_document_query
.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_balance_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Duplicate test vector.This test vector is identical to the one in
document_list_document_query
.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_data_contract_read_not_found/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Duplicate test vector.This test vector is identical to the one in
document_list_document_query
.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
packages/rs-sdk/tests/vectors/test_identity_contract_no_nonce_read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json (1)
1-1
: Duplicate test vector.This test vector is identical to the one in
document_list_document_query
.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: String values must be double quoted.
(parse)
// UNCOMMENT ONLY TO GENERATE SDK TEST DATA | ||
let block_info = dpp::block::block_info::BlockInfo::default_with_time(genesis_time); | ||
self.create_sdk_test_data(&block_info, transaction, platform_version)?; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use conditional compilation for test data generation
The comment suggests this code should be conditional, but it's currently always enabled. This could lead to unintended test data generation in production environments.
Consider using a feature flag to conditionally compile this code:
- // UNCOMMENT ONLY TO GENERATE SDK TEST DATA
- let block_info = dpp::block::block_info::BlockInfo::default_with_time(genesis_time);
- self.create_sdk_test_data(&block_info, transaction, platform_version)?;
+ #[cfg(feature = "sdk-test-data")]
+ {
+ let block_info = dpp::block::block_info::BlockInfo::default_with_time(genesis_time);
+ self.create_sdk_test_data(&block_info, transaction, platform_version)?;
+ }
This ensures the test data generation code is only included when explicitly enabled via the feature flag.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// UNCOMMENT ONLY TO GENERATE SDK TEST DATA | |
let block_info = dpp::block::block_info::BlockInfo::default_with_time(genesis_time); | |
self.create_sdk_test_data(&block_info, transaction, platform_version)?; | |
#[cfg(feature = "sdk-test-data")] | |
{ | |
let block_info = dpp::block::block_info::BlockInfo::default_with_time(genesis_time); | |
self.create_sdk_test_data(&block_info, transaction, platform_version)?; | |
} |
...pply/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
Show resolved
Hide resolved
...-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs
Show resolved
Hide resolved
...ount/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
Show resolved
Hide resolved
...read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
Show resolved
Hide resolved
...none/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
Show resolved
Hide resolved
...read/quorum_pubkey-106-607198ac0cfb4d448f3c2f9cbcdda4fe19bf612e6a850183ee209b45e884fd85.json
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Dockerfile
(1 hunks)packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js
(1 hunks)packages/wasm-dpp/src/document/state_transition/batch_transition/mod.rs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- Dockerfile
- packages/wasm-dpp/src/document/state_transition/batch_transition/mod.rs
🧰 Additional context used
🪛 Biome (1.9.4)
packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js
[error] 19-19: Shouldn't redeclare 'getBlsAdapterMock'. Consider to delete it or rename it.
'getBlsAdapterMock' is defined here:
(lint/suspicious/noRedeclare)
[error] 20-20: Shouldn't redeclare 'createStateRepositoryMock'. Consider to delete it or rename it.
'createStateRepositoryMock' is defined here:
(lint/suspicious/noRedeclare)
🔇 Additional comments (2)
packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js (2)
33-48
: LGTM! Well-structured test setup.The test setup follows best practices with proper separation of concerns:
- One-time WASM loading in
before
hook- Per-test DPP initialization in
beforeEach
- Clean dependency mocking
107-124
: LGTM! Improved document proof testing.The refactored document proof test case is more robust:
- Uses actual document fixtures instead of stubs
- Creates state transitions through DPP's document API
- Maintains proper assertions
packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
Dockerfile
(4 hunks)packages/dashmate/docker-compose.build.drive_abci.yml
(1 hunks)packages/rs-drive-abci/Cargo.toml
(1 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs
(2 hunks)packages/rs-sdk/README.md
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- Dockerfile
- packages/rs-sdk/README.md
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: Rust packages (dash-sdk) / Unused dependencies
- GitHub Check: Rust packages (dash-sdk) / Tests
- GitHub Check: Rust packages (dash-sdk) / Formatting
- GitHub Check: Rust packages (dash-sdk) / Linting
- GitHub Check: Rust packages (dapi-grpc) / Tests
- GitHub Check: Rust packages (dapi-grpc) / Check each feature
- GitHub Check: Rust packages (dapi-grpc) / Unused dependencies
- GitHub Check: Rust packages (dapi-grpc) / Linting
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build JS packages / Build JS
🔇 Additional comments (5)
packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs (4)
10-11
: LGTM!The new test module is properly guarded by the
sdk-test-data
feature flag.
47-47
: LGTM!The error propagation using the
?
operator improves error handling by automatically returning any error from the match expression.
49-53
: LGTM!The SDK test data generation is now properly guarded by the
sdk-test-data
feature flag as suggested in the past review.
55-55
: LGTM!The explicit
Ok(())
return statement ensures a successful result if no errors occur.packages/rs-drive-abci/Cargo.toml (1)
113-113
: LGTM!The
sdk-test-data
feature is properly declared in the features section.
Issue being fixed or feature implemented
We need to support token and group queries in RS SDK
What was done?
fixtures-and-mocks
flag is enabled.How Has This Been Tested?
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit