Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

fix tests in forced-replay branch; use updated bios contract #7143

Merged
merged 3 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion libraries/testing/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ namespace eosio { namespace testing {

void base_tester::preactivate_protocol_features(const vector<digest_type> feature_digests) {
for( const auto& feature_digest: feature_digests ) {
push_action( config::system_account_name, N(preactivate), config::system_account_name,
push_action( config::system_account_name, N(activate), config::system_account_name,
fc::mutable_variant_object()("feature_digest", feature_digest) );
}
}
Expand Down
2 changes: 1 addition & 1 deletion testnet.template
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ecmd set contract eosio $bioscontractpath eosio.bios.wasm eosio.bios.abi
# Preactivate all digests
for digest in $FEATURE_DIGESTS;
do
ecmd push action eosio preactivate "{\"feature_digest\":\"$digest\"}" -p eosio
ecmd push action eosio activate "{\"feature_digest\":\"$digest\"}" -p eosio
done

# Create required system accounts
Expand Down
4 changes: 2 additions & 2 deletions tests/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ def bootstrap(self, biosNode, totalNodes, prodCount, totalProducers, pfSetupPoli
contract=eosioTokenAccount.name
Utils.Print("push create action to %s contract" % (contract))
action="create"
data="{\"issuer\":\"%s\",\"maximum_supply\":\"1000000000.0000 %s\",\"can_freeze\":\"0\",\"can_recall\":\"0\",\"can_whitelist\":\"0\"}" % (eosioTokenAccount.name, CORE_SYMBOL)
data="{\"issuer\":\"%s\",\"maximum_supply\":\"1000000000.0000 %s\"}" % (eosioAccount.name, CORE_SYMBOL)
opts="--permission %s@active" % (contract)
trans=biosNode.pushMessage(contract, action, data, opts)
if trans is None or not trans[0]:
Expand All @@ -1229,7 +1229,7 @@ def bootstrap(self, biosNode, totalNodes, prodCount, totalProducers, pfSetupPoli
Utils.Print("push issue action to %s contract" % (contract))
action="issue"
data="{\"to\":\"%s\",\"quantity\":\"1000000000.0000 %s\",\"memo\":\"initial issue\"}" % (eosioAccount.name, CORE_SYMBOL)
opts="--permission %s@active" % (contract)
opts="--permission %s@active" % (eosioAccount.name)
trans=biosNode.pushMessage(contract, action, data, opts)
if trans is None or not trans[0]:
Utils.Print("ERROR: Failed to push issue action to eosio contract.")
Expand Down
4 changes: 2 additions & 2 deletions tests/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,10 +1539,10 @@ def getAllBuiltinFeatureDigestsToPreactivate(self):
# Require PREACTIVATE_FEATURE to be activated and require eosio.bios with preactivate_feature
def preactivateProtocolFeatures(self, featureDigests:list):
for digest in featureDigests:
Utils.Print("push preactivate action with digest {}".format(digest))
Utils.Print("push activate action with digest {}".format(digest))
data="{{\"feature_digest\":{}}}".format(digest)
opts="--permission eosio@active"
trans=self.pushMessage("eosio", "preactivate", data, opts)
trans=self.pushMessage("eosio", "activate", data, opts)
if trans is None or not trans[0]:
Utils.Print("ERROR: Failed to preactive digest {}".format(digest))
return None
Expand Down
30 changes: 15 additions & 15 deletions unittests/contracts/eosio.bios/eosio.bios.abi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
}
]
},
{
"name": "activate",
"base": "",
"fields": [
{
"name": "feature_digest",
"type": "checksum256"
}
]
},
{
"name": "authority",
"base": "",
Expand Down Expand Up @@ -241,16 +251,6 @@
}
]
},
{
"name": "preactivate",
"base": "",
"fields": [
{
"name": "feature_digest",
"type": "checksum256"
}
]
},
{
"name": "producer_key",
"base": "",
Expand Down Expand Up @@ -451,6 +451,11 @@
}
],
"actions": [
{
"name": "activate",
"type": "activate",
"ricardian_contract": ""
},
{
"name": "canceldelay",
"type": "canceldelay",
Expand All @@ -476,11 +481,6 @@
"type": "onerror",
"ricardian_contract": ""
},
{
"name": "preactivate",
"type": "preactivate",
"ricardian_contract": ""
},
{
"name": "reqactivated",
"type": "reqactivated",
Expand Down
Binary file modified unittests/contracts/eosio.bios/eosio.bios.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions unittests/protocol_feature_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE( double_preactivation ) try {
auto d = pfm.get_builtin_digest( builtin_protocol_feature_t::only_link_to_existing_permission );
BOOST_REQUIRE( d );

c.push_action( config::system_account_name, N(preactivate), config::system_account_name,
c.push_action( config::system_account_name, N(activate), config::system_account_name,
fc::mutable_variant_object()("feature_digest", *d), 10 );

std::string expected_error_msg("protocol feature with digest '");
Expand All @@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE( double_preactivation ) try {
expected_error_msg += "' is already pre-activated";
}

BOOST_CHECK_EXCEPTION( c.push_action( config::system_account_name, N(preactivate), config::system_account_name,
BOOST_CHECK_EXCEPTION( c.push_action( config::system_account_name, N(activate), config::system_account_name,
fc::mutable_variant_object()("feature_digest", *d), 20 ),
protocol_feature_exception,
fc_exception_message_is( expected_error_msg )
Expand Down