Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:KomodoPlatform/atomicDEX-API into lo…
Browse files Browse the repository at this point in the history
…ck-free-sequence-logic
  • Loading branch information
onur-ozkan committed Mar 6, 2023
2 parents 3eaacda + b6a9c92 commit 9cfbb2a
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 59 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions azure-pipelines-android-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "##vso[task.setvariable variable=COMMIT_HASH]${TAG}"
displayName: Setup ENV
- bash: |
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_android_armv7_CI
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_android_armv7_CI
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand All @@ -34,7 +34,7 @@ jobs:
env:
MANUAL_MM_VERSION: true
- bash: |
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_android_aarch64_CI
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_android_aarch64_CI
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-build-stage-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- bash: |
rm -rf upload
mkdir upload
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_CI
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_CI
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-ios-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "##vso[task.setvariable variable=COMMIT_HASH]${TAG}"
displayName: Setup ENV
- bash: |
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_ios_aarch64_CI
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_ios_aarch64_CI
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines-release-stage-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
mkdir upload
displayName: 'Recreate upload dir'
- bash: |
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Debug
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Debug
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
condition: and( eq( variables['Agent.OS'], 'Windows_NT' ), eq( variables['DEBUG_UPLOADED'], '' ) )
- bash: |
rm -f MM_VERSION
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Release
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Release
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-wasm-stage-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- bash: |
rm -rf upload
mkdir upload
VERSION=2.1.$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Release
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Release
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ignore = [
"RUSTSEC-2021-0059",
"RUSTSEC-2021-0060",
"RUSTSEC-2022-0090",
"RUSTSEC-2023-0018",
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ ed25519-dalek = "1.0.1"
ed25519-dalek-bip32 = "0.2.0"
enum_from = { path = "../derives/enum_from" }
ethabi = { version = "17.0.0" }
ethcore-transaction = { git = "https://github.com/artemii235/parity-ethereum.git" }
ethcore-transaction = { git = "https://github.com/KomodoPlatform/mm2-parity-ethereum.git" }
ethereum-types = { version = "0.13", default-features = false, features = ["std", "serialize"] }
ethkey = { git = "https://github.com/artemii235/parity-ethereum.git" }
ethkey = { git = "https://github.com/KomodoPlatform/mm2-parity-ethereum.git" }
# Waiting for https://github.com/rust-lang/rust/issues/54725 to use on Stable.
#enum_dispatch = "0.1"
futures01 = { version = "0.1", package = "futures" }
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/tendermint/rpc/tendermint_wasm_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mod tests {

#[wasm_bindgen_test]
async fn test_get_abci_info() {
let client = HttpClient::new("https://cosmos-testnet-rpc.allthatnode.com:26657").unwrap();
let client = HttpClient::new("https://rpc.sentry-02.theta-testnet.polypore.xyz").unwrap();
client.abci_info().await.unwrap();
}
}
2 changes: 1 addition & 1 deletion mm2src/coins/tendermint/tendermint_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl RpcCommonOps for TendermintCoin {
let mut client_impl = self.client.0.lock().await;
// try to find first live client
for (i, client) in client_impl.rpc_clients.clone().into_iter().enumerate() {
match client.perform(HealthRequest).timeout(Duration::from_secs(5)).await {
match client.perform(HealthRequest).timeout(Duration::from_secs(15)).await {
Ok(Ok(_)) => {
// Bring the live client to the front of rpc_clients
client_impl.rpc_clients.rotate_left(i);
Expand Down
3 changes: 2 additions & 1 deletion mm2src/mm2_bin_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

[package]
name = "mm2_bin_lib"
version = "0.1.0"
version = "1.0.0-beta"
authors = ["James Lee", "Artem Pikulin", "Artem Grinblat", "Omar S.", "Onur Ozkan", "Alina Sharon", "Caglar Kaya", "Cipi", "Sergey Boiko", "Samuel Onoja", "Roman Sztergbaum", "Kadan Stadelmann <[email protected]>"]
edition = "2018"
default-run = "mm2"

Expand Down
45 changes: 19 additions & 26 deletions mm2src/mm2_bin_lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,29 @@ fn root() -> PathBuf {
/// we might skip synchronizing the Git repository there),
/// but if it is, then we're going to check if the “MM_DATETIME” and the Git data match.
fn mm_version() -> String {
// We fetch the actual git version here,
// with `git log '--pretty=format:%h' -n 1` for the nightlies,
// and a release tag when building from some kind of a stable branch,
// though we should keep the ability for the tooling to provide the “MM_VERSION”
// externally, because moving the entire ".git" around is not always practical.
let mut version = "UNKNOWN".to_string();
let mut command = Command::new("git");
command.arg("log").arg("--pretty=format:%h").arg("-n1");
if let Ok(go) = command.output() {
if go.status.success() {
version = from_utf8(&go.stdout).unwrap().trim().to_string();
if !Regex::new(r"^\w+$").unwrap().is_match(&version) {
panic!("{}", version)
}
}
}
// Reading version of `mm2_bin_lib` from cargo manifest
let mut version = env!("CARGO_PKG_VERSION").to_owned();

let mm_version_p = root().join("../../MM_VERSION");
let v_file = String::from_utf8(slurp(&mm_version_p)).unwrap();
let v_file = v_file.trim().to_string();
// if there is no MM_VERSION file there is no need to create it

// if there is MM_VERSION file, that means CI wants to put a tag to version
if !v_file.is_empty() {
if !v_file.contains(&version) {
// If the file doesn't contain the latest commit hash then this is a local build
// and the env version variable should be "v_file"_"version" as "v_file" is the version from the local file
// and "version" is the latest commit hash
version = format!("{}_{}", v_file, version);
} else {
// If the file contains the latest commit hash then this is a CI build and the version generated by CI should be written to env
version = v_file;
version = format!("{}_{}", version, v_file.trim());
}
// put commit tag to the version
else {
let mut command = Command::new("git");
command.arg("log").arg("--pretty=format:%h").arg("-n1");
if let Ok(go) = command.output() {
if go.status.success() {
let commit_hash = from_utf8(&go.stdout).unwrap().trim().to_string();
if !Regex::new(r"^\w+$").unwrap().is_match(&commit_hash) {
panic!("{}", commit_hash)
}

version = format!("{version}_{commit_hash}");
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_eth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ doctest = false

[dependencies]
ethabi = { version = "17.0.0" }
ethkey = { git = "https://github.com/artemii235/parity-ethereum.git" }
ethkey = { git = "https://github.com/KomodoPlatform/mm2-parity-ethereum.git" }
hex = "0.4.2"
indexmap = "1.7.0"
itertools = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ winapi = "0.3"
[dev-dependencies]
mm2_test_helpers = { path = "../mm2_test_helpers" }
mocktopus = "0.8.0"
testcontainers = { git = "https://github.com/artemii235/testcontainers-rs.git" }
testcontainers = { git = "https://github.com/KomodoPlatform/mm2-testcontainers-rs.git" }

[build-dependencies]
chrono = "0.4"
Expand Down
9 changes: 8 additions & 1 deletion mm2src/mm2_main/src/mm2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ pub fn mm2_main(version: String, datetime: String) {
use libc::c_char;

init_crash_reports();
log!("AtomicDEX MarketMaker {} DT {}", version, datetime);

// Temporarily simulate `argv[]` for the C version of the main method.
let args: Vec<String> = env::args()
Expand Down Expand Up @@ -376,15 +375,23 @@ pub fn mm2_main(version: String, datetime: String) {
return;
}

if first_arg == Some("--version") || first_arg == Some("-v") || first_arg == Some("version") {
println!("AtomicDEX API: {version}");
return;
}

if first_arg == Some("--help") || first_arg == Some("-h") || first_arg == Some("help") {
help();
return;
}

if cfg!(windows) && first_arg == Some("/?") {
help();
return;
}

log!("AtomicDEX API {} DT {}", version, datetime);

if let Err(err) = run_lp_main(first_arg, &|_| (), version, datetime) {
log!("{}", err);
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/tests/mm2_tests/tendermint_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde_json::{self as json, json};
const ATOM_TEST_BALANCE_SEED: &str = "atom test seed";
const ATOM_TEST_WITHDRAW_SEED: &str = "atom test withdraw seed";
const ATOM_TICKER: &str = "ATOM";
const ATOM_TENDERMINT_RPC_URLS: &[&str] = &["https://cosmos-testnet-rpc.allthatnode.com:26657"];
const ATOM_TENDERMINT_RPC_URLS: &[&str] = &["https://rpc.sentry-02.theta-testnet.polypore.xyz"];

const IRIS_TESTNET_RPC_URLS: &[&str] = &["http://34.80.202.172:26657"];

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
bytes = "1.1"
cfg-if = "1.0"
common = { path = "../common" }
ethkey = { git = "https://github.com/artemii235/parity-ethereum.git" }
ethkey = { git = "https://github.com/KomodoPlatform/mm2-parity-ethereum.git" }
mm2_err_handle = { path = "../mm2_err_handle" }
mm2_core = { path = "../mm2_core" }
derive_more = "0.99"
Expand Down

0 comments on commit 9cfbb2a

Please sign in to comment.