diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ee7e5709b..81a1fb526 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,13 +15,14 @@ jobs: - ubuntu-latest # - macos-latest toolchain: - - 1.72 + - 1.75 runs-on: ${{ matrix.platform }} steps: - name: Checkout sources uses: actions/checkout@main with: - submodules: true + submodules: false + # submodules: true // we do not need submodules, if we are not running the JSON tests. - name: Install toolchain uses: actions-rs/toolchain@v1 with: @@ -32,9 +33,12 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --locked --all --release --features "json-tests" --verbose --no-run + #args: deactivated JSON Tests, so we do not run out of quota on CI tests for merge intesive time. --locked --all --release --features "json-tests" --verbose --no-run + args: --locked --all --release --verbose --no-run - name: Run tests for ${{ matrix.platform }} uses: actions-rs/cargo@v1 with: command: test - args: --locked --all --release --features "json-tests" --verbose + #args: deactivated JSON Tests --locked --all --release --features "json-tests" --verbose + args: --locked --all --release --verbose + diff --git a/Cargo.lock b/Cargo.lock index 78d0d30fa..b10b21bc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,9 +1133,9 @@ dependencies = [ [[package]] name = "ethabi-contract" -version = "11.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d4002f1f77d8233685dafd8589efe1c9dfa63e21ca6c11134372acc7f68032" +checksum = "4632b1b766fbf59872eb7a41e7ebaa10727b7f7000aef5bb626b87e472041c83" [[package]] name = "ethabi-derive" diff --git a/crates/concensus/miner/Cargo.toml b/crates/concensus/miner/Cargo.toml index 309aa1663..f503a72e5 100644 --- a/crates/concensus/miner/Cargo.toml +++ b/crates/concensus/miner/Cargo.toml @@ -19,7 +19,7 @@ common-types = { path = "../../ethcore/types" } error-chain = "0.12" ethabi = "12.0.0" ethabi-derive = { git = 'https://github.com/rimrakhimov/ethabi', branch = 'rimrakhimov/remove-syn-export-span' } -ethabi-contract = "11.0.0" +ethabi-contract = "16.0.0" ethcore-call-contract = { path = "../../vm/call-contract" } ethereum-types = "0.9.2" futures = "0.1" diff --git a/crates/concensus/miner/src/service_transaction_checker.rs b/crates/concensus/miner/src/service_transaction_checker.rs index d4ccfc8f6..59f3d22ec 100644 --- a/crates/concensus/miner/src/service_transaction_checker.rs +++ b/crates/concensus/miner/src/service_transaction_checker.rs @@ -20,7 +20,7 @@ use call_contract::{CallContract, RegistryInfo}; use ethabi::FunctionOutputDecoder; use ethereum_types::Address; use parking_lot::RwLock; -use std::{collections::HashMap, mem, sync::Arc}; +use std::{collections::HashMap, mem, str::FromStr, sync::Arc}; use types::{ids::BlockId, transaction::SignedTransaction}; use_contract!( @@ -28,8 +28,6 @@ use_contract!( "res/contracts/service_transaction.json" ); -const SERVICE_TRANSACTION_CONTRACT_REGISTRY_NAME: &'static str = "service_transaction_checker"; - /// Service transactions checker. #[derive(Default, Clone)] pub struct ServiceTransactionChecker { @@ -67,12 +65,8 @@ impl ServiceTransactionChecker { { return Ok(*allowed); } - let contract_address = client - .registry_address( - SERVICE_TRANSACTION_CONTRACT_REGISTRY_NAME.to_owned(), - BlockId::Latest, - ) - .ok_or_else(|| "Certifier contract is not configured")?; + let x = Address::from_str("5000000000000000000000000000000000000001".into()).unwrap(); + let contract_address = x; self.call_contract(client, contract_address, sender) .and_then(|allowed| { if let Some(mut cache) = self.certified_addresses_cache.try_write() { @@ -95,21 +89,17 @@ impl ServiceTransactionChecker { HashMap::default(), ); - if let Some(contract_address) = client.registry_address( - SERVICE_TRANSACTION_CONTRACT_REGISTRY_NAME.to_owned(), - BlockId::Latest, - ) { - let addresses: Vec<_> = cache.keys().collect(); - let mut cache: HashMap
= HashMap::default(); - for address in addresses { - let allowed = self.call_contract(client, contract_address, *address)?; - cache.insert(*address, allowed); - } - *self.certified_addresses_cache.write() = cache; - Ok(true) - } else { - Ok(false) + let contract_address = + Address::from_str("5000000000000000000000000000000000000001".into()).unwrap(); + + let addresses: Vec<_> = cache.keys().collect(); + let mut cache: HashMap = HashMap::default(); + for address in addresses { + let allowed = self.call_contract(client, contract_address, *address)?; + cache.insert(*address, allowed); } + *self.certified_addresses_cache.write() = cache; + Ok(true) } fn call_contract