Skip to content
Merged
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
1 change: 1 addition & 0 deletions contracts/revenue_pool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![no_std]
#![warn(missing_docs)]

use soroban_sdk::{
contract, contracterror, contractimpl, contracttype, token, Address, BytesN, Env, Map, String, Symbol, Vec,
Expand Down
11 changes: 5 additions & 6 deletions contracts/settlement/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ pub(crate) fn propose_balance_migration(env: &Env, caller: &Address, from: &Addr
let amount: i128 = env
.storage()
.persistent()
.get(&StorageKey::DeveloperBalance(from.clone(), usdc_token.clone()))
.get(&StorageKey::DeveloperBalance(
from.clone(),
usdc_token.clone(),
))
.unwrap_or(0);
if amount <= 0 {
env.panic_with_error(SettlementError::NoDeveloperBalance);
Expand Down Expand Up @@ -76,11 +79,7 @@ pub(crate) fn execute_balance_migration(env: &Env, caller: &Address, from: &Addr
let source_key = StorageKey::DeveloperBalance(from.clone(), usdc_token.clone());
let destination_key = StorageKey::DeveloperBalance(migration.to.clone(), usdc_token.clone());

let source_balance: i128 = env
.storage()
.persistent()
.get(&source_key)
.unwrap_or(0);
let source_balance: i128 = env.storage().persistent().get(&source_key).unwrap_or(0);
let new_source_balance = source_balance
.checked_sub(migration.amount)
.filter(|b| *b >= 0)
Expand Down
4 changes: 3 additions & 1 deletion contracts/settlement/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ pub enum SettlementError {
MigrationNotFound = 20,
TimelockNotExpired = 21,
MigrationBalanceChanged = 22,
MinimumBalanceRequired = 23,
OverDraft = 23,
InvalidClaimWindow = 24,
ClaimWindowClosed = 25,
}
5 changes: 4 additions & 1 deletion contracts/settlement/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ mod tests {
#[test]
fn test_event_admin_broadcast_bytes() {
let env = Env::default();
assert_eq!(event_admin_broadcast(&env), Symbol::new(&env, "admin_broadcast"));
assert_eq!(
event_admin_broadcast(&env),
Symbol::new(&env, "admin_broadcast")
);
}

#[test]
Expand Down
Loading
Loading