Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/1.0' into elmato/merge-b…
Browse files Browse the repository at this point in the history
…ump_1_0_2-to-main
elmato committed Jun 27, 2024
2 parents d484aa1 + 64e1c32 commit cdcf60d
Showing 5 changed files with 12 additions and 8 deletions.
6 changes: 1 addition & 5 deletions include/evm_runtime/types.hpp
Original file line number Diff line number Diff line change
@@ -16,11 +16,7 @@ namespace evm_runtime {
static constexpr uint64_t gas_sset_min = 2900;
static constexpr uint64_t grace_period_seconds = 180;

constexpr uint64_t pow10_const(int v) {
uint64_t r = 1;
while (v-- > 0) r *= 10;
return r;
}
uint64_t pow10_const(int v);

constexpr unsigned evm_precision = 18;
constexpr eosio::name default_token_account = "eosio.token"_n;
3 changes: 2 additions & 1 deletion src/config_wrapper.cpp
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ const eosio::asset& config_wrapper::get_ingress_bridge_fee()const {
}

void config_wrapper::set_ingress_bridge_fee(const eosio::asset& ingress_bridge_fee) {
eosio::check(evm_precision >= ingress_bridge_fee.symbol.precision(), "invalid ingress fee precision");
_cached_config.ingress_bridge_fee = ingress_bridge_fee;
set_dirty();
}
@@ -212,7 +213,7 @@ void config_wrapper::set_fee_parameters(const fee_parameters& fee_params,
}
eosio::check(fee_params.ingress_bridge_fee->amount >= 0, "ingress bridge fee cannot be negative");

_cached_config.ingress_bridge_fee = *fee_params.ingress_bridge_fee;
set_ingress_bridge_fee(*fee_params.ingress_bridge_fee);
} else {
eosio::check(allow_any_to_be_unspecified, "All required fee parameters not specified: missing ingress_bridge_fee");
}
7 changes: 7 additions & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
@@ -61,4 +61,11 @@ uint256 to_uint256(const bytes& value) {
return intx::be::load<uint256>(tmp);
}

uint64_t pow10_const(int v) {
eosio::check(v >= 0, "invalid exponent");
uint64_t r = 1;
while (v-- > 0) r *= 10;
return r;
}

} // namespace silkworm
2 changes: 1 addition & 1 deletion tests/version_tests.cpp
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ BOOST_FIXTURE_TEST_CASE(set_version, version_tester) try {
eosio_assert_message_exception,
eosio_assert_message_is("new version must be greater than the active one"));

BOOST_REQUIRE_EXCEPTION(setversion(2, evm_account_name),
BOOST_REQUIRE_EXCEPTION(setversion(3, evm_account_name),
eosio_assert_message_exception,
eosio_assert_message_is("Unsupported version"));

0 comments on commit cdcf60d

Please sign in to comment.