From b69b408df6f1f8e11df0f920c62e9eab0ad52725 Mon Sep 17 00:00:00 2001 From: Yaro Shkvorets Date: Sat, 11 Feb 2023 15:58:17 -0500 Subject: [PATCH 1/2] Fix division operator error --- libraries/eosiolib/core/eosio/asset.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/eosiolib/core/eosio/asset.hpp b/libraries/eosiolib/core/eosio/asset.hpp index 8ffd57704d..72e7780e97 100644 --- a/libraries/eosiolib/core/eosio/asset.hpp +++ b/libraries/eosiolib/core/eosio/asset.hpp @@ -231,7 +231,7 @@ namespace eosio { */ friend int64_t operator/( const asset& a, const asset& b ) { eosio::check( b.amount != 0, "divide by zero" ); - eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( a.symbol == b.symbol, "attempt to divide assets with different symbol" ); return a.amount / b.amount; } From 12c33d23fe649ee91ed0011111e06b29d088980e Mon Sep 17 00:00:00 2001 From: YaroShkvorets Date: Sun, 12 Feb 2023 00:28:38 -0500 Subject: [PATCH 2/2] fix test --- tests/unit/asset_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/asset_tests.cpp b/tests/unit/asset_tests.cpp index e52515ca48..f4f74dd65e 100644 --- a/tests/unit/asset_tests.cpp +++ b/tests/unit/asset_tests.cpp @@ -312,7 +312,7 @@ EOSIO_TEST_BEGIN(asset_type_test) }) ) - CHECK_ASSERT( "comparison of assets with different symbols is not allowed", ( + CHECK_ASSERT( "attempt to divide assets with different symbol", ( [&]() { asset{1LL, s0} / asset{1LL, s1}; })