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
12 changes: 12 additions & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use soroban_sdk::{contract, contractimpl, Address, Env};

/// Shared mock for the Drips protocol contract.
/// Used by both `purge_reward_stream` and `test` integration test suites
/// so the stub only needs to be maintained in one place (issue #199).
#[contract]
pub struct MockDripsContract;

#[contractimpl]
impl MockDripsContract {
pub fn start_stream(_env: Env, _contributor: Address, _task_id: u64, _resolution_status: u32) {}
}
13 changes: 4 additions & 9 deletions tests/purge_reward_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
// RewardStream(task_id) / AllRewardStreams entries once the task
// referenced by that stream has been purged.

mod common;

use common::MockDripsContract;
use soroban_sdk::token::StellarAssetClient;
use soroban_sdk::{contract, contractimpl, testutils::Address as _, Address, Env};
use soroban_sdk::{testutils::Address as _, Address, Env};
use vero_core_contracts::{Role, VeroContractClient};

#[contract]
pub struct MockDripsContract;

#[contractimpl]
impl MockDripsContract {
pub fn start_stream(_env: Env, _contributor: Address, _task_id: u64, _resolution_status: u32) {}
}

const LOCK_THRESHOLD: i128 = 100;

fn setup() -> (Env, Address, Address, VeroContractClient<'static>) {
Expand Down
10 changes: 3 additions & 7 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#![cfg(any())] // Disabled due to upstream breakages

mod common;
use common::MockDripsContract;

use soroban_sdk::token::{Client as TokenClient, StellarAssetClient as TestTokenClient};
use soroban_sdk::{
testutils::{Address as _, Ledger as _},
Expand Down Expand Up @@ -1269,13 +1272,6 @@ fn test_simulated_migration_failure_rolls_back() {
assert_eq!(client.get_storage_version(), 0);
}

#[contract]
pub struct MockDripsContract;

#[contractimpl]
impl MockDripsContract {
pub fn start_stream(_env: Env, _contributor: Address, _task_id: u64, _resolution_status: u32) {}
}
#[test]
fn test_purge_done_task_removes_storage() {
let (env, _contract_id, admin, token, client) = setup();
Expand Down
Loading