Skip to content

Commit f5f0864

Browse files
authored
Merge pull request OlufunbiIK#322 from fredericklamar342-prog/frederick
feat: implement on-chain version tracking and upgrade functionality
2 parents b79217a + e4cc36f commit f5f0864

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

CONTRIBUTORS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Contributors
2+
3+
Thank you to everyone who has contributed to StellarSplit! We appreciate your help in making bill splitting effortless for everyone.
4+
5+
## Core Team
6+
- **OlufunbiIK** - Lead Maintainer - [GitHub](https://github.com/OlufunbiIK)
7+
8+
## Community Contributors
9+
- **fredericklamar342-prog** - [GitHub](https://github.com/fredericklamar342-prog)
10+
- **victor-134** - [GitHub](https://github.com/victor-134)

contracts/split-escrow/src/errors.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ pub enum Error {
1616
/// The maximum number of participants for this escrow has been reached.
1717
ParticipantCapExceeded = 10,
1818

19-
// Money-critical/upgrade failures are asserted by numeric code in tests.
2019
InvalidVersion = 11,
2120
InvalidInput = 12,
2221
EscrowNotActive = 13,
23-
InvalidMetadata = 13,
24-
/// Split is already finalized (released or cancelled) or otherwise not active.
2522
SplitNotActive = 14,
26-
InvalidVersion = 15,
2723
InvalidMetadata = 15,
2824
ParticipantNotOwed = 16,
2925
InsufficientFulfillment = 17,

contracts/split-escrow/src/events.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ pub fn emit_initialized(env: &Env, admin: &Address) {
66
env.events().publish(("init", "admin"), admin.clone());
77
}
88

9-
pub fn emit_contract_upgraded(env: &Env, old_version: String, new_version: String) {
10-
env.events().publish(
11-
("upgraded", "old_version", "new_version"),
12-
(old_version, new_version),
13-
);
14-
}
15-
169
pub fn emit_split_created(env: &Env, split: &Split) {
1710
env.events().publish(
1811
("created", "split_id", "creator"),

contracts/split-escrow/src/test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ fn test_admin_can_update_fee_and_treasury() {
109109
&false,
110110
&obligations_a,
111111
&None,
112-
113112
);
114113
client.deposit(&split_a, &participant, &1_000);
115114
client.release_funds(&split_a);
@@ -215,7 +214,6 @@ fn test_upgrade_version_non_admin_fails() {
215214
}
216215

217216
#[test]
218-
#[should_panic(expected = "HostError: Error(Contract, #15)")] // InvalidVersion
219217
fn test_partial_deposits() {
220218
let (env, client, _admin, creator, participant, token_client, _) = setup();
221219
let p2 = Address::generate(&env);
@@ -334,7 +332,10 @@ fn test_toggle_whitelist_allows_creator_to_restrict_access() {
334332
fn test_create_escrow_with_metadata_stores_correctly() {
335333
let (env, client, _admin, creator, _participant, _token_client, _token_admin) = setup();
336334
let mut metadata = soroban_sdk::Map::new(&env);
337-
metadata.set(String::from_str(&env, "key"), String::from_str(&env, "value"));
335+
metadata.set(
336+
String::from_str(&env, "key"),
337+
String::from_str(&env, "value"),
338+
);
338339

339340
let split_id = client.create_escrow(
340341
&creator,
@@ -348,7 +349,7 @@ fn test_create_escrow_with_metadata_stores_correctly() {
348349
let escrow = client.get_escrow(&split_id);
349350
assert_eq!(escrow.metadata, metadata);
350351
}
351-
#[should_panic(expected = "HostError: Error(Contract, #15)")] // InvalidVersion
352+
#[should_panic(expected = "HostError: Error(Contract, #11)")] // InvalidVersion
352353
fn test_initialize_invalid_version_fails() {
353354
let env = Env::default();
354355
env.mock_all_auths();

0 commit comments

Comments
 (0)