Skip to content

Commit

Permalink
Fix lints + disable non-compiling test module (linera-io#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twey authored Jul 15, 2024
1 parent 47a6317 commit 2554efe
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

18 changes: 9 additions & 9 deletions examples/amm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ be adding/removing liquidity and also performing a swap.
It supports the following operations. All operations need to be executed remotely.

- Swap: For a given input token and an input amount, it swaps that token amount for an
amount of the other token calculated based on the current AMM ratio.
amount of the other token calculated based on the current AMM ratio.

- Add Liquidity: This operation allows adding liquidity to the AMM. Given a maximum
`token0` and `token1` amount that you're willing to add, it adds liquidity such that you'll be
adding at most `max_token0_amount` of `token0` and `max_token1_amount` of `token1`. The amounts
will be calculated based on the current AMM ratio. The owner, in this case, refers to the user
adding liquidity, which currently can only be a chain owner.
`token0` and `token1` amount that you're willing to add, it adds liquidity such that you'll be
adding at most `max_token0_amount` of `token0` and `max_token1_amount` of `token1`. The amounts
will be calculated based on the current AMM ratio. The owner, in this case, refers to the user
adding liquidity, which currently can only be a chain owner.

- Remove Liquidity: This withdraws tokens from the AMM. Given the index of the token you'd
like to remove (can be 0 or 1), and an amount of that token that you'd like to remove, it calculates
how much of the other token will also be removed based on the current AMM ratio. Then it removes
the amounts from both tokens as a removal of liquidity. The owner, in this context, is the user
removing liquidity, which currently can only be a chain owner.
like to remove (can be 0 or 1), and an amount of that token that you'd like to remove, it calculates
how much of the other token will also be removed based on the current AMM ratio. Then it removes
the amounts from both tokens as a removal of liquidity. The owner, in this context, is the user
removing liquidity, which currently can only be a chain owner.

# Usage

Expand Down
18 changes: 9 additions & 9 deletions examples/amm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ be adding/removing liquidity and also performing a swap.
It supports the following operations. All operations need to be executed remotely.
- Swap: For a given input token and an input amount, it swaps that token amount for an
amount of the other token calculated based on the current AMM ratio.
amount of the other token calculated based on the current AMM ratio.
- Add Liquidity: This operation allows adding liquidity to the AMM. Given a maximum
`token0` and `token1` amount that you're willing to add, it adds liquidity such that you'll be
adding at most `max_token0_amount` of `token0` and `max_token1_amount` of `token1`. The amounts
will be calculated based on the current AMM ratio. The owner, in this case, refers to the user
adding liquidity, which currently can only be a chain owner.
`token0` and `token1` amount that you're willing to add, it adds liquidity such that you'll be
adding at most `max_token0_amount` of `token0` and `max_token1_amount` of `token1`. The amounts
will be calculated based on the current AMM ratio. The owner, in this case, refers to the user
adding liquidity, which currently can only be a chain owner.
- Remove Liquidity: This withdraws tokens from the AMM. Given the index of the token you'd
like to remove (can be 0 or 1), and an amount of that token that you'd like to remove, it calculates
how much of the other token will also be removed based on the current AMM ratio. Then it removes
the amounts from both tokens as a removal of liquidity. The owner, in this context, is the user
removing liquidity, which currently can only be a chain owner.
like to remove (can be 0 or 1), and an amount of that token that you'd like to remove, it calculates
how much of the other token will also be removed based on the current AMM ratio. Then it removes
the amounts from both tokens as a removal of liquidity. The owner, in this context, is the user
removing liquidity, which currently can only be a chain owner.
# Usage
Expand Down
2 changes: 1 addition & 1 deletion examples/crowd-funding/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl CrowdFundingContract {
);

// TODO(#728): Remove this.
#[cfg(not(any(test, feature = "test")))]
#[cfg(not(test))]
assert!(
self.runtime.system_time() >= self.instantiation_argument().deadline,
"Crowd-funding campaign has not reached its deadline yet"
Expand Down
2 changes: 1 addition & 1 deletion examples/matching-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ An `OrderId` is used to uniquely identify an order and enables the following fun
When inserting an order it goes through the following steps:

- Transfer of tokens from the `fungible` application to the `matching engine` application through a cross-application
call so that it can be paid to the counterparty.
call so that it can be paid to the counterparty.

- The engine selects the matching price levels for the inserted order. It then proceeds
to clear these levels, executing trades and ensuring that at the end of the process,
Expand Down
2 changes: 1 addition & 1 deletion examples/matching-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ An `OrderId` is used to uniquely identify an order and enables the following fun
When inserting an order it goes through the following steps:
- Transfer of tokens from the `fungible` application to the `matching engine` application through a cross-application
call so that it can be paid to the counterparty.
call so that it can be paid to the counterparty.
- The engine selects the matching price levels for the inserted order. It then proceeds
to clear these levels, executing trades and ensuring that at the end of the process,
Expand Down
1 change: 0 additions & 1 deletion linera-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ version.workspace = true
test = ["test-strategy", "proptest"]
metrics = ["prometheus"]
web = ["getrandom/js", "rand/getrandom", "rand/std", "rand/std_rng", "web-time"]
rocksdb = []

[dependencies]
anyhow.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion linera-base/tests/command_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

#![cfg(feature = "rocksdb")]
// TODO(#2239): these tests fail to build
#![cfg(any())]

use std::path::Path;

Expand Down
4 changes: 2 additions & 2 deletions linera-service/src/cli_wrappers/helmfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ impl HelmFile {
fs_extra::copy_items(&[&chart_dir], temp_dir.path(), &CopyOptions::new())?;

Command::new("helmfile")
.current_dir(&temp_dir.path().join("linera-validator"))
.current_dir(temp_dir.path().join("linera-validator"))
.env(
"LINERA_HELMFILE_SET_SERVER_CONFIG",
&format!("working/server_{server_config_id}.json"),
format!("working/server_{server_config_id}.json"),
)
.env("LINERA_HELMFILE_SET_NUM_SHARDS", num_shards.to_string())
.arg("sync")
Expand Down

0 comments on commit 2554efe

Please sign in to comment.