Skip to content

Commit 266bc0f

Browse files
authored
Merge pull request #570 from mbo-hub11/feature/issues-518-519-520-521
feat: implement issues #518-#521
2 parents 7507c8e + d77a69e commit 266bc0f

10 files changed

Lines changed: 541 additions & 44 deletions

File tree

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Build output
22
target/
33
*.wasm
4+
wasm32-unknown-unknown/
5+
**/wasm32-unknown-unknown/
46

57
# Environment files
68
.env
@@ -10,6 +12,7 @@ target/
1012
# OS files
1113
.DS_Store
1214
Thumbs.db
15+
desktop.ini
1316
.vscode/
1417
.idea/
1518
*.log
@@ -28,12 +31,16 @@ snapshots/
2831
*.swp
2932
*.swo
3033
*~
34+
*.sublime-project
35+
*.sublime-workspace
3136

3237
# Test snapshots
3338
**/__snapshots__/
3439
*.snap
3540
**/test_snapshots/
3641
*.snapshot
42+
**/snapshots/
43+
*.snap.bak
3744

3845
# Stellar CLI
3946
.stellar/
@@ -43,25 +50,52 @@ identity/
4350
# Logs
4451
*.log
4552
*.log.*
53+
npm-debug.log*
54+
yarn-debug.log*
55+
yarn-error.log*
4656

4757
# Coverage reports
4858
lcov.info
4959
tarpaulin-report.html
5060
coverage/
5161
.nyc_output/
62+
profdata/
5263

5364
# Temporary files
5465
*.tmp
5566
*.bak
5667
*.orig
68+
*.rej
69+
*~
70+
.*.swp
71+
.*.swo
5772

5873
# Node / JS tooling (if any frontend tooling is added)
5974
node_modules/
6075
dist/
6176
.pnp
6277
.pnp.js
6378
.yarn/
79+
.next/
80+
.nuxt/
81+
.parcel-cache/
82+
.cache/
6483

6584
# Rust / Cargo artefacts not caught by target/
6685
**/*.rs.bk
6786
Cargo.lock.bak
87+
**/*.profraw
88+
**/*.profdata
89+
90+
# Fuzz corpus (generated during fuzzing runs)
91+
fuzz/corpus/*
92+
!fuzz/corpus/.gitkeep
93+
94+
# Cargo audit / deny / outdated cache
95+
.cargo-ok
96+
cargo-audit.toml
97+
98+
# Python / misc tooling
99+
__pycache__/
100+
*.pyc
101+
.pytest_cache/

contracts/split/src/error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ pub enum ContractError {
8080
CircularDependency = 45,
8181
/// Issue #453: Source contract has exceeded its call rate limit within the current window.
8282
SourceContractRateLimited = 46,
83+
/// Issue #519: An invoice status transition is not permitted by the state machine.
84+
InvalidStateTransition = 47,
85+
/// Issue #518: A split ratio is invalid (e.g. >= denominator or sum mismatch).
86+
InvalidRatio = 48,
8387
/// Storage migration framework: `schema_version` is behind the version
8488
/// this Wasm build expects. Call `migrate` before retrying.
8589
MigrationRequired = 47,

contracts/split/src/events.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::types::{DisputeOutcome, InvoiceStatus, RepScore, TimelockAction};
1+
use crate::types::{DisputeOutcome, FeeSplit, InvoiceStatus, RepScore, TimelockAction};
22
use soroban_sdk::{contracttype, symbol_short, Address, BytesN, Env, String, Vec};
33

44
// ---------------------------------------------------------------------------
@@ -906,7 +906,19 @@ pub fn dispute_expired(env: &Env, invoice_id: u64) {
906906
);
907907
}
908908

909+
/// Issue #521: Emitted when the fee recipients list is updated.
910+
pub fn fee_recipients_updated(env: &Env, recipients: &Vec<FeeSplit>) {
911+
env.events().publish(
912+
(
913+
symbol_short!("split"),
914+
symbol_short!("fee_rcp_upd"),
915+
),
916+
(recipients.clone(),),
917+
);
918+
}
919+
909920
/// Issue #326: Emitted when a protocol fee is paid to treasury on release.
921+
///
910922
/// Topics: (split, fee_paid, invoice_id)
911923
/// Data: (amount, treasury, ledger)
912924
pub fn fee_paid(env: &Env, invoice_id: u64, amount: i128, treasury: &Address) {

0 commit comments

Comments
 (0)