Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,59 @@ jobs:
with:
name: contract-abi-${{ github.sha }}
path: .abi/

docs:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v5

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Generate Documentation
run: |
cargo doc --no-deps --all
# Create redirect index.html
cat << 'EOF' > target/doc/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=project_registry/index.html">
<title>Heliobond Contracts Documentation</title>
</head>
<body>
<p>Redirecting to <a href="project_registry/index.html">Project Registry documentation</a>...</p>
<p>You can also view the <a href="investment_vault/index.html">Investment Vault documentation</a>.</p>
</body>
</html>
EOF

- name: Upload Documentation Artifact
uses: actions/upload-artifact@v4
with:
name: contracts-documentation-${{ github.sha }}
path: target/doc/
retention-days: 14

- name: Setup Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: actions/configure-pages@v5

- name: Upload Pages Artifact
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: target/doc

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
id: deployment
uses: actions/deploy-pages@v4

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ When impact scores change (via `update_impact_score` or `update_credit_quality_s

For details, see [`docs/NOTIFICATIONS.md`](./docs/NOTIFICATIONS.md).

### API & Rust Crate Documentation

Rust docs are automatically generated and published via CI:
* Deployed reference: [https://BuildersWCT.github.io/contracts/](https://BuildersWCT.github.io/contracts/)

### ProjectRegistry

**Constructor**
Expand Down
5 changes: 4 additions & 1 deletion project_registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ mod types;
mod storage;
mod logic;

pub use types::{ArchiveSummary, CertificationStatus, DataKey, ProjectData, Proposal, RegistryError};
pub use types::{ArchiveSummary, CertificationStatus, DataKey, ProjectData, Proposal, RegistryError, ScoreHistoryEntry};

/// Maximum entries in the score history ring buffer (#123).
const MAX_SCORE_HISTORY: u32 = 50;

/// Minimum voting period in seconds (~1 day at 5s/ledger, ≈ 17280 ledgers) (#134).
const MIN_VOTING_PERIOD: u64 = 86_400;
Expand Down
2 changes: 2 additions & 0 deletions project_registry/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ pub enum RegistryError {
UpdateTooFrequent = 33,
/// Project must be archived before it can be compacted.
ProjectNotArchived = 34,
/// Contract operations are paused.
Paused = 35,
}

/// Certification state for a green project (#130).
Expand Down
Loading