Skip to content

Commit

Permalink
removing the "last_known_cursor" and let the CI run it
Browse files Browse the repository at this point in the history
  • Loading branch information
b-yap committed Aug 25, 2023
1 parent d3d2cc1 commit 1ea31da
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"connection_info": {
"address": "3.239.7.78",
"port": 11625
},
"node_info": {
"ledger_version": 19,
"overlay_version": 28,
"overlay_min_version": 27,
"version_str": "stellar-core 19.12.0.rc2 (2109a168a895349f87b502ae3d182380b378fa47)",
"is_pub_net": false
},
"stellar_history_archive_urls": []
}
12 changes: 9 additions & 3 deletions clients/stellar-relay-lib/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ fn secret_key() -> String {
}

fn overlay_infos() -> (NodeInfo, ConnectionInfo) {
let cfg = StellarOverlayConfig::try_from_path(
"./resources/config/testnet/stellar_relay_config_sdftest2.json",
)
use rand::seq::SliceRandom;

let stellar_node_points = [1, 2, 3];
let node_point = stellar_node_points
.choose(&mut rand::thread_rng())
.expect("should return a value");
let cfg = StellarOverlayConfig::try_from_path(&format!(
"./resources/config/testnet/stellar_relay_config_sdftest{node_point}.json"
))
.expect("should be able to extract config");

(cfg.node_info(), cfg.connection_info(&secret_key()).expect("should return conn info"))
Expand Down
5 changes: 0 additions & 5 deletions clients/vault/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,6 @@ impl VaultService {
let vault_public_key = wallet.get_public_key();
let is_public_network = wallet.is_public_network();

#[cfg(any(test, feature = "integration"))]
let last_known_cursor = wallet.get_last_cursor();

// re-submit transactions in the cache
let _receivers = wallet.resubmit_transactions_from_cache().await;
//todo: handle errors from the receivers
Expand Down Expand Up @@ -531,8 +528,6 @@ impl VaultService {
issue_map.clone(),
memos_to_issue_ids.clone(),
issue_filter,
#[cfg(any(test, feature = "integration"))]
last_known_cursor,
)),
),
(
Expand Down
3 changes: 0 additions & 3 deletions clients/vault/tests/vault_integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ async fn test_issue_cancel_succeeds() {
issue_set.clone(),
memos_to_issue_ids.clone(),
issue_filter,
LAST_KNOWN_CURSOR,
),
vault::service::listen_for_issue_requests(
vault_provider.clone(),
Expand Down Expand Up @@ -701,7 +700,6 @@ async fn test_automatic_issue_execution_succeeds_hoho() {
issue_set.clone(),
memos_to_issue_ids.clone(),
issue_filter,
LAST_KNOWN_CURSOR,
),
vault::service::listen_for_issue_requests(
vault_provider.clone(),
Expand Down Expand Up @@ -849,7 +847,6 @@ async fn test_automatic_issue_execution_succeeds_for_other_vault() {
issue_set_arc.clone(),
memos_to_issue_ids.clone(),
issue_filter,
LAST_KNOWN_CURSOR,
),
vault::service::listen_for_issue_requests(
vault2_provider.clone(),
Expand Down
5 changes: 0 additions & 5 deletions clients/wallet/src/horizon/horizon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ pub async fn listen_for_new_transactions<T, U, Filter>(
issue_map: Arc<RwLock<T>>,
memos_to_issue_ids: Arc<RwLock<U>>,
filter: Filter,
#[cfg(any(test, feature = "testing-utils"))] last_cursor: PagingToken,
) -> Result<(), Error>
where
T: Clone,
Expand All @@ -300,12 +299,8 @@ where
let mut fetcher =
HorizonFetcher::new(horizon_client, vault_account_public_key, is_public_network);

#[cfg(not(any(test, feature = "testing-utils")))]
let mut last_cursor = 0;

#[cfg(any(test, feature = "testing-utils"))]
let mut last_cursor = last_cursor;

loop {
last_cursor = fetcher
.fetch_horizon_and_process_new_transactions(
Expand Down
4 changes: 2 additions & 2 deletions testchain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ impl XCMCurrencyConversion for SpacewalkNativeCurrencyKey {
fn convert_to_dia_currency_id(token_symbol: u8) -> Option<(Vec<u8>, Vec<u8>)> {
// todo: this code results in Execution error:
// todo: \"Unable to get required collateral for amount\":
// todo: Module(ModuleError { index: 19, error: [0, 0, 0, 0], message: None })", data: None }
// cfg_if::cfg_if! {
// todo: Module(ModuleError { index: 19, error: [0, 0, 0, 0], message: None })", data: None
// } cfg_if::cfg_if! {
// if #[cfg(not(feature = "testing-utils"))] {
// if token_symbol == 0 {
// return Some((b"Kusama".to_vec(), b"KSM".to_vec()))
Expand Down

0 comments on commit 1ea31da

Please sign in to comment.