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
3 changes: 2 additions & 1 deletion contracts/assetsup/src/detokenization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ pub fn execute_detokenization(env: &Env, asset_id: u64, proposal_id: u64) -> Res

// Get list of all token holders before clearing
let holders_list_key = TokenDataKey::TokenHoldersList(asset_id);
let holders = store.get::<_, soroban_sdk::Vec<Address>>(&holders_list_key)
let holders = store
.get::<_, soroban_sdk::Vec<Address>>(&holders_list_key)
.ok_or(Error::AssetNotTokenized)?;

// Remove all token holder records
Expand Down
5 changes: 4 additions & 1 deletion contracts/assetsup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,10 @@ impl AssetUpContract {
}

/// Get a specific policy
pub fn get_insurance_policy(env: Env, policy_id: BytesN<32>) -> Option<insurance::InsurancePolicy> {
pub fn get_insurance_policy(
env: Env,
policy_id: BytesN<32>,
) -> Option<insurance::InsurancePolicy> {
insurance::get_policy(env, policy_id)
}

Expand Down
7 changes: 6 additions & 1 deletion contracts/assetsup/src/tests/detokenization_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,12 @@ fn test_token_elimination_on_execution() {
let holders_result = tokenization::get_token_holders(&env, asset_id);
let holders_cleared = holders_result.is_err();

(before_exists, after_exists, balance_cleared, holders_cleared)
(
before_exists,
after_exists,
balance_cleared,
holders_cleared,
)
});

// Assert asset existed before
Expand Down
23 changes: 12 additions & 11 deletions contracts/assetsup/src/tests/insurance_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ fn test_renew_expired_policy() {
li.timestamp = 1000;
});

let mut policy = create_test_policy(&env, policy_id.clone(), holder, insurer.clone(), asset_id);
let mut policy =
create_test_policy(&env, policy_id.clone(), holder, insurer.clone(), asset_id);
// Set policy to expire at timestamp 2000
policy.start_date = 1000;
policy.end_date = 2000;
Expand All @@ -343,14 +344,9 @@ fn test_renew_expired_policy() {
insurance::expire_policy(env.clone(), policy_id.clone()).unwrap();

// Now renew it to timestamp 3500
let renew_result = insurance::renew_policy(
env.clone(),
policy_id.clone(),
3500,
1500,
insurer.clone(),
)
.is_ok();
let renew_result =
insurance::renew_policy(env.clone(), policy_id.clone(), 3500, 1500, insurer.clone())
.is_ok();

let final_policy = insurance::get_policy(env.clone(), policy_id.clone()).unwrap();

Expand Down Expand Up @@ -409,8 +405,13 @@ fn test_status_transition_validation() {

let (suspend_ok, cancel_after_suspend_ok, suspend_cancelled_err) =
env.as_contract(&contract_id, || {
let policy =
create_test_policy(&env, policy_id.clone(), holder.clone(), insurer.clone(), asset_id);
let policy = create_test_policy(
&env,
policy_id.clone(),
holder.clone(),
insurer.clone(),
asset_id,
);
insurance::create_policy(env.clone(), policy).unwrap();

// Active -> Suspended (should work)
Expand Down
Loading