Skip to content

Smart account: example weighted threshold policy#666

Merged
brozorec merged 1 commit intomainfrom
sa-weighted-threshold-policy
Mar 31, 2026
Merged

Smart account: example weighted threshold policy#666
brozorec merged 1 commit intomainfrom
sa-weighted-threshold-policy

Conversation

@brozorec
Copy link
Copy Markdown
Collaborator

@brozorec brozorec commented Mar 30, 2026

Summary by CodeRabbit

Release Notes

New Features

  • Added a weighted-threshold-policy smart account example demonstrating multi-signature authorization with configurable signer weights and dynamic threshold management capabilities.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06c9eec1-0272-45d6-9dab-2d1989222586

📥 Commits

Reviewing files that changed from the base of the PR and between 64bdebf and 611a08a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • examples/multisig-smart-account/weighted-threshold-policy/Cargo.toml
  • examples/multisig-smart-account/weighted-threshold-policy/src/contract.rs
  • examples/multisig-smart-account/weighted-threshold-policy/src/lib.rs

Walkthrough

A new Soroban smart contract example project for weighted-threshold-policy is added under examples/multisig-smart-account/. The project includes Cargo configuration, a contract module implementing the Policy trait, and a library entry point configured for no_std compilation.

Changes

Cohort / File(s) Summary
Project Configuration
examples/multisig-smart-account/weighted-threshold-policy/Cargo.toml
Defines the new example crate with dependencies on soroban-sdk and stellar-accounts, configured as an unpublished library compiled as a cdylib.
Smart Contract Implementation
examples/multisig-smart-account/weighted-threshold-policy/src/contract.rs, src/lib.rs
Implements WeightedThresholdPolicyContract with Policy trait implementation; provides contract methods for managing threshold and signer weights (get_threshold, get_signer_weights, set_threshold, set_signer_weight).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A weighted policy takes form,
With thresholds set just right,
Smart accounts now have the charm,
Of signatures balanced tight!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided; the template requires context, issue reference, and a PR checklist for new features. Add a pull request description including the issue reference, explanation of changes, and completion status of the PR checklist items (Tests and Documentation).
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new weighted threshold policy example for smart accounts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sa-weighted-threshold-policy

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.23%. Comparing base (64bdebf) to head (611a08a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #666   +/-   ##
=======================================
  Coverage   96.23%   96.23%           
=======================================
  Files          59       59           
  Lines        6169     6169           
=======================================
  Hits         5937     5937           
  Misses        232      232           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brozorec brozorec requested a review from ozgunozerk March 31, 2026 10:39
@brozorec brozorec merged commit 9ef5b70 into main Mar 31, 2026
7 checks passed
@brozorec brozorec deleted the sa-weighted-threshold-policy branch March 31, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants