Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 162ae63

Browse files
committed
Add test namespace #36
1 parent f07e93b commit 162ae63

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/nil/blueprint/transpiler/evm_verifier_gen.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace nil {
223223
/* Using special powX function is only feasible for powers >= 4 */
224224
if ( _optimize_powers && ((power = term_is_power(*term)) >= 4) ) {
225225
_term_powers.insert(power);
226-
result << "\t\tprod = utils.pow" << power << "(basic_marshalling.get_uint256_be(blob, " << _var_indices.at(vars[0]) * 0x20 << "));" << std::endl;
226+
result << "\t\tprod = modular_utils_" << _test_name << ".pow" << power << "(basic_marshalling.get_uint256_be(blob, " << _var_indices.at(vars[0]) * 0x20 << "));" << std::endl;
227227
} else {
228228
for (auto var = std::cbegin(vars); var != std::cend(vars); ++var) {
229229
if (var == std::cbegin(vars)) {
@@ -551,6 +551,7 @@ namespace nil {
551551
std::string utils_library(utils_library_template);
552552
boost::replace_all(utils_library, "$MODULUS$", to_string(PlaceholderParams::field_type::modulus));
553553
boost::replace_all(utils_library, "$POWER_FUNCTIONS$", power_functions.str());
554+
boost::replace_all(utils_library, "$TEST_NAME$", _test_name);
554555
std::ofstream utils;
555556
utils.open(_folder_name + "/utils.sol");
556557
utils << utils_library;

include/nil/blueprint/transpiler/templates/utils_template.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pragma solidity >=0.8.4;
2626
2727
import "hardhat/console.sol";
2828
29-
library utils {
29+
library modular_utils_$TEST_NAME$ {
3030
uint256 constant modulus = $MODULUS$;
3131
3232
$POWER_FUNCTIONS$

0 commit comments

Comments
 (0)