Skip to content

Commit

Permalink
Merge pull request #793 from FuelLabs/latestbump
Browse files Browse the repository at this point in the history
Bump all applications
  • Loading branch information
SwayStar123 authored May 29, 2024
2 parents 9b124db + e8c6d53 commit c3568c3
Show file tree
Hide file tree
Showing 247 changed files with 36,647 additions and 7,074 deletions.
6 changes: 3 additions & 3 deletions .docs/contributing-book/src/code/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ dependencies = ["std"]

[[package]]
name = "core"
source = "path+from-root-C3992B43B72ADB8C"
source = "path+from-root-E19CE48B3E858B72"

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.49.1#2ac7030570f22510b0ac2a7b5ddf7baa20bdc0e1"
dependencies = ["core"]
source = "git+https://github.com/fuellabs/sway?tag=v0.60.0#2f0392ee35a1e4dd80bd8034962d5b4083dfb8b6"
dependencies = ["core"]
2 changes: 1 addition & 1 deletion .docs/contributing-book/src/code/connect_four/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl ConnectFour for Contract {
Game::new(player_one, player_two)
}

fn move(column: u64, game: Game) -> Game {
fn move(_column: u64, game: Game) -> Game {
game
}
}
6 changes: 3 additions & 3 deletions .docs/contributing-book/src/code/fuel-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[toolchain]
channel = "nightly-2024-01-24"
channel = "nightly-2024-05-28"

[components]
forc = "0.49.1"
fuel-core = "0.22.0"
forc = "0.60.0"
fuel-core = "0.26.0"
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

env:
RUST_VERSION: 1.74.0
RUST_VERSION: 1.78.0

jobs:
lint-toml-files:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
uses: FuelLabs/action-fuel-toolchain@v0.6.0
with:
toolchain: nightly
date: 2024-01-24
date: 2024-05-28

- name: Check Sway formatting
run: |
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
uses: FuelLabs/action-fuel-toolchain@v0.6.0
with:
toolchain: nightly
date: 2024-01-24
date: 2024-05-28

- name: Check Sway formatting
run: cd ${{ matrix.project }} && forc fmt --check
Expand Down
2 changes: 1 addition & 1 deletion AMM/AMM-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0"

[dependencies]
fuels = { version = "0.55.0", features = ["fuel-core-lib"] }
fuels = { version = "0.62.0", features = ["fuel-core-lib"] }
test-utils = { path = "../test-utils" }
tokio = { version = "1.21.0", features = ["rt", "macros"] }

Expand Down
15 changes: 3 additions & 12 deletions AMM/AMM-contract/src/events.sw
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@ library;
/// The information logged when a pool is registered.
pub struct RegisterPoolEvent {
/// The pair of asset identifiers that make up the pool.
asset_pair: (AssetId, AssetId),
pub asset_pair: (AssetId, AssetId),
/// The exchange contract identifier that manages the pool which also identifies the pool asset.
pool: ContractId,
}

// TODO: Remove this when its automatically implemented
impl AbiEncode for RegisterPoolEvent {
fn abi_encode(self, ref mut buffer: Buffer) {
buffer.push(self.asset_pair.0);
buffer.push(self.asset_pair.1);
buffer.push(self.pool);
}
pub pool: ContractId,
}

/// The information logged when an exchange bytecode root is set.
pub struct SetExchangeBytecodeRootEvent {
/// The bytecode root of the valid exchange contract implementation.
root: b256,
pub root: b256,
}
13 changes: 9 additions & 4 deletions AMM/AMM-contract/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ mod events;

use ::errors::InitError;
use ::events::{RegisterPoolEvent, SetExchangeBytecodeRootEvent};
use libraries::{AMM, Exchange};
use std::{constants::BASE_ASSET_ID, external::bytecode_root, hash::Hash};
use libraries::{AMM, data_structures::PoolInfo, Exchange};
use std::{external::bytecode_root, hash::Hash};

storage {
/// The valid exchange contract bytecode root.
Expand Down Expand Up @@ -57,7 +57,10 @@ impl AMM for Contract {

require(pair_matches_exchange_pair, InitError::PairDoesNotDefinePool);

let ordered_asset_pair = if asset_pair.0.into() < asset_pair.1.into() {
let asset_pair_0_b256: b256 = asset_pair.0.into();
let asset_pair_1_b256: b256 = asset_pair.1.into();

let ordered_asset_pair = if asset_pair_0_b256 < asset_pair_1_b256 {
asset_pair
} else {
(asset_pair.1, asset_pair.0)
Expand All @@ -73,7 +76,9 @@ impl AMM for Contract {

#[storage(read)]
fn pool(asset_pair: (AssetId, AssetId)) -> Option<ContractId> {
let ordered_asset_pair = if asset_pair.0.into() < asset_pair.1.into() {
let asset_pair_0_b256: b256 = asset_pair.0.into();
let asset_pair_1_b256: b256 = asset_pair.1.into();
let ordered_asset_pair = if asset_pair_0_b256 < asset_pair_1_b256 {
asset_pair
} else {
(asset_pair.1, asset_pair.0)
Expand Down
8 changes: 4 additions & 4 deletions AMM/AMM-contract/tests/functions/add_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mod success {
let log = response
.decode_logs_with_type::<RegisterPoolEvent>()
.unwrap();
let event = log.get(0).unwrap();
let event = log.first().unwrap();

let exchange_contract_id_in_storage = pool(&amm_instance, pair).await;

Expand Down Expand Up @@ -55,7 +55,7 @@ mod success {
let log = response
.decode_logs_with_type::<RegisterPoolEvent>()
.unwrap();
let event = log.get(0).unwrap();
let event = log.first().unwrap();

let exchange_contract_id_in_storage = pool(&amm_instance, pair).await;

Expand Down Expand Up @@ -91,13 +91,13 @@ mod success {
let log = response
.decode_logs_with_type::<RegisterPoolEvent>()
.unwrap();
let event_1 = log.get(0).unwrap();
let event_1 = log.first().unwrap();

let response = add_pool(&amm_instance, pair_2, exchange_2.id).await;
let log = response
.decode_logs_with_type::<RegisterPoolEvent>()
.unwrap();
let event_2 = log.get(0).unwrap();
let event_2 = log.first().unwrap();

let exchange_contract_id_in_storage_of_pair_1 = pool(&amm_instance, pair_1).await;
let exchange_contract_id_in_storage_of_pair_2 = pool(&amm_instance, pair_2).await;
Expand Down
2 changes: 1 addition & 1 deletion AMM/AMM-contract/tests/functions/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod success {
let log = response
.decode_logs_with_type::<SetExchangeBytecodeRootEvent>()
.unwrap();
let event = log.get(0).unwrap();
let event = log.first().unwrap();

assert_eq!(
*event,
Expand Down
Loading

0 comments on commit c3568c3

Please sign in to comment.