Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/mm2' into libp2p-gossip-…
Browse files Browse the repository at this point in the history
…sub-ordermatch

# Conflicts:
#	Cargo.lock
#	mm2src/coins/lp_coins.rs
#	mm2src/coins/utxo/rpc_clients.rs
#	mm2src/common/build.rs
#	mm2src/common/common.rs
#	mm2src/common/mm_ctx.rs
#	mm2src/common/mm_number.rs
#	mm2src/docker_tests.rs
#	mm2src/lp_native_dex.rs
#	mm2src/lp_network.rs
#	mm2src/lp_ordermatch.rs
#	mm2src/lp_swap.rs
#	mm2src/lp_swap/maker_swap.rs
#	mm2src/lp_swap/taker_swap.rs
#	mm2src/mm2.rs
#	mm2src/mm2_tests.rs
#	mm2src/rpc.rs
#	mm2src/rpc/lp_signatures.rs
  • Loading branch information
artemii235 committed Jul 6, 2020
2 parents c7e7df0 + 8a284f0 commit 311ee7b
Show file tree
Hide file tree
Showing 54 changed files with 12,282 additions and 7,928 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing to AtomicDEX Marketmaker

We welcomes contribution from everyone in the form of suggestions, bug reports, pull requests, and feedback.
Please note we have a code of conduct, please follow it in all your interactions with the project.

## Submitting feature requests

Before uploading any changes, please make sure that the test suite passes locally before submitting a pull request with your changes.

```
cargo test --all --features native
```

We also use [Clippy](https://github.com/rust-lang/rust-clippy) to avoid common mistakes
and we use [rustfmt](https://github.com/rust-lang/rustfmt) to make our code clear to everyone.

1. Install these tools (only once):
```
rustup component add rustfmt --toolchain nightly-2020-02-01
rustup component add clippy
```
1. Format the code using rustfmt:
```
cargo +nightly fmt
```
1. Make sure there are no warnings and errors. Run the Clippy:
```
cargo clippy --features native -- -D warnings
```
385 changes: 385 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions azure-pipelines-build-stage-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:
BOB_USERPASS: $(${{ parameters.bob_userpass }})
ALICE_PASSPHRASE: $(${{ parameters.alice_passphrase }})
ALICE_USERPASS: $(${{ parameters.alice_userpass }})
- bash: |
cargo clippy --features native -- -D warnings
displayName: 'Check Clippy warnings'
condition: eq( variables['Agent.OS'], 'Linux' )
- bash: |
cargo +nightly fmt -- --check
displayName: 'Check rustfmt warnings'
condition: eq( variables['Agent.OS'], 'Linux' )
- bash: |
zip upload/mm2-$(COMMIT_HASH)-$(Agent.OS)-Debug target/debug/mm2 -j
displayName: 'Prepare debug build upload Linux'
Expand Down
30 changes: 20 additions & 10 deletions mm2src/coins/coins_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,47 @@ pub fn test_list_unspent() {
let client = NativeClientImpl {
coin_ticker: "RICK".into(),
uri: "http://127.0.0.1:10271".to_owned(),
auth: fomat!("Basic " (base64_encode("user481805103:pass97a61c8d048bcf468c6c39a314970e557f57afd1d8a5edee917fb29bafb3a43371", URL_SAFE))),
auth: fomat!("Basic "(base64_encode(
"user481805103:pass97a61c8d048bcf468c6c39a314970e557f57afd1d8a5edee917fb29bafb3a43371",
URL_SAFE
))),
event_handlers: Default::default(),
};
let unspents = client.list_unspent(0, std::i32::MAX, vec!["RBs52D7pVq7txo6SCz1Tuyw2WrPmdqU3qw".to_owned()]);
let unspents = unwrap! (unspents.wait());
log!("Unspents " [unspents]);
let unspents = unwrap!(unspents.wait());
log!("Unspents "[unspents]);
}

pub fn test_get_block_count() {
let client = NativeClientImpl {
coin_ticker: "RICK".into(),
uri: "http://127.0.0.1:10271".to_owned(),
auth: fomat!("Basic " (base64_encode("user481805103:pass97a61c8d048bcf468c6c39a314970e557f57afd1d8a5edee917fb29bafb3a43371", URL_SAFE))),
auth: fomat!("Basic "(base64_encode(
"user481805103:pass97a61c8d048bcf468c6c39a314970e557f57afd1d8a5edee917fb29bafb3a43371",
URL_SAFE
))),
event_handlers: Default::default(),
};
let block_count = unwrap! (client.validate_address("RBs52D7pVq7txo6SCz1Tuyw2WrPmdqU3qw".to_owned()).wait());
log!("Block count " [block_count]);
let block_count = unwrap!(client
.validate_address("RBs52D7pVq7txo6SCz1Tuyw2WrPmdqU3qw".to_owned())
.wait());
log!("Block count "[block_count]);
}

pub fn test_import_address() {
let client = NativeClientImpl {
coin_ticker: "RICK".into(),
uri: "http://127.0.0.1:10271".to_owned(),
auth: fomat!("Basic " (base64_encode("user481805103:pass97a61c8d048bcf468c6c39a314970e557f57afd1d8a5edee917fb29bafb3a43371", URL_SAFE))),
auth: fomat!("Basic "(base64_encode(
"user481805103:pass97a61c8d048bcf468c6c39a314970e557f57afd1d8a5edee917fb29bafb3a43371",
URL_SAFE
))),
event_handlers: Default::default(),
};
let import_addr = client.import_address(
"bMjWGCinft5qEvsuf9Wg1fgz1CjpXBXbTB",
"bMjWGCinft5qEvsuf9Wg1fgz1CjpXBXbTB",
true
true,
);
let import_addr = import_addr.wait().unwrap();
log!("Block count " [import_addr]);
import_addr.wait().unwrap();
}
1,306 changes: 852 additions & 454 deletions mm2src/coins/eth.rs

Large diffs are not rendered by default.

Loading

0 comments on commit 311ee7b

Please sign in to comment.