Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup repo for nightly builds testing #806

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devops/.template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
target
project/contracts/template-contract/out
template-contract/out
19 changes: 14 additions & 5 deletions .devops/.template/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[workspace]
resolver = "2"
members = [
"./template-contract",
]
[project]
name = "template-contract"
version = "0.0.0"
authors = ["Fuel Labs <contact@fuel.sh>"]
edition = "2021"
license = "Apache-2.0"

[dependencies]
fuels = { workspace = true }
tokio = { workspace = true }

[[test]]
harness = true
name = "template_contract_integration_tests"
path = "tests/harness.rs"
4 changes: 2 additions & 2 deletions .devops/.template/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[[package]]
name = "core"
source = "path+from-root-C3992B43B72ADB8C"
source = "path+from-root-CC22FE9C5CBB0084"

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.49.1#2ac7030570f22510b0ac2a7b5ddf7baa20bdc0e1"
source = "git+https://github.com/fuellabs/sway?tag=v0.61.2#e1b1c2bee73e0ba825e07736cefa6c0abd079595"
dependencies = ["core"]

[[package]]
Expand Down
15 changes: 0 additions & 15 deletions .devops/.template/template-contract/Cargo.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use fuels::prelude::*;

abigen!(Contract(
name = "Template",
abi = "./template-contract/out/debug/template-contract-abi.json"
abi = "./.devops/.template/template-contract/out/debug/template-contract-abi.json"
));

const TEMPLATE_CONTRACT_BINARY_PATH: &str = "./out/debug/template-contract.bin";
const TEMPLATE_CONTRACT_STORAGE_PATH: &str = "./out/debug/template-contract-storage_slots.json";
const TEMPLATE_CONTRACT_BINARY_PATH: &str = "./template-contract/out/debug/template-contract.bin";
const TEMPLATE_CONTRACT_STORAGE_PATH: &str = "./template-contract/out/debug/template-contract-storage_slots.json";

pub async fn setup() -> (Template<WalletUnlocked>, WalletUnlocked) {
let number_of_wallets = 1;
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
"escrow",
"fundraiser",
"TicTacToe",
"multisig-wallet",
"name-registry",
"NFT",
"native-asset",
Expand Down Expand Up @@ -85,7 +84,6 @@ jobs:

- name: Check Rust formatting
run: |
cd ${{ matrix.project }}
cargo fmt --verbose --check

- name: Build Sway
Expand All @@ -95,17 +93,14 @@ jobs:

- name: Build Rust files
run: |
cd ${{ matrix.project }}
cargo build --locked
cargo build --locked --package "${{ matrix.project }}*"

- name: Check Clippy Linter
run: |
cd ${{ matrix.project }}
cargo clippy --all-features --all-targets -- -D warnings
cargo clippy --all-features --all-targets -- -D warnings --package "${{ matrix.project }}*"

- name: Run Rust tests
run: |
cd ${{ matrix.project }}
cargo test --locked

- name: Run Sway tests
Expand Down
16 changes: 0 additions & 16 deletions AMM/AMM-contract/Cargo.toml

This file was deleted.

25 changes: 15 additions & 10 deletions AMM/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
[workspace]
resolver = "2"
members = [
"./AMM-contract",
"./exchange-contract",
"./atomic-add-liquidity",
"./swap-exact-input",
"./swap-exact-output",
"./test-utils",
]
[package]
name = "AMM"
version = "0.0.0"
authors = ["Fuel Labs <contact@fuel.sh>"]
edition = "2021"
license = "Apache-2.0"

[[test]]
harness = true
name = "AMM_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { workspace = true }
tokio = { workspace = true }
4 changes: 2 additions & 2 deletions AMM/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [

[[package]]
name = "core"
source = "path+from-root-841ED074400F52FC"
source = "path+from-root-CC22FE9C5CBB0084"

[[package]]
name = "exchange-contract"
Expand All @@ -41,7 +41,7 @@ dependencies = [

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?rev#4fe6f1ed5134914f1133bb7032e9fe7165255cc6"
source = "git+https://github.com/fuellabs/sway?tag=v0.61.2#e1b1c2bee73e0ba825e07736cefa6c0abd079595"
dependencies = ["core"]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion AMM/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = [
"./AMM-contract",
"./exchange-contract",
"./test-utils/test-artifacts/malicious-implementation",
"./malicious-implementation",
"./atomic-add-liquidity",
"./swap-exact-input",
"./swap-exact-output",
Expand Down
16 changes: 0 additions & 16 deletions AMM/atomic-add-liquidity/Cargo.toml

This file was deleted.

16 changes: 0 additions & 16 deletions AMM/exchange-contract/Cargo.toml

This file was deleted.

6 changes: 0 additions & 6 deletions AMM/fuel-toolchain.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ license = "Apache-2.0"
name = "malicious-implementation"

[dependencies]
libraries = { path = "../../../libraries" }
libraries = { path = "../libraries" }
16 changes: 0 additions & 16 deletions AMM/swap-exact-input/Cargo.toml

This file was deleted.

16 changes: 0 additions & 16 deletions AMM/swap-exact-output/Cargo.toml

This file was deleted.

12 changes: 0 additions & 12 deletions AMM/test-utils/Cargo.toml

This file was deleted.

14 changes: 0 additions & 14 deletions AMM/test-utils/src/paths.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::utils::setup;
use test_utils::{
use crate::amm_contract::utils::setup;
use crate::test_utils::{
data_structures::ExchangeContractConfiguration, interface::amm::add_pool,
setup::common::deploy_and_construct_exchange,
};

mod success {
use super::*;
use crate::utils::ordered_pair;
use test_utils::interface::{amm::pool, RegisterPoolEvent};
use crate::amm_contract::utils::ordered_pair;
use crate::test_utils::interface::{amm::pool, RegisterPoolEvent};

#[tokio::test]
async fn adds_when_asset_pair_is_in_same_order() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::utils::setup;
use test_utils::interface::amm::initialize;
use crate::amm_contract::utils::setup;
use crate::test_utils::interface::amm::initialize;

mod success {
use super::*;
use fuels::types::Bits256;
use test_utils::{
use crate::test_utils::{
interface::SetExchangeBytecodeRootEvent, setup::common::exchange_bytecode_root,
};

Expand All @@ -31,7 +31,7 @@ mod success {

mod revert {
use super::*;
use test_utils::{
use crate::test_utils::{
data_structures::ExchangeContractConfiguration,
setup::common::deploy_and_construct_exchange,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod success {
use crate::utils::setup;
use test_utils::{
use crate::amm_contract::utils::setup;
use crate::test_utils::{
data_structures::ExchangeContractConfiguration,
interface::amm::{add_pool, pool},
setup::common::deploy_and_construct_exchange,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fuels::prelude::{AssetId, WalletUnlocked};
use test_utils::{
use crate::test_utils::{
data_structures::WalletAssetConfiguration,
interface::AMM,
setup::common::{deploy_amm, deploy_and_initialize_amm, setup_wallet_and_provider},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::utils::{expected_liquidity, setup};
use test_utils::interface::{
use crate::test_utils::interface::{
abigen_bindings::shared_types::{Asset, AssetPair},
LiquidityParameters,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::utils::{expected_liquidity, setup};
use test_utils::{
use crate::test_utils::{
data_structures::LiquidityParameters as TestLiquidityParameters,
interface::{
abigen_bindings::shared_types::{Asset, AssetPair},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fuels::prelude::WalletUnlocked;
use test_utils::{
use crate::test_utils::{
data_structures::{
ExchangeContract, ExchangeContractConfiguration, LiquidityParameters,
TransactionParameters, WalletAssetConfiguration,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::utils::setup_and_construct;
use test_utils::{
use crate::exchange_contract::utils::setup_and_construct;
use crate::test_utils::{
data_structures::LiquidityParameters, interface::exchange::add_liquidity,
setup::common::deposit_and_add_liquidity,
};

mod success {
use super::*;
use crate::utils::{contract_balances, wallet_balances};
use crate::exchange_contract::utils::{contract_balances, wallet_balances};
use fuels::{prelude::ContractId, tx::ContractIdExt, types::Bytes32};
use test_utils::{
use crate::test_utils::{
interface::{
exchange::{deposit, pool_info},
AddLiquidityEvent, Asset, AssetPair,
Expand Down Expand Up @@ -320,7 +320,7 @@ mod success {

mod revert {
use super::*;
use crate::utils::setup;
use crate::exchange_contract::utils::setup;

#[tokio::test]
#[should_panic(expected = "AssetPairNotSet")]
Expand Down
Loading
Loading