Skip to content

Commit

Permalink
Merge pull request #337 from pmconrad/hf_385
Browse files Browse the repository at this point in the history
Adaptions for HF 385
  • Loading branch information
oxarbitrage authored Aug 13, 2017
2 parents c3de107 + d970eec commit 023c48e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
7 changes: 0 additions & 7 deletions libraries/chain/protocol/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ bool is_valid_name( const string& name )
{ try {
const size_t len = name.size();

/** this condition will prevent witnesses from including new names before this time, but
* allow them after this time. This check can be removed from the code after HARDFORK_385_TIME
* has passed.
*/
if( fc::time_point::now() < fc::time_point(HARDFORK_385_TIME) )
FC_ASSERT( len >= 3 );

if( len < GRAPHENE_MIN_ACCOUNT_NAME_LENGTH )
{
ilog( ".");
Expand Down
12 changes: 6 additions & 6 deletions tests/tests/basic_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ BOOST_FIXTURE_TEST_SUITE( basic_tests, database_fixture )
*/
BOOST_AUTO_TEST_CASE( valid_name_test )
{
BOOST_CHECK( !is_valid_name( "a" ) );
BOOST_CHECK( is_valid_name( "a" ) );
BOOST_CHECK( !is_valid_name( "A" ) );
BOOST_CHECK( !is_valid_name( "0" ) );
BOOST_CHECK( !is_valid_name( "." ) );
BOOST_CHECK( !is_valid_name( "-" ) );

BOOST_CHECK( !is_valid_name( "aa" ) );
BOOST_CHECK( is_valid_name( "aa" ) );
BOOST_CHECK( !is_valid_name( "aA" ) );
BOOST_CHECK( !is_valid_name( "a0" ) );
BOOST_CHECK( is_valid_name( "a0" ) );
BOOST_CHECK( !is_valid_name( "a." ) );
BOOST_CHECK( !is_valid_name( "a-" ) );

BOOST_CHECK( is_valid_name( "aaa" ) );
BOOST_CHECK( !is_valid_name( "aAa" ) );
BOOST_CHECK( is_valid_name( "a0a" ) );
BOOST_CHECK( !is_valid_name( "a.a" ) );
BOOST_CHECK( is_valid_name( "a.a" ) );
BOOST_CHECK( is_valid_name( "a-a" ) );

BOOST_CHECK( is_valid_name( "aa0" ) );
Expand Down Expand Up @@ -97,9 +97,9 @@ BOOST_AUTO_TEST_CASE( valid_name_test )
BOOST_CHECK( is_valid_name( "aaa.bbb.ccc" ) );

BOOST_CHECK( is_valid_name( "aaa--bbb--ccc" ) );
BOOST_CHECK( !is_valid_name( "xn--sandmnnchen-p8a.de" ) );
BOOST_CHECK( is_valid_name( "xn--sandmnnchen-p8a.de" ) );
BOOST_CHECK( is_valid_name( "xn--sandmnnchen-p8a.dex" ) );
BOOST_CHECK( !is_valid_name( "xn-sandmnnchen-p8a.de" ) );
BOOST_CHECK( is_valid_name( "xn-sandmnnchen-p8a.de" ) );
BOOST_CHECK( is_valid_name( "xn-sandmnnchen-p8a.dex" ) );

BOOST_CHECK( is_valid_name( "this-label-has-less-than-64-char.acters-63-to-be-really-precise" ) );
Expand Down
3 changes: 3 additions & 0 deletions tests/tests/uia_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ BOOST_AUTO_TEST_CASE( asset_name_test )
GRAPHENE_REQUIRE_THROW( create_user_issued_asset( "ALPHA", alice_id(db), 0 ), fc::exception );
BOOST_CHECK( has_asset("ALPHA") ); BOOST_CHECK( !has_asset("ALPHA.ONE") );

generate_blocks( HARDFORK_385_TIME );
generate_block();

// Bob can't create ALPHA.ONE
GRAPHENE_REQUIRE_THROW( create_user_issued_asset( "ALPHA.ONE", bob_id(db), 0 ), fc::exception );
BOOST_CHECK( has_asset("ALPHA") ); BOOST_CHECK( !has_asset("ALPHA.ONE") );
Expand Down

0 comments on commit 023c48e

Please sign in to comment.