Commit 37b43569 authored by Bartek Wrona's avatar Bartek Wrona

STEEM and SBD rename supplement:

parent cb9c6f39
......@@ -34,6 +34,17 @@ namespace chainbase {
return *this;
}
std::string dump() const
{
std::string retVal("{'compiler':'");
retVal += compiler_version.data();
retVal += "', 'debug':" + std::to_string(debug);
retVal += ", 'apple':" + std::to_string(apple);
retVal += ", 'windows':" + std::to_string(windows) + "}";
return retVal;
}
boost::array<char,256> compiler_version;
bool debug = false;
bool apple = false;
......@@ -82,9 +93,17 @@ namespace chainbase {
}
else
{
if( !env.first || !( *env.first == environment_check()) ) {
BOOST_THROW_EXCEPTION( std::runtime_error( "database created by a different compiler, build, or operating system" ) );
environment_check eCheck;
if( !env.first || !( *env.first == eCheck) ) {
if(!env.first)
BOOST_THROW_EXCEPTION( std::runtime_error( "Unable to find environment data saved in persistent storage. Probably database created by a different compiler, build, or operating system" ) );
std::string dp = env.first->dump();
std::string dr = eCheck.dump();
BOOST_THROW_EXCEPTION(std::runtime_error("Different persistent & runtime environments. Persistent: `" + dp + "'. Runtime: `"+ dr + "'.Probably database created by a different compiler, build, or operating system"));
}
std::cout << "Compiler and build environment read from persistent stoage: `" << env.first->dump() << '\'' << std::endl;
}
} else {
_file_size = shared_file_size;
......
......@@ -43,10 +43,12 @@ uint32_t string_to_asset_num( const char* p, uint8_t decimals )
switch( name_u64 )
{
case STEEM_SYMBOL_U64:
case HIVE_SYMBOL_U64:
FC_ASSERT( decimals == 3, "Incorrect decimal places" );
asset_num = STEEM_ASSET_NUM_STEEM;
break;
case SBD_SYMBOL_U64:
case HBD_SYMBOL_U64:
FC_ASSERT( decimals == 3, "Incorrect decimal places" );
asset_num = STEEM_ASSET_NUM_SBD;
break;
......
......@@ -35,13 +35,16 @@
#define VESTS_SYMBOL_U64 (uint64_t('V') | (uint64_t('E') << 8) | (uint64_t('S') << 16) | (uint64_t('T') << 24) | (uint64_t('S') << 32))
#define STEEM_SYMBOL_U64 (uint64_t('T') | (uint64_t('E') << 8) | (uint64_t('S') << 16) | (uint64_t('T') << 24) | (uint64_t('S') << 32))
#define HIVE_SYMBOL_U64 STEEM_SYMBOL_U64
#define SBD_SYMBOL_U64 (uint64_t('T') | (uint64_t('B') << 8) | (uint64_t('D') << 16))
#define HBD_SYMBOL_U64 SBD_SYMBOL_U64
#else
#define VESTS_SYMBOL_U64 (uint64_t('V') | (uint64_t('E') << 8) | (uint64_t('S') << 16) | (uint64_t('T') << 24) | (uint64_t('S') << 32))
#define STEEM_SYMBOL_U64 (uint64_t('S') | (uint64_t('T') << 8) | (uint64_t('E') << 16) | (uint64_t('E') << 24) | (uint64_t('M') << 32))
#define HIVE_SYMBOL_U64 (uint64_t('H') | (uint64_t('I') << 8) | (uint64_t('V') << 16) | (uint64_t('E') << 24))
#define SBD_SYMBOL_U64 (uint64_t('S') | (uint64_t('B') << 8) | (uint64_t('D') << 16))
#define HBD_SYMBOL_U64 (uint64_t('H') | (uint64_t('B') << 8) | (uint64_t('D') << 16))
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment