diff --git a/libethereum/Precompiled.cpp b/libethereum/Precompiled.cpp index 9bc432a45..aecc33209 100644 --- a/libethereum/Precompiled.cpp +++ b/libethereum/Precompiled.cpp @@ -687,7 +687,8 @@ ETH_REGISTER_PRECOMPILED( logTextMessage )( bytesConstRef _in ) { return { false, response }; // 1st false - means bad error occur } -static const std::list< std::string > g_listReadableConfigParts{ "skaleConfig.sChain.nodes." }; +static const std::list< std::string > g_listReadableConfigParts{ "skaleConfig.sChain.nodes.", + "skaleConfig.nodeInfo.wallets.ima.n" }; static bool stat_is_accessible_json_path( const std::string& strPath ) { if ( strPath.empty() ) @@ -935,7 +936,7 @@ ETH_REGISTER_PRECOMPILED( getConfigVariableString )( bytesConstRef _in ) { strValue = skutils::tools::trim_copy( joValue.is_string() ? joValue.get< std::string >() : joValue.dump() ); } - bytes response = dev::asBytes( strValue ); + bytes response = dev::fromHex( strValue ); return { true, response }; } catch ( std::exception& ex ) { std::string strError = ex.what(); diff --git a/test/unittests/libethereum/PrecompiledTest.cpp b/test/unittests/libethereum/PrecompiledTest.cpp index cc1638d26..2ccea50d1 100644 --- a/test/unittests/libethereum/PrecompiledTest.cpp +++ b/test/unittests/libethereum/PrecompiledTest.cpp @@ -1634,7 +1634,7 @@ static std::string const genesisInfoSkaleConfigTest = std::string() + "30": [ 13, 30, - "0x6180cde2cbbcc6b6a17efec4503a7d4316f8612f411ee171587089f770335f484003ad236c534b9afa82befc1f69533723abdb6ec2601e582b72dcfd7919338b", + "0x6180cde2cbbcc6b6a17efec4503a7d4316f8612f411ee171587089f770335f484003ad236c534b9afa82befc1f69533723abdb6ec2601e582b72dcfd7919338b" ] }, "finish_ts": null, @@ -1650,7 +1650,7 @@ static std::string const genesisInfoSkaleConfigTest = std::string() + "26": [ 3, 26, - "0x3a581d62b12232dade30c3710215a271984841657449d1f474295a13737b778266f57e298f123ae80cbab7cc35ead1b62a387556f94b326d5c65d4a7aa2abcba", + "0x3a581d62b12232dade30c3710215a271984841657449d1f474295a13737b778266f57e298f123ae80cbab7cc35ead1b62a387556f94b326d5c65d4a7aa2abcba" ] }, "finish_ts": 4294967290, @@ -1731,7 +1731,8 @@ BOOST_AUTO_TEST_CASE( getConfigVariable ) { BOOST_REQUIRE( dev::fromBigEndian( res.second ) == 13 ); input = stringToHex( "skaleConfig.sChain.nodes.0.publicKey" ); - in = fromHex( numberToHex( 32 ) + input ); + input = input.substr(0, 72); // remove 0s in the end + in = fromHex( numberToHex( 36 ) + input ); res = exec( bytesConstRef( in.data(), in.size() ) ); BOOST_REQUIRE( !res.first ); @@ -1746,7 +1747,8 @@ BOOST_AUTO_TEST_CASE( getConfigVariable ) { exec = PrecompiledRegistrar::executor( "getConfigVariableString" ); input = stringToHex( "skaleConfig.sChain.nodes.0.publicKey" ); - in = fromHex( numberToHex( 32 ) + input ); + input = input.substr(0, 72); // remove 0s in the end + in = fromHex( numberToHex( 36 ) + input ); res = exec( bytesConstRef( in.data(), in.size() ) ); BOOST_REQUIRE( res.first );