From d285be71cff44cb88e64951266c4d68c0d8ae44e Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Wed, 8 May 2024 22:24:01 +0200 Subject: [PATCH 1/5] Rename neurons rust to neurons --- .../workflows/{neurons-rust-checks.yml => neurons-checks.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{neurons-rust-checks.yml => neurons-checks.yml} (95%) diff --git a/.github/workflows/neurons-rust-checks.yml b/.github/workflows/neurons-checks.yml similarity index 95% rename from .github/workflows/neurons-rust-checks.yml rename to .github/workflows/neurons-checks.yml index e73aef9..69f7eb1 100644 --- a/.github/workflows/neurons-rust-checks.yml +++ b/.github/workflows/neurons-checks.yml @@ -1,4 +1,4 @@ -name: Neurons Rust Checks +name: Neurons Checks on: pull_request: push: From 7577a7986d045642006d4e7c9646df5de0f68b53 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Wed, 8 May 2024 22:24:32 +0200 Subject: [PATCH 2/5] Rename voting to contracts --- .github/workflows/{voting-checks.yml => contracts-checks.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{voting-checks.yml => contracts-checks.yml} (96%) diff --git a/.github/workflows/voting-checks.yml b/.github/workflows/contracts-checks.yml similarity index 96% rename from .github/workflows/voting-checks.yml rename to .github/workflows/contracts-checks.yml index 403c0c8..e00e4f7 100644 --- a/.github/workflows/voting-checks.yml +++ b/.github/workflows/contracts-checks.yml @@ -1,4 +1,4 @@ -name: Voting Contract Checks +name: Contracts Checks on: pull_request: push: From 35b059700efb237610cbe933dfbc17e09338f0fa Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Wed, 8 May 2024 22:26:11 +0200 Subject: [PATCH 3/5] Rename contract to nqg --- contracts/Cargo.lock | 20 +++++++++---------- contracts/Cargo.toml | 2 +- contracts/{offchain => nqg}/Cargo.toml | 2 +- contracts/{offchain => nqg}/README.md | 0 contracts/{offchain => nqg}/mocks/Cargo.toml | 0 contracts/{offchain => nqg}/mocks/src/lib.rs | 0 contracts/{offchain => nqg}/src/admin.rs | 0 .../{offchain => nqg}/src/admin/traits.rs | 0 contracts/{offchain => nqg}/src/lib.rs | 0 .../src/neural_governance.rs | 0 .../src/neural_governance/traits.rs | 0 contracts/{offchain => nqg}/src/storage.rs | 0 .../{offchain => nqg}/src/storage/key_data.rs | 0 contracts/{offchain => nqg}/src/types.rs | 0 contracts/{offchain => nqg}/tests/e2e/auth.rs | 0 .../tests/e2e/common/contract_utils.rs | 0 .../{offchain => nqg}/tests/e2e/common/mod.rs | 0 .../{offchain => nqg}/tests/e2e/governance.rs | 0 contracts/{offchain => nqg}/tests/e2e/mod.rs | 0 .../{offchain => nqg}/tests/e2e/upgrade.rs | 0 .../{offchain => nqg}/tests/e2e/voting.rs | 0 contracts/{offchain => nqg}/tests/main.rs | 0 22 files changed, 12 insertions(+), 12 deletions(-) rename contracts/{offchain => nqg}/Cargo.toml (96%) rename contracts/{offchain => nqg}/README.md (100%) rename contracts/{offchain => nqg}/mocks/Cargo.toml (100%) rename contracts/{offchain => nqg}/mocks/src/lib.rs (100%) rename contracts/{offchain => nqg}/src/admin.rs (100%) rename contracts/{offchain => nqg}/src/admin/traits.rs (100%) rename contracts/{offchain => nqg}/src/lib.rs (100%) rename contracts/{offchain => nqg}/src/neural_governance.rs (100%) rename contracts/{offchain => nqg}/src/neural_governance/traits.rs (100%) rename contracts/{offchain => nqg}/src/storage.rs (100%) rename contracts/{offchain => nqg}/src/storage/key_data.rs (100%) rename contracts/{offchain => nqg}/src/types.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/auth.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/common/contract_utils.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/common/mod.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/governance.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/mod.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/upgrade.rs (100%) rename contracts/{offchain => nqg}/tests/e2e/voting.rs (100%) rename contracts/{offchain => nqg}/tests/main.rs (100%) diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index e956bb3..db14683 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -644,6 +644,16 @@ dependencies = [ "soroban-sdk", ] +[[package]] +name = "nqg" +version = "0.1.0" +dependencies = [ + "mocks", + "soroban-fixed-point-math", + "soroban-sdk", + "soroban_decimal_numbers", +] + [[package]] name = "num-bigint" version = "0.4.4" @@ -700,16 +710,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "offchain" -version = "0.1.0" -dependencies = [ - "mocks", - "soroban-fixed-point-math", - "soroban-sdk", - "soroban_decimal_numbers", -] - [[package]] name = "once_cell" version = "1.19.0" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 263decf..746ef79 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["offchain"] +members = ["nqg"] [workspace.dependencies] soroban-sdk = "20.4.0" diff --git a/contracts/offchain/Cargo.toml b/contracts/nqg/Cargo.toml similarity index 96% rename from contracts/offchain/Cargo.toml rename to contracts/nqg/Cargo.toml index 5b12700..df22341 100644 --- a/contracts/offchain/Cargo.toml +++ b/contracts/nqg/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "offchain" +name = "nqg" version = "0.1.0" edition = "2021" diff --git a/contracts/offchain/README.md b/contracts/nqg/README.md similarity index 100% rename from contracts/offchain/README.md rename to contracts/nqg/README.md diff --git a/contracts/offchain/mocks/Cargo.toml b/contracts/nqg/mocks/Cargo.toml similarity index 100% rename from contracts/offchain/mocks/Cargo.toml rename to contracts/nqg/mocks/Cargo.toml diff --git a/contracts/offchain/mocks/src/lib.rs b/contracts/nqg/mocks/src/lib.rs similarity index 100% rename from contracts/offchain/mocks/src/lib.rs rename to contracts/nqg/mocks/src/lib.rs diff --git a/contracts/offchain/src/admin.rs b/contracts/nqg/src/admin.rs similarity index 100% rename from contracts/offchain/src/admin.rs rename to contracts/nqg/src/admin.rs diff --git a/contracts/offchain/src/admin/traits.rs b/contracts/nqg/src/admin/traits.rs similarity index 100% rename from contracts/offchain/src/admin/traits.rs rename to contracts/nqg/src/admin/traits.rs diff --git a/contracts/offchain/src/lib.rs b/contracts/nqg/src/lib.rs similarity index 100% rename from contracts/offchain/src/lib.rs rename to contracts/nqg/src/lib.rs diff --git a/contracts/offchain/src/neural_governance.rs b/contracts/nqg/src/neural_governance.rs similarity index 100% rename from contracts/offchain/src/neural_governance.rs rename to contracts/nqg/src/neural_governance.rs diff --git a/contracts/offchain/src/neural_governance/traits.rs b/contracts/nqg/src/neural_governance/traits.rs similarity index 100% rename from contracts/offchain/src/neural_governance/traits.rs rename to contracts/nqg/src/neural_governance/traits.rs diff --git a/contracts/offchain/src/storage.rs b/contracts/nqg/src/storage.rs similarity index 100% rename from contracts/offchain/src/storage.rs rename to contracts/nqg/src/storage.rs diff --git a/contracts/offchain/src/storage/key_data.rs b/contracts/nqg/src/storage/key_data.rs similarity index 100% rename from contracts/offchain/src/storage/key_data.rs rename to contracts/nqg/src/storage/key_data.rs diff --git a/contracts/offchain/src/types.rs b/contracts/nqg/src/types.rs similarity index 100% rename from contracts/offchain/src/types.rs rename to contracts/nqg/src/types.rs diff --git a/contracts/offchain/tests/e2e/auth.rs b/contracts/nqg/tests/e2e/auth.rs similarity index 100% rename from contracts/offchain/tests/e2e/auth.rs rename to contracts/nqg/tests/e2e/auth.rs diff --git a/contracts/offchain/tests/e2e/common/contract_utils.rs b/contracts/nqg/tests/e2e/common/contract_utils.rs similarity index 100% rename from contracts/offchain/tests/e2e/common/contract_utils.rs rename to contracts/nqg/tests/e2e/common/contract_utils.rs diff --git a/contracts/offchain/tests/e2e/common/mod.rs b/contracts/nqg/tests/e2e/common/mod.rs similarity index 100% rename from contracts/offchain/tests/e2e/common/mod.rs rename to contracts/nqg/tests/e2e/common/mod.rs diff --git a/contracts/offchain/tests/e2e/governance.rs b/contracts/nqg/tests/e2e/governance.rs similarity index 100% rename from contracts/offchain/tests/e2e/governance.rs rename to contracts/nqg/tests/e2e/governance.rs diff --git a/contracts/offchain/tests/e2e/mod.rs b/contracts/nqg/tests/e2e/mod.rs similarity index 100% rename from contracts/offchain/tests/e2e/mod.rs rename to contracts/nqg/tests/e2e/mod.rs diff --git a/contracts/offchain/tests/e2e/upgrade.rs b/contracts/nqg/tests/e2e/upgrade.rs similarity index 100% rename from contracts/offchain/tests/e2e/upgrade.rs rename to contracts/nqg/tests/e2e/upgrade.rs diff --git a/contracts/offchain/tests/e2e/voting.rs b/contracts/nqg/tests/e2e/voting.rs similarity index 100% rename from contracts/offchain/tests/e2e/voting.rs rename to contracts/nqg/tests/e2e/voting.rs diff --git a/contracts/offchain/tests/main.rs b/contracts/nqg/tests/main.rs similarity index 100% rename from contracts/offchain/tests/main.rs rename to contracts/nqg/tests/main.rs From 6b2c539c5e4fa8b84adfa463c53c05d19f9fe60f Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Wed, 8 May 2024 22:26:35 +0200 Subject: [PATCH 4/5] Add missing image --- contracts/nqg/README.md | 2 +- contracts/nqg/image.png | Bin 0 -> 12175 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 contracts/nqg/image.png diff --git a/contracts/nqg/README.md b/contracts/nqg/README.md index 9b2a665..6be58fb 100644 --- a/contracts/nqg/README.md +++ b/contracts/nqg/README.md @@ -3,7 +3,7 @@ This contract is a part of implementation of the [Neural Quorum Governance](https://stellarcommunityfund.gitbook.io/module-library) mechanism. -![architecture](../voting_system/image.png) +![architecture](image.png) Currently, because of [resource constraints](https://developers.stellar.org/docs/reference/resource-limits-fees#resource-limits) and to diff --git a/contracts/nqg/image.png b/contracts/nqg/image.png new file mode 100644 index 0000000000000000000000000000000000000000..4ed1f6ff64215d8f133b1c05a0fc6b6051e82998 GIT binary patch literal 12175 zcmeHtbyU=CyDlIIf=WmTD4>Ldw1jkbN_V%wOO7-sAviQhOV?1+(ufGs-3`(pT>}H> zL45b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subject: [PATCH 5/5] Rename contract to governance, remove unused dependency --- contracts/Cargo.lock | 25 +++++++----------- contracts/Cargo.toml | 2 +- contracts/{nqg => governance}/Cargo.toml | 3 +-- contracts/{nqg => governance}/README.md | 0 contracts/{nqg => governance}/image.png | Bin .../{nqg => governance}/mocks/Cargo.toml | 0 .../{nqg => governance}/mocks/src/lib.rs | 0 contracts/{nqg => governance}/src/admin.rs | 0 .../{nqg => governance}/src/admin/traits.rs | 0 contracts/{nqg => governance}/src/lib.rs | 10 +++---- .../src/neural_governance.rs | 0 .../src/neural_governance/traits.rs | 0 contracts/{nqg => governance}/src/storage.rs | 0 .../src/storage/key_data.rs | 0 contracts/{nqg => governance}/src/types.rs | 0 .../{nqg => governance}/tests/e2e/auth.rs | 0 .../tests/e2e/common/contract_utils.rs | 10 +++---- .../tests/e2e/common/mod.rs | 0 .../tests/e2e/governance.rs | 4 +-- .../{nqg => governance}/tests/e2e/mod.rs | 0 .../{nqg => governance}/tests/e2e/upgrade.rs | 0 .../{nqg => governance}/tests/e2e/voting.rs | 4 +-- contracts/{nqg => governance}/tests/main.rs | 0 23 files changed, 25 insertions(+), 33 deletions(-) rename contracts/{nqg => governance}/Cargo.toml (89%) rename contracts/{nqg => governance}/README.md (100%) rename contracts/{nqg => governance}/image.png (100%) rename contracts/{nqg => governance}/mocks/Cargo.toml (100%) rename contracts/{nqg => governance}/mocks/src/lib.rs (100%) rename contracts/{nqg => governance}/src/admin.rs (100%) rename contracts/{nqg => governance}/src/admin/traits.rs (100%) rename contracts/{nqg => governance}/src/lib.rs (98%) rename contracts/{nqg => governance}/src/neural_governance.rs (100%) rename contracts/{nqg => governance}/src/neural_governance/traits.rs (100%) rename contracts/{nqg => governance}/src/storage.rs (100%) rename contracts/{nqg => governance}/src/storage/key_data.rs (100%) rename contracts/{nqg => governance}/src/types.rs (100%) rename contracts/{nqg => governance}/tests/e2e/auth.rs (100%) rename contracts/{nqg => governance}/tests/e2e/common/contract_utils.rs (55%) rename contracts/{nqg => governance}/tests/e2e/common/mod.rs (100%) rename contracts/{nqg => governance}/tests/e2e/governance.rs (98%) rename contracts/{nqg => governance}/tests/e2e/mod.rs (100%) rename contracts/{nqg => governance}/tests/e2e/upgrade.rs (100%) rename contracts/{nqg => governance}/tests/e2e/voting.rs (98%) rename contracts/{nqg => governance}/tests/main.rs (100%) diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index db14683..a8b68bb 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -453,6 +453,15 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "governance" +version = "0.1.0" +dependencies = [ + "mocks", + "soroban-fixed-point-math", + "soroban-sdk", +] + [[package]] name = "group" version = "0.13.0" @@ -644,16 +653,6 @@ dependencies = [ "soroban-sdk", ] -[[package]] -name = "nqg" -version = "0.1.0" -dependencies = [ - "mocks", - "soroban-fixed-point-math", - "soroban-sdk", - "soroban_decimal_numbers", -] - [[package]] name = "num-bigint" version = "0.4.4" @@ -1143,12 +1142,6 @@ dependencies = [ "wasmparser-nostd", ] -[[package]] -name = "soroban_decimal_numbers" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f3200c7c9328eb132524f05529b5466ec5044fd193b3913f61cdaf22e0e031a" - [[package]] name = "spin" version = "0.9.8" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 746ef79..b245c6b 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["nqg"] +members = ["governance"] [workspace.dependencies] soroban-sdk = "20.4.0" diff --git a/contracts/nqg/Cargo.toml b/contracts/governance/Cargo.toml similarity index 89% rename from contracts/nqg/Cargo.toml rename to contracts/governance/Cargo.toml index df22341..b1abd1e 100644 --- a/contracts/nqg/Cargo.toml +++ b/contracts/governance/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nqg" +name = "governance" version = "0.1.0" edition = "2021" @@ -8,7 +8,6 @@ crate-type = ["cdylib", "lib"] [dependencies] soroban-sdk = { workspace = true, features = ["alloc"] } -soroban_decimal_numbers = "0.1.2" soroban-fixed-point-math.workspace = true [dev_dependencies] diff --git a/contracts/nqg/README.md b/contracts/governance/README.md similarity index 100% rename from contracts/nqg/README.md rename to contracts/governance/README.md diff --git a/contracts/nqg/image.png b/contracts/governance/image.png similarity index 100% rename from contracts/nqg/image.png rename to contracts/governance/image.png diff --git a/contracts/nqg/mocks/Cargo.toml b/contracts/governance/mocks/Cargo.toml similarity index 100% rename from contracts/nqg/mocks/Cargo.toml rename to contracts/governance/mocks/Cargo.toml diff --git a/contracts/nqg/mocks/src/lib.rs b/contracts/governance/mocks/src/lib.rs similarity index 100% rename from contracts/nqg/mocks/src/lib.rs rename to contracts/governance/mocks/src/lib.rs diff --git a/contracts/nqg/src/admin.rs b/contracts/governance/src/admin.rs similarity index 100% rename from contracts/nqg/src/admin.rs rename to contracts/governance/src/admin.rs diff --git a/contracts/nqg/src/admin/traits.rs b/contracts/governance/src/admin/traits.rs similarity index 100% rename from contracts/nqg/src/admin/traits.rs rename to contracts/governance/src/admin/traits.rs diff --git a/contracts/nqg/src/lib.rs b/contracts/governance/src/lib.rs similarity index 98% rename from contracts/nqg/src/lib.rs rename to contracts/governance/src/lib.rs index 36d82d9..25108ac 100644 --- a/contracts/nqg/src/lib.rs +++ b/contracts/governance/src/lib.rs @@ -34,7 +34,7 @@ pub mod types; pub const DECIMALS: i128 = 1_000_000_000_000_000_000; #[contract] -pub struct VotingSystemOffchain; +pub struct VotingSystem; type ContractResult = Result; @@ -66,7 +66,7 @@ pub enum DataKey { } #[contractimpl] -impl VotingSystemOffchain { +impl VotingSystem { /// Initialize the governance contract. pub fn initialize(env: Env, admin: Address, current_round: u32) { assert!(!is_set_admin(&env), "Admin already set"); @@ -186,7 +186,7 @@ impl VotingSystemOffchain { } #[contractimpl] -impl Admin for VotingSystemOffchain { +impl Admin for VotingSystem { fn transfer_admin(env: Env, new_admin: Address) { require_admin(&env); set_admin(&env, &new_admin); @@ -200,7 +200,7 @@ impl Admin for VotingSystemOffchain { } #[contractimpl] -impl Governance for VotingSystemOffchain { +impl Governance for VotingSystem { fn add_layer( env: Env, raw_neurons: Vec<(String, I256)>, @@ -332,7 +332,7 @@ impl Governance for VotingSystemOffchain { let neural_governance = read_neural_governance(&env).unwrap(); let mut result: Map = Map::new(&env); for layer_id in neural_governance.layers { - let layer_result = VotingSystemOffchain::get_layer_result(env.clone(), layer_id)?; + let layer_result = VotingSystem::get_layer_result(env.clone(), layer_id)?; for (key, value) in layer_result { result.set( key.clone(), diff --git a/contracts/nqg/src/neural_governance.rs b/contracts/governance/src/neural_governance.rs similarity index 100% rename from contracts/nqg/src/neural_governance.rs rename to contracts/governance/src/neural_governance.rs diff --git a/contracts/nqg/src/neural_governance/traits.rs b/contracts/governance/src/neural_governance/traits.rs similarity index 100% rename from contracts/nqg/src/neural_governance/traits.rs rename to contracts/governance/src/neural_governance/traits.rs diff --git a/contracts/nqg/src/storage.rs b/contracts/governance/src/storage.rs similarity index 100% rename from contracts/nqg/src/storage.rs rename to contracts/governance/src/storage.rs diff --git a/contracts/nqg/src/storage/key_data.rs b/contracts/governance/src/storage/key_data.rs similarity index 100% rename from contracts/nqg/src/storage/key_data.rs rename to contracts/governance/src/storage/key_data.rs diff --git a/contracts/nqg/src/types.rs b/contracts/governance/src/types.rs similarity index 100% rename from contracts/nqg/src/types.rs rename to contracts/governance/src/types.rs diff --git a/contracts/nqg/tests/e2e/auth.rs b/contracts/governance/tests/e2e/auth.rs similarity index 100% rename from contracts/nqg/tests/e2e/auth.rs rename to contracts/governance/tests/e2e/auth.rs diff --git a/contracts/nqg/tests/e2e/common/contract_utils.rs b/contracts/governance/tests/e2e/common/contract_utils.rs similarity index 55% rename from contracts/nqg/tests/e2e/common/contract_utils.rs rename to contracts/governance/tests/e2e/common/contract_utils.rs index c26a333..c2e0a10 100644 --- a/contracts/nqg/tests/e2e/common/contract_utils.rs +++ b/contracts/governance/tests/e2e/common/contract_utils.rs @@ -1,15 +1,15 @@ -use offchain::{VotingSystemOffchain, VotingSystemOffchainClient}; +use governance::{VotingSystem, VotingSystemClient}; use soroban_sdk::testutils::Address as AddressTrait; use soroban_sdk::{Address, Env}; -pub fn deploy_contract_without_initialization(env: &Env) -> VotingSystemOffchainClient { - let contract_id = env.register_contract(None, VotingSystemOffchain); - let contract_client = VotingSystemOffchainClient::new(env, &contract_id); +pub fn deploy_contract_without_initialization(env: &Env) -> VotingSystemClient { + let contract_id = env.register_contract(None, VotingSystem); + let contract_client = VotingSystemClient::new(env, &contract_id); contract_client } -pub fn deploy_contract(env: &Env) -> VotingSystemOffchainClient { +pub fn deploy_contract(env: &Env) -> VotingSystemClient { let contract_client = deploy_contract_without_initialization(env); env.mock_all_auths(); diff --git a/contracts/nqg/tests/e2e/common/mod.rs b/contracts/governance/tests/e2e/common/mod.rs similarity index 100% rename from contracts/nqg/tests/e2e/common/mod.rs rename to contracts/governance/tests/e2e/common/mod.rs diff --git a/contracts/nqg/tests/e2e/governance.rs b/contracts/governance/tests/e2e/governance.rs similarity index 98% rename from contracts/nqg/tests/e2e/governance.rs rename to contracts/governance/tests/e2e/governance.rs index d670125..d69cb5e 100644 --- a/contracts/nqg/tests/e2e/governance.rs +++ b/contracts/governance/tests/e2e/governance.rs @@ -1,7 +1,7 @@ use soroban_sdk::{vec, Env, String, Vec, I256}; -use offchain::types::VotingSystemError; -use offchain::LayerAggregator; +use governance::types::VotingSystemError; +use governance::LayerAggregator; use crate::e2e::common::contract_utils::deploy_contract; diff --git a/contracts/nqg/tests/e2e/mod.rs b/contracts/governance/tests/e2e/mod.rs similarity index 100% rename from contracts/nqg/tests/e2e/mod.rs rename to contracts/governance/tests/e2e/mod.rs diff --git a/contracts/nqg/tests/e2e/upgrade.rs b/contracts/governance/tests/e2e/upgrade.rs similarity index 100% rename from contracts/nqg/tests/e2e/upgrade.rs rename to contracts/governance/tests/e2e/upgrade.rs diff --git a/contracts/nqg/tests/e2e/voting.rs b/contracts/governance/tests/e2e/voting.rs similarity index 98% rename from contracts/nqg/tests/e2e/voting.rs rename to contracts/governance/tests/e2e/voting.rs index 11c828f..5036b6e 100644 --- a/contracts/nqg/tests/e2e/voting.rs +++ b/contracts/governance/tests/e2e/voting.rs @@ -1,7 +1,7 @@ use soroban_sdk::{vec, Env, Map, String, Vec, I256}; -use offchain::types::{Vote, VotingSystemError}; -use offchain::{LayerAggregator, DECIMALS}; +use governance::types::{Vote, VotingSystemError}; +use governance::{LayerAggregator, DECIMALS}; use crate::e2e::common::contract_utils::deploy_contract; diff --git a/contracts/nqg/tests/main.rs b/contracts/governance/tests/main.rs similarity index 100% rename from contracts/nqg/tests/main.rs rename to contracts/governance/tests/main.rs