Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare v3.0.8 #168

Merged
merged 29 commits into from
Jun 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9509dd7
check llvm version >= 7 and install automatically
Thaipanda May 1, 2020
748c377
Merge pull request #21 from boscore/release/3.0.x
Frank-AFN May 2, 2020
c9e6641
Remove bytes in flight
Frank-AFN May 5, 2020
7af85d4
Merge pull request #161 from eosiosg/getinfobusyfix
Thaipanda May 6, 2020
a7e2158
Upgrade: name apply context transaction context and plugins
Frank-AFN May 11, 2020
c8c27f4
FIX: unittests
Frank-AFN May 11, 2020
07e60de
fix a potential crash in fetching lib.
May 13, 2020
e7056d2
emit lib in ascending order.
May 13, 2020
e1cf1f3
Merge pull request #162 from boscore/fix-emit-lib
Frank-AFN May 19, 2020
9e01179
fix a potential crash in fetching lib.
May 13, 2020
483b9ea
emit lib in ascending order.
May 13, 2020
6f51cc1
Change abi-serializer-max-time-us to abi-serializer-max-time-ms
Frank-AFN May 19, 2020
931235f
Fix: TODO
Frank-AFN May 20, 2020
e757b8a
Fix: mongodb plugin
Frank-AFN May 20, 2020
5366d8a
Fix: cleos name issue
Frank-AFN May 20, 2020
982cf82
Fix: tests
Frank-AFN May 20, 2020
20c3c17
Add back get block detail in history plugin
Frank-AFN May 20, 2020
03e03c5
Merge pull request #163 from eosiosg/statehistoryplugin
Thaipanda May 27, 2020
d33bb6c
update connected lib channels of plugins
May 27, 2020
1e7fb89
Fix: state history plugin issues
Frank-AFN Jun 3, 2020
7d432d0
Merge pull request #164 from eosiosg/statehistoryplugin
Thaipanda Jun 3, 2020
58ff806
Change: applied transaction channel for statehistory plugin
Frank-AFN Jun 5, 2020
6f91e2c
fix: exclude invalid cert; shuffle view changes before generation; ad…
Jun 5, 2020
ecc2fb6
Merge pull request #166 from boscore/fix-cert-generation
Thaipanda Jun 6, 2020
68ca592
Merge pull request #165 from boscore/plugins-update-lib-channel
Thaipanda Jun 6, 2020
7d5a128
Fix: state history get block from forkdb null
Frank-AFN Jun 6, 2020
064a989
reset docker file
Frank-AFN Jun 6, 2020
dc3b8e4
Merge pull request #167 from eosiosg/statehistoryplugin
Thaipanda Jun 6, 2020
353d311
prepare v3.0.8
Thaipanda Jun 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: unittests
Frank-AFN committed May 11, 2020
commit c8c27f40a77eb2598c1aae25a3e9c9468699118e
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -249,8 +249,8 @@ add_subdirectory( libraries )
add_subdirectory( plugins )
add_subdirectory( programs )
add_subdirectory( scripts )
#add_subdirectory( unittests )
#add_subdirectory( tests )
add_subdirectory( unittests )
add_subdirectory( tests )
add_subdirectory( tools )
add_subdirectory( debian )

2 changes: 1 addition & 1 deletion libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ add_subdirectory( chainbase )
add_subdirectory( wasm-jit )
add_subdirectory( appbase )
add_subdirectory( chain )
#add_subdirectory( testing )
add_subdirectory( testing )

#turn tools&tests off; not needed for library build
set(BUILD_TESTS OFF CACHE BOOL "Build GTest-based tests")
3 changes: 2 additions & 1 deletion libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
@@ -329,7 +329,8 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a
bool enforce_actor_whitelist_blacklist = trx_context.enforce_whiteblacklist && control.is_producing_block()
&& !control.sender_avoids_whitelist_blacklist_enforcement( receiver );
trx_context.validate_referenced_accounts( trx, enforce_actor_whitelist_blacklist );

trx.expiration = control.pending_block_time() + fc::microseconds(999'999); // Rounds up to nearest second (makes expiration check unnecessary)
trx.set_reference_block(control.head_block_id()); // No TaPoS check necessary
// Charge ahead of time for the additional net usage needed to retire the deferred transaction
// whether that be by successfully executing, soft failure, hard failure, or expiration.
const auto& cfg = control.get_global_properties().configuration;
8 changes: 4 additions & 4 deletions libraries/testing/include/eosio/testing/tester.hpp
Original file line number Diff line number Diff line change
@@ -157,8 +157,8 @@ namespace eosio { namespace testing {
vector<producer_key> get_producer_keys( const vector<account_name>& producer_names )const;
transaction_trace_ptr set_producers(const vector<account_name>& producer_names);

void link_authority( account_name account, account_name code, permission_name req, action_name type = "" );
void unlink_authority( account_name account, account_name code, action_name type = "" );
void link_authority( account_name account, account_name code, permission_name req, action_name type = {} );
void unlink_authority( account_name account, account_name code, action_name type = {} );
void set_authority( account_name account, permission_name perm, authority auth,
permission_name parent, const vector<permission_level>& auths, const vector<private_key_type>& keys );
void set_authority( account_name account, permission_name perm, authority auth,
@@ -197,7 +197,7 @@ namespace eosio { namespace testing {

template< typename KeyType = fc::ecc::private_key_shim >
static private_key_type get_private_key( name keyname, string role = "owner" ) {
return private_key_type::regenerate<KeyType>(fc::sha256::hash(string(keyname)+role));
return private_key_type::regenerate<KeyType>(fc::sha256::hash(keyname.to_string()+role));
}

template< typename KeyType = fc::ecc::private_key_shim >
@@ -216,7 +216,7 @@ namespace eosio { namespace testing {
const symbol& asset_symbol,
const account_name& account ) const;

vector<char> get_row_by_account( uint64_t code, uint64_t scope, uint64_t table, const account_name& act ) const;
vector<char> get_row_by_account( name code, name scope, name table, const account_name& act ) const;

map<account_name, block_id_type> get_last_produced_block_map()const { return last_produced_block; };
void set_last_produced_block_map( const map<account_name, block_id_type>& lpb ) { last_produced_block = lpb; }
10 changes: 5 additions & 5 deletions libraries/testing/tester.cpp
Original file line number Diff line number Diff line change
@@ -382,12 +382,12 @@ namespace eosio { namespace testing {
typename base_tester::action_result base_tester::push_action(action&& act, uint64_t authorizer) {
signed_transaction trx;
if (authorizer) {
act.authorization = vector<permission_level>{{authorizer, config::active_name}};
act.authorization = vector<permission_level>{{account_name(authorizer), config::active_name}};
}
trx.actions.emplace_back(std::move(act));
set_transaction_headers(trx);
if (authorizer) {
trx.sign(get_private_key(authorizer, "active"), control->get_chain_id());
trx.sign(get_private_key(account_name(authorizer), "active"), control->get_chain_id());
}
try {
push_transaction(trx);
@@ -755,7 +755,7 @@ namespace eosio { namespace testing {
}


vector<char> base_tester::get_row_by_account( uint64_t code, uint64_t scope, uint64_t table, const account_name& act ) const {
vector<char> base_tester::get_row_by_account( name code, name scope, name table, const account_name& act ) const {
vector<char> data;
const auto& db = control->db();
const auto* t_id = db.find<chain::table_id_object, chain::by_code_scope_table>( boost::make_tuple( code, scope, table ) );
@@ -766,8 +766,8 @@ namespace eosio { namespace testing {

const auto& idx = db.get_index<chain::key_value_index, chain::by_scope_primary>();

auto itr = idx.lower_bound( boost::make_tuple( t_id->id, act ) );
if ( itr == idx.end() || itr->t_id != t_id->id || act.value != itr->primary_key ) {
auto itr = idx.lower_bound( boost::make_tuple( t_id->id, act.to_uint64_t() ) );
if ( itr == idx.end() || itr->t_id != t_id->id || act.to_uint64_t() != itr->primary_key ) {
return data;
}

96 changes: 48 additions & 48 deletions unittests/abi_tests.cpp
Original file line number Diff line number Diff line change
@@ -818,10 +818,10 @@ BOOST_AUTO_TEST_CASE(linkauth_test)
auto var = fc::json::from_string(test_data);

auto lauth = var.as<linkauth>();
BOOST_TEST("lnkauth.acct" == lauth.account);
BOOST_TEST("lnkauth.code" == lauth.code);
BOOST_TEST("lnkauth.type" == lauth.type);
BOOST_TEST("lnkauth.rqm" == lauth.requirement);
BOOST_TEST(name("lnkauth.acct") == lauth.account);
BOOST_TEST(name("lnkauth.code") == lauth.code);
BOOST_TEST(name("lnkauth.type") == lauth.type);
BOOST_TEST(name("lnkauth.rqm") == lauth.requirement);

auto var2 = verify_byte_round_trip_conversion( abis, "linkauth", var );
auto linkauth2 = var2.as<linkauth>();
@@ -851,9 +851,9 @@ BOOST_AUTO_TEST_CASE(unlinkauth_test)
auto var = fc::json::from_string(test_data);

auto unlauth = var.as<unlinkauth>();
BOOST_TEST("lnkauth.acct" == unlauth.account);
BOOST_TEST("lnkauth.code" == unlauth.code);
BOOST_TEST("lnkauth.type" == unlauth.type);
BOOST_TEST(name("lnkauth.acct") == unlauth.account);
BOOST_TEST(name("lnkauth.code") == unlauth.code);
BOOST_TEST(name("lnkauth.type") == unlauth.type);

auto var2 = verify_byte_round_trip_conversion( abis, "unlinkauth", var );
auto unlinkauth2 = var2.as<unlinkauth>();
@@ -890,9 +890,9 @@ BOOST_AUTO_TEST_CASE(updateauth_test)
auto var = fc::json::from_string(test_data);

auto updauth = var.as<updateauth>();
BOOST_TEST("updauth.acct" == updauth.account);
BOOST_TEST("updauth.prm" == updauth.permission);
BOOST_TEST("updauth.prnt" == updauth.parent);
BOOST_TEST(name("updauth.acct") == updauth.account);
BOOST_TEST(name("updauth.prm") == updauth.permission);
BOOST_TEST(name("updauth.prnt") == updauth.parent);
BOOST_TEST(2147483145u == updauth.auth.threshold);

BOOST_TEST_REQUIRE(2 == updauth.auth.keys.size());
@@ -901,12 +901,12 @@ BOOST_AUTO_TEST_CASE(updateauth_test)
BOOST_TEST("EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)updauth.auth.keys[1].key);
BOOST_TEST(57605u == updauth.auth.keys[1].weight);

BOOST_TEST_REQUIRE(2 == updauth.auth.accounts.size());
BOOST_TEST("prm.acct1" == updauth.auth.accounts[0].permission.actor);
BOOST_TEST("prm.prm1" == updauth.auth.accounts[0].permission.permission);
BOOST_TEST_REQUIRE(2u == updauth.auth.accounts.size());
BOOST_TEST(name("prm.acct1") == updauth.auth.accounts[0].permission.actor);
BOOST_TEST(name("prm.prm1") == updauth.auth.accounts[0].permission.permission);
BOOST_TEST(53005u == updauth.auth.accounts[0].weight);
BOOST_TEST("prm.acct2" == updauth.auth.accounts[1].permission.actor);
BOOST_TEST("prm.prm2" == updauth.auth.accounts[1].permission.permission);
BOOST_TEST(name("prm.acct2") == updauth.auth.accounts[1].permission.actor);
BOOST_TEST(name("prm.prm2") == updauth.auth.accounts[1].permission.permission);
BOOST_TEST(53405u == updauth.auth.accounts[1].weight);

auto var2 = verify_byte_round_trip_conversion( abis, "updateauth", var );
@@ -951,8 +951,8 @@ BOOST_AUTO_TEST_CASE(deleteauth_test)
auto var = fc::json::from_string(test_data);

auto delauth = var.as<deleteauth>();
BOOST_TEST("delauth.acct" == delauth.account);
BOOST_TEST("delauth.prm" == delauth.permission);
BOOST_TEST(name("delauth.acct") == delauth.account);
BOOST_TEST(name("delauth.prm") == delauth.permission);

auto var2 = verify_byte_round_trip_conversion( abis, "deleteauth", var );
auto deleteauth2 = var2.as<deleteauth>();
@@ -994,39 +994,39 @@ BOOST_AUTO_TEST_CASE(newaccount_test)
auto var = fc::json::from_string(test_data);

auto newacct = var.as<newaccount>();
BOOST_TEST("newacct.crtr" == newacct.creator);
BOOST_TEST("newacct.name" == newacct.name);
BOOST_TEST(name("newacct.crtr") == newacct.creator);
BOOST_TEST(name("newacct.name") == newacct.name);

BOOST_TEST(2147483145u == newacct.owner.threshold);

BOOST_TEST_REQUIRE(2 == newacct.owner.keys.size());
BOOST_TEST_REQUIRE(2u == newacct.owner.keys.size());
BOOST_TEST("EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (std::string)newacct.owner.keys[0].key);
BOOST_TEST(57005u == newacct.owner.keys[0].weight);
BOOST_TEST("EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)newacct.owner.keys[1].key);
BOOST_TEST(57605u == newacct.owner.keys[1].weight);

BOOST_TEST_REQUIRE(2 == newacct.owner.accounts.size());
BOOST_TEST("prm.acct1" == newacct.owner.accounts[0].permission.actor);
BOOST_TEST("prm.prm1" == newacct.owner.accounts[0].permission.permission);
BOOST_TEST_REQUIRE(2u == newacct.owner.accounts.size());
BOOST_TEST(name("prm.acct1") == newacct.owner.accounts[0].permission.actor);
BOOST_TEST(name("prm.prm1") == newacct.owner.accounts[0].permission.permission);
BOOST_TEST(53005u == newacct.owner.accounts[0].weight);
BOOST_TEST("prm.acct2" == newacct.owner.accounts[1].permission.actor);
BOOST_TEST("prm.prm2" == newacct.owner.accounts[1].permission.permission);
BOOST_TEST(name("prm.acct2") == newacct.owner.accounts[1].permission.actor);
BOOST_TEST(name("prm.prm2") == newacct.owner.accounts[1].permission.permission);
BOOST_TEST(53405u == newacct.owner.accounts[1].weight);

BOOST_TEST(2146483145u == newacct.active.threshold);

BOOST_TEST_REQUIRE(2 == newacct.active.keys.size());
BOOST_TEST_REQUIRE(2u == newacct.active.keys.size());
BOOST_TEST("EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (std::string)newacct.active.keys[0].key);
BOOST_TEST(57005u == newacct.active.keys[0].weight);
BOOST_TEST("EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)newacct.active.keys[1].key);
BOOST_TEST(57605u == newacct.active.keys[1].weight);

BOOST_TEST_REQUIRE(2 == newacct.active.accounts.size());
BOOST_TEST("prm.acct1" == newacct.active.accounts[0].permission.actor);
BOOST_TEST("prm.prm1" == newacct.active.accounts[0].permission.permission);
BOOST_TEST_REQUIRE(2u == newacct.active.accounts.size());
BOOST_TEST(name("prm.acct1") == newacct.active.accounts[0].permission.actor);
BOOST_TEST(name("prm.prm1") == newacct.active.accounts[0].permission.permission);
BOOST_TEST(53005u == newacct.active.accounts[0].weight);
BOOST_TEST("prm.acct2" == newacct.active.accounts[1].permission.actor);
BOOST_TEST("prm.prm2" == newacct.active.accounts[1].permission.permission);
BOOST_TEST(name("prm.acct2") == newacct.active.accounts[1].permission.actor);
BOOST_TEST(name("prm.prm2") == newacct.active.accounts[1].permission.permission);
BOOST_TEST(53405u == newacct.active.accounts[1].weight);


@@ -1090,7 +1090,7 @@ BOOST_AUTO_TEST_CASE(setcode_test)
auto var = fc::json::from_string(test_data);

auto set_code = var.as<setcode>();
BOOST_TEST("setcode.acc" == set_code.account);
BOOST_TEST(name("setcode.acc") == set_code.account);
BOOST_TEST(0 == set_code.vmtype);
BOOST_TEST(0 == set_code.vmversion);
BOOST_TEST("0061736d0100000001390a60037e7e7f017f60047e7e7f7f017f60017e0060057e7e7e7f7f" == fc::to_hex(set_code.code.data(), set_code.code.size()));
@@ -1303,22 +1303,22 @@ BOOST_AUTO_TEST_CASE(setabi_test)
auto var = fc::json::from_string(abi_string);
auto abi = var.as<abi_def>();

BOOST_TEST_REQUIRE(1 == abi.types.size());
BOOST_TEST_REQUIRE(1u == abi.types.size());

BOOST_TEST("account_name" == abi.types[0].new_type_name);
BOOST_TEST("name" == abi.types[0].type);

BOOST_TEST_REQUIRE(3 == abi.structs.size());
BOOST_TEST_REQUIRE(3u == abi.structs.size());

BOOST_TEST("transfer_base" == abi.structs[0].name);
BOOST_TEST("" == abi.structs[0].base);
BOOST_TEST_REQUIRE(1 == abi.structs[0].fields.size());
BOOST_TEST_REQUIRE(1u == abi.structs[0].fields.size());
BOOST_TEST("memo" == abi.structs[0].fields[0].name);
BOOST_TEST("string" == abi.structs[0].fields[0].type);

BOOST_TEST("transfer" == abi.structs[1].name);
BOOST_TEST("transfer_base" == abi.structs[1].base);
BOOST_TEST_REQUIRE(3 == abi.structs[1].fields.size());
BOOST_TEST_REQUIRE(3u == abi.structs[1].fields.size());
BOOST_TEST("from" == abi.structs[1].fields[0].name);
BOOST_TEST("account_name" == abi.structs[1].fields[0].type);
BOOST_TEST("to" == abi.structs[1].fields[1].name);
@@ -1328,23 +1328,23 @@ BOOST_AUTO_TEST_CASE(setabi_test)

BOOST_TEST("account" == abi.structs[2].name);
BOOST_TEST("" == abi.structs[2].base);
BOOST_TEST_REQUIRE(2 == abi.structs[2].fields.size());
BOOST_TEST_REQUIRE(2u == abi.structs[2].fields.size());
BOOST_TEST("account" == abi.structs[2].fields[0].name);
BOOST_TEST("name" == abi.structs[2].fields[0].type);
BOOST_TEST("balance" == abi.structs[2].fields[1].name);
BOOST_TEST("uint64" == abi.structs[2].fields[1].type);

BOOST_TEST_REQUIRE(1 == abi.actions.size());
BOOST_TEST("transfer" == abi.actions[0].name);
BOOST_TEST_REQUIRE(1u == abi.actions.size());
BOOST_TEST(name("transfer") == abi.actions[0].name);
BOOST_TEST("transfer" == abi.actions[0].type);

BOOST_TEST_REQUIRE(1 == abi.tables.size());
BOOST_TEST("account" == abi.tables[0].name);
BOOST_TEST_REQUIRE(1u == abi.tables.size());
BOOST_TEST(name("account") == abi.tables[0].name);
BOOST_TEST("account" == abi.tables[0].type);
BOOST_TEST("i64" == abi.tables[0].index_type);
BOOST_TEST_REQUIRE(1 == abi.tables[0].key_names.size());
BOOST_TEST_REQUIRE(1u == abi.tables[0].key_names.size());
BOOST_TEST("account" == abi.tables[0].key_names[0]);
BOOST_TEST_REQUIRE(1 == abi.tables[0].key_types.size());
BOOST_TEST_REQUIRE(1u == abi.tables[0].key_types.size());
BOOST_TEST("name" == abi.tables[0].key_types[0]);

auto var2 = verify_byte_round_trip_conversion( abis, "abi_def", var );
@@ -1446,20 +1446,20 @@ struct action2 {
template<typename T>
void verify_action_equal(const chain::action& exp, const chain::action& act)
{
BOOST_REQUIRE_EQUAL((std::string)exp.account, (std::string)act.account);
BOOST_REQUIRE_EQUAL((std::string)exp.name, (std::string)act.name);
BOOST_REQUIRE_EQUAL(exp.account.to_string(), act.account.to_string());
BOOST_REQUIRE_EQUAL(exp.name.to_string(), act.name.to_string());
BOOST_REQUIRE_EQUAL(exp.authorization.size(), act.authorization.size());
for(unsigned int i = 0; i < exp.authorization.size(); ++i)
{
BOOST_REQUIRE_EQUAL((std::string)exp.authorization[i].actor, (std::string)act.authorization[i].actor);
BOOST_REQUIRE_EQUAL((std::string)exp.authorization[i].permission, (std::string)act.authorization[i].permission);
BOOST_REQUIRE_EQUAL(exp.authorization[i].actor.to_string(), act.authorization[i].actor.to_string());
BOOST_REQUIRE_EQUAL(exp.authorization[i].permission.to_string(), act.authorization[i].permission.to_string());
}
BOOST_REQUIRE_EQUAL(exp.data.size(), act.data.size());
BOOST_REQUIRE(!memcmp(exp.data.data(), act.data.data(), exp.data.size()));
}

private_key_type get_private_key( name keyname, string role ) {
return private_key_type::regenerate<fc::ecc::private_key_shim>(fc::sha256::hash(string(keyname)+role));
return private_key_type::regenerate<fc::ecc::private_key_shim>(fc::sha256::hash(keyname.to_string()+role));
}

public_key_type get_public_key( name keyname, string role ) {
Loading