Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing the Multisig Program

Pre-Alpha Disclaimer: This is an early pre-alpha release for exploring the SDK and starting development only. There is no real MPC signing — all signatures are generated by a single mock signer, not a distributed network. Do not submit any real transactions for signing or rely on any security guarantees. The dWallet keys, trust model, and signing protocol are not final; do not rely on any key material until mainnet. All interfaces, APIs, and data formats are subject to change without notice. The Solana program and all on-chain data will be wiped periodically and everything will be deleted when we transition to Ika Alpha 1. This software is provided “as is” without warranty of any kind; use is entirely at your own risk and dWallet Labs assumes no liability for any damages arising from its use.

Test Matrix

TestInstructionExpected Result
test_create_multisig_successCreateMultisig2-of-3 with correct fields
test_create_multisig_zero_threshold_failsCreateMultisigRejects threshold=0
test_create_multisig_threshold_exceeds_members_failsCreateMultisigRejects threshold > members
test_create_transaction_successCreateTransactionMessage data stored, tx_index incremented
test_create_transaction_non_member_failsCreateTransactionNon-member cannot propose
test_approve_successApproveapproval_count incremented, still Active
test_approve_double_vote_failsApproveApprovalRecord already exists
test_approve_non_member_failsApproveNon-member cannot approve
test_reject_successRejectrejection_count incremented, still Active
test_reject_threshold_marks_rejectedReject2nd rejection → status=Rejected
test_vote_on_closed_transaction_failsApproveCannot vote on Approved transaction

All 11 tests pass for both Pinocchio and Native variants.

Running Tests

# Pinocchio
cargo build-sbf --manifest-path chains/solana/examples/multisig/pinocchio/Cargo.toml
cargo test -p ika-example-multisig --test mollusk

# Native
cargo build-sbf --manifest-path chains/solana/examples/multisig/native/Cargo.toml
cargo test -p ika-example-multisig-native --test mollusk

Source

  • Pinocchio: chains/solana/examples/multisig/pinocchio/tests/mollusk.rs
  • Native: chains/solana/examples/multisig/native/tests/mollusk.rs