Skip to content

Commit

Permalink
Merge branch 'master' into gsobol-reorg-test
Browse files Browse the repository at this point in the history
  • Loading branch information
grishasobol committed Jul 26, 2024
2 parents c7c4f66 + 9cdc3d0 commit 28868b7
Show file tree
Hide file tree
Showing 11 changed files with 1,015 additions and 241 deletions.
13 changes: 9 additions & 4 deletions core/src/reservation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
ids::{prelude::*, MessageId, ReservationId},
message::IncomingDispatch,
};
use alloc::collections::BTreeMap;
use alloc::{collections::BTreeMap, format};
use gear_core_errors::ReservationError;
use scale_info::{
scale::{Decode, Encode},
Expand Down Expand Up @@ -184,10 +184,15 @@ impl GasReserver {
);

if maybe_reservation.is_some() {
unreachable!(
"Duplicate reservation was created with message id {} and nonce {}",
self.message_id, self.nonce.0,
let err_msg = format!(
"GasReserver::reserve: created a duplicate reservation. \
Message id - {message_id}, nonce - {nonce}",
message_id = self.message_id,
nonce = self.nonce.0
);

log::error!("{err_msg}");
unreachable!("{err_msg}");
}

Ok(id)
Expand Down
2 changes: 1 addition & 1 deletion ethexe/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ futures-timer.workspace = true

static_init = "1.0.3"

#[dev-dependencies]
[dev-dependencies]
alloy = { workspace = true, features = [
"consensus",
"eips",
Expand Down
27 changes: 27 additions & 0 deletions ethexe/cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This file is part of Gear.
//
// Copyright (C) 2024 Gear Technologies Inc.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

pub mod args;
pub mod chain_spec;
pub mod config;
pub mod metrics;
pub mod params;
pub mod service;

#[cfg(test)]
mod tests;
18 changes: 4 additions & 14 deletions ethexe/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

mod args;
mod chain_spec;
mod config;
mod metrics;
mod params;
mod service;

#[cfg(test)]
mod tests;

use crate::{
use anyhow::Context;
use clap::Parser;
use env_logger::Env;
use ethexe_cli::{
args::{Args, ArgsOnConfig},
config::Config,
service::Service,
};
use anyhow::Context;
use clap::Parser;
use env_logger::Env;
use std::{env, fs};

#[tokio::main]
Expand Down
Loading

0 comments on commit 28868b7

Please sign in to comment.