Skip to content

Commit

Permalink
Merge pull request EOSIO#127 from enumivo/staging
Browse files Browse the repository at this point in the history
rename eosio
  • Loading branch information
Enumivo authored May 18, 2018
2 parents 2ce1657 + b4dae29 commit e84120c
Show file tree
Hide file tree
Showing 40 changed files with 346 additions and 346 deletions.
8 changes: 4 additions & 4 deletions contracts/enumivo.system/enumivo.system.abi
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@

]
},{
"name": "eosio_parameters",
"name": "enumivo_parameters",
"base": "blockchain_parameters",
"fields": [
{"name":"max_ram_size", "type":"uint64"}
]
},{
"name": "eosio_global_state",
"base": "eosio_parameters",
"name": "enumivo_global_state",
"base": "enumivo_parameters",
"fields": [
{"name":"total_ram_bytes_reserved", "type":"uint64"},
{"name":"total_ram_stake", "type":"int64"},
Expand Down Expand Up @@ -273,7 +273,7 @@
"key_types" : ["uint64"]
},{
"name": "global",
"type": "eosio_global_state",
"type": "enumivo_global_state",
"index_type": "i64",
"key_names" : [],
"key_types" : []
Expand Down
6 changes: 3 additions & 3 deletions contracts/enumivo.system/enumivo.system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace enumivosystem {
}
}

eosio_global_state system_contract::get_default_parameters() {
eosio_global_state dp;
enumivo_global_state system_contract::get_default_parameters() {
enumivo_global_state dp;
get_blockchain_parameters(dp);
return dp;
}
Expand All @@ -48,7 +48,7 @@ namespace enumivosystem {
system_contract::~system_contract() {
//print( "destruct system\n" );
_global.set( _gstate, _self );
//eosio_exit(0);
//enumivo_exit(0);
}

void system_contract::setram( uint64_t max_ram_size ) {
Expand Down
14 changes: 7 additions & 7 deletions contracts/enumivo.system/enumivo.system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ namespace enumivosystem {
using enumivo::const_mem_fun;
using enumivo::block_timestamp;

struct eosio_parameters : enumivo::blockchain_parameters {
struct enumivo_parameters : enumivo::blockchain_parameters {
uint64_t max_ram_size = 64ll*1024 * 1024 * 1024;

// explicit serialization macro is not necessary, used here only to improve compilation time
ENULIB_SERIALIZE_DERIVED( eosio_parameters, enumivo::blockchain_parameters, (max_ram_size) )
ENULIB_SERIALIZE_DERIVED( enumivo_parameters, enumivo::blockchain_parameters, (max_ram_size) )
};

struct eosio_global_state : eosio_parameters {
struct enumivo_global_state : enumivo_parameters {
uint64_t free_ram()const { return max_ram_size - total_ram_bytes_reserved; }

uint64_t total_ram_bytes_reserved = 0;
Expand All @@ -44,7 +44,7 @@ namespace enumivosystem {
double total_producer_vote_weight = 0; /// the sum of all producer votes

// explicit serialization macro is not necessary, used here only to improve compilation time
ENULIB_SERIALIZE_DERIVED( eosio_global_state, eosio_parameters, (total_ram_bytes_reserved)(total_ram_stake)
ENULIB_SERIALIZE_DERIVED( enumivo_global_state, enumivo_parameters, (total_ram_bytes_reserved)(total_ram_stake)
(last_producer_schedule_update)
(last_pervote_bucket_fill)
(pervote_bucket)(perblock_bucket)(savings)(total_unpaid_blocks)(total_activated_stake)(last_producer_schedule_id)(total_producer_vote_weight) )
Expand Down Expand Up @@ -109,7 +109,7 @@ namespace enumivosystem {
indexed_by<N(prototalvote), const_mem_fun<producer_info, double, &producer_info::by_votes> >
> producers_table;

typedef enumivo::singleton<N(global), eosio_global_state> global_state_singleton;
typedef enumivo::singleton<N(global), enumivo_global_state> global_state_singleton;

// static constexpr uint32_t max_inflation_rate = 5; // 5% annual inflation
static constexpr uint32_t seconds_per_day = 24 * 3600;
Expand All @@ -121,7 +121,7 @@ namespace enumivosystem {
producers_table _producers;
global_state_singleton _global;

eosio_global_state _gstate;
enumivo_global_state _gstate;
rammarket _rammarket;

public:
Expand Down Expand Up @@ -206,7 +206,7 @@ namespace enumivosystem {
// Implementation details:

//defined in voting.hpp
static eosio_global_state get_default_parameters();
static enumivo_global_state get_default_parameters();

// defined in voting.cpp
void propagate_weight_change( const voter_info& voter );
Expand Down
2 changes: 1 addition & 1 deletion contracts/enumivolib/dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extern "C" { \
switch( action ) { \
ENUMIVO_API( TYPE, MEMBERS ) \
} \
/* does not allow destructor of thiscontract to run: eosio_exit(0); */ \
/* does not allow destructor of thiscontract to run: enumivo_exit(0); */ \
} \
} \
} \
Expand Down
2 changes: 1 addition & 1 deletion contracts/enumivolib/mainpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Welcome to the Enumivo Documentation
- [Additional resources - Github Readme](https://github.com/enumivo/enumivo#readme)

## Smart Contract Developers
- @ref eosiorpc
- @ref enumivorpc
- @ref contractdev
- @ref accountapi - Define API for querying account data
- @ref chainapi - Define API for querying internal chain state
Expand Down
2 changes: 1 addition & 1 deletion contracts/enumivolib/rpc.dox
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
@defgroup eosiorpc RPC Interface
@defgroup enumivorpc RPC Interface
@brief Describes how to interface with eosd over HTTP RPC

@section tableofcontent Table Of Contents
Expand Down
2 changes: 1 addition & 1 deletion contracts/enumivolib/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" {
* This method will abort execution of wasm without failing the contract. This
* is used to bypass all cleanup / destructors that would normally be called.
*/
[[noreturn]] void eosio_exit( int32_t code );
[[noreturn]] void enumivo_exit( int32_t code );


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/exchange/exchange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,6 @@ extern "C" {
[[noreturn]] void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
enumivo::exchange ex( receiver );
ex.apply( code, action );
eosio_exit(0);
enumivo_exit(0);
}
}
4 changes: 2 additions & 2 deletions contracts/test_api/test_compiler_builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void test_compiler_builtins::test_divti3_by_0() {
__int128 res = 0;

__divti3( res, 100, 0, 0, 0 );
enumivo_assert( false, "Should have eosio_asserted" );
enumivo_assert( false, "Should have enumivo_asserted" );
}

void test_compiler_builtins::test_udivti3() {
Expand Down Expand Up @@ -193,7 +193,7 @@ void test_compiler_builtins::test_udivti3_by_0() {
unsigned __int128 res = 0;

__udivti3( res, 100, 0, 0, 0 );
enumivo_assert( false, "Should have eosio_asserted" );
enumivo_assert( false, "Should have enumivo_asserted" );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,23 +321,23 @@ namespace enumivo {
}
};

struct find_eosio_abi_macro_action : public PreprocessOnlyAction {
struct find_enumivo_abi_macro_action : public PreprocessOnlyAction {

string& contract;
vector<string>& actions;
const string& abi_context;

find_eosio_abi_macro_action(string& contract, vector<string>& actions, const string& abi_context
find_enumivo_abi_macro_action(string& contract, vector<string>& actions, const string& abi_context
): contract(contract),
actions(actions), abi_context(abi_context) {
}

struct callback_handler : public PPCallbacks {

CompilerInstance& compiler_instance;
find_eosio_abi_macro_action& act;
find_enumivo_abi_macro_action& act;

callback_handler(CompilerInstance& compiler_instance, find_eosio_abi_macro_action& act)
callback_handler(CompilerInstance& compiler_instance, find_enumivo_abi_macro_action& act)
: compiler_instance(compiler_instance), act(act) {}

void MacroExpands (const Token &token, const MacroDefinition &md, SourceRange range, const MacroArgs *args) override {
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void apply_context::execute_inline( action&& a ) {
control.get_authorization_manager()
.check_authorization( {a},
{},
{{receiver, config::eosio_code_name}},
{{receiver, config::enumivo_code_name}},
control.pending_block_time() - trx_context.published,
std::bind(&transaction_context::checktime, &this->trx_context),
false
Expand Down Expand Up @@ -250,7 +250,7 @@ void apply_context::schedule_deferred_transaction( const uint128_t& sender_id, a
control.get_authorization_manager()
.check_authorization( trx.actions,
{},
{{receiver, config::eosio_code_name}},
{{receiver, config::enumivo_code_name}},
delay,
std::bind(&transaction_context::checktime, &this->trx_context),
false
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/authorization_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ namespace enumivo { namespace chain {
if( !linked_permission )
return config::active_name;

if( *linked_permission == config::eosio_any_name )
if( *linked_permission == config::enumivo_any_name )
return optional<permission_name>();

return linked_permission;
Expand Down Expand Up @@ -263,7 +263,7 @@ namespace enumivo { namespace chain {
"cannot unlink non-existent permission link of account '${account}' for actions matching '${code}::${action}'",
("account", unlink.account)("code", unlink.code)("action", unlink.type) );

if( *unlinked_permission_name == config::eosio_any_name )
if( *unlinked_permission_name == config::enumivo_any_name )
return;

ENU_ASSERT( get_permission(auth).satisfies( get_permission({unlink.account, *unlinked_permission_name}),
Expand Down
14 changes: 7 additions & 7 deletions libraries/chain/enumivo_contract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void validate_authority_precondition( const apply_context& context, const author
if( a.permission.permission == config::owner_name || a.permission.permission == config::active_name )
continue; // account was already checked to exist, so its owner and active permissions should exist

if( a.permission.permission == config::eosio_code_name ) // virtual enumivo.code permission does not really exist but is allowed
if( a.permission.permission == config::enumivo_code_name ) // virtual enumivo.code permission does not really exist but is allowed
continue;

try {
Expand All @@ -65,7 +65,7 @@ void apply_enumivo_newaccount(apply_context& context) {
auto create = context.act.data_as<newaccount>();
try {
context.require_authorization(create.creator);
// context.require_write_lock( config::eosio_auth_scope );
// context.require_write_lock( config::enumivo_auth_scope );
auto& authorization = context.control.get_mutable_authorization_manager();

ENU_ASSERT( validate(create.owner), action_validate_exception, "Invalid owner authority");
Expand Down Expand Up @@ -125,7 +125,7 @@ void apply_enumivo_setcode(apply_context& context) {
auto& db = context.db;
auto act = context.act.data_as<setcode>();
context.require_authorization(act.account);
// context.require_write_lock( config::eosio_auth_scope );
// context.require_write_lock( config::enumivo_auth_scope );

FC_ASSERT( act.vmtype == 0 );
FC_ASSERT( act.vmversion == 0 );
Expand Down Expand Up @@ -263,7 +263,7 @@ void apply_enumivo_updateauth(apply_context& context) {
}

void apply_enumivo_deleteauth(apply_context& context) {
// context.require_write_lock( config::eosio_auth_scope );
// context.require_write_lock( config::enumivo_auth_scope );

auto remove = context.act.data_as<deleteauth>();
context.require_authorization(remove.account); // only here to mark the single authority on this action as used
Expand Down Expand Up @@ -293,7 +293,7 @@ void apply_enumivo_deleteauth(apply_context& context) {
}

void apply_enumivo_linkauth(apply_context& context) {
// context.require_write_lock( config::eosio_auth_scope );
// context.require_write_lock( config::enumivo_auth_scope );

auto requirement = context.act.data_as<linkauth>();
try {
Expand All @@ -308,7 +308,7 @@ void apply_enumivo_linkauth(apply_context& context) {
const auto *code = db.find<account_object, by_name>(requirement.code);
ENU_ASSERT(code != nullptr, account_query_exception,
"Failed to retrieve code for account: ${account}", ("account", requirement.code));
if( requirement.requirement != config::eosio_any_name ) {
if( requirement.requirement != config::enumivo_any_name ) {
const auto *permission = db.find<permission_object, by_name>(requirement.requirement);
ENU_ASSERT(permission != nullptr, permission_query_exception,
"Failed to retrieve permission: ${permission}", ("permission", requirement.requirement));
Expand Down Expand Up @@ -341,7 +341,7 @@ void apply_enumivo_linkauth(apply_context& context) {
}

void apply_enumivo_unlinkauth(apply_context& context) {
// context.require_write_lock( config::eosio_auth_scope );
// context.require_write_lock( config::enumivo_auth_scope );

auto& db = context.db;
auto unlink = context.act.data_as<unlinkauth>();
Expand Down
8 changes: 4 additions & 4 deletions libraries/chain/include/enumivo/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const static uint64_t producers_account_name = N(enumivo.prods);
const static uint64_t majority_producers_permission_name = N(prod.major); // greater than 1/2 of producers needed to authorize
const static uint64_t minority_producers_permission_name = N(prod.minor); // greater than 1/3 of producers needed to authorize0

const static uint64_t eosio_auth_scope = N(enumivo.auth);
const static uint64_t eosio_all_scope = N(enumivo.all);
const static uint64_t enumivo_auth_scope = N(enumivo.auth);
const static uint64_t enumivo_all_scope = N(enumivo.all);

const static uint64_t active_name = N(active);
const static uint64_t owner_name = N(owner);
const static uint64_t eosio_any_name = N(enumivo.any);
const static uint64_t eosio_code_name = N(enumivo.code);
const static uint64_t enumivo_any_name = N(enumivo.any);
const static uint64_t enumivo_code_name = N(enumivo.code);

const static int block_interval_ms = 500;
const static int block_interval_us = block_interval_ms*1000;
Expand Down
Loading

0 comments on commit e84120c

Please sign in to comment.