Skip to content

Commit

Permalink
Merge pull request EOSIO#98 from enumivo/staging
Browse files Browse the repository at this point in the history
rename eosio.system
  • Loading branch information
Enumivo authored May 15, 2018
2 parents 2304164 + 43fbd9d commit 563f551
Show file tree
Hide file tree
Showing 25 changed files with 87 additions and 87 deletions.
4 changes: 2 additions & 2 deletions contracts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ add_subdirectory(simple.token)
add_subdirectory(enumivo.coin)
add_subdirectory(enumivo.msig)
add_subdirectory(multi_index_test)
add_subdirectory(eosio.system)
add_subdirectory(enumivo.system)
add_subdirectory(identity)
add_subdirectory(stltest)
add_subdirectory(exchange)
Expand Down Expand Up @@ -47,7 +47,7 @@ add_custom_command(OUTPUT share/eosio/skeleton/skeleton.cpp
add_custom_target(copy_skeleton_contract ALL DEPENDS share/eosio/skeleton/skeleton.cpp)

install(DIRECTORY enumivolib DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR})
install(DIRECTORY eosio.system DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR})
install(DIRECTORY enumivo.system DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR})
install(DIRECTORY musl DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR})
install(DIRECTORY libc++ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR})
install(DIRECTORY skeleton DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/eosio)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
file(GLOB ABI_FILES "*.abi")
configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)

add_wast_executable(TARGET eosio.system
add_wast_executable(TARGET enumivo.system
INCLUDE_FOLDERS ${STANDARD_INCLUDE_FOLDERS}
LIBRARIES libc++ libc enumivolib enumivo.coin
DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eosio.system
enumivo.system
----------

This contract enables users to stake tokens, and then configure and vote on producers and worker proposals.
Expand All @@ -11,20 +11,20 @@ Actions:
The naming convention is codeaccount::actionname followed by a list of paramters.

Indicates that a particular account wishes to become a producer
## eosio.system::cfgproducer account config
## enumivo.system::cfgproducer account config
- **account** the producer account to update
- updates the configuration settings for a particular producer, these

Storage changes are billed to 'account'

## eosio.system::okproducer account producer vote
## enumivo.system::okproducer account producer vote
- **account** the account which is doing the voting
- **producer** the producer which is being voted for (or unvoted for)
- **vote** true if the producer should be voted for, false if not

Each account has a maximum number of votes it can maintain. Storage changes will be billed to 'account'

## eosio.system::setproxy account proxy
## enumivo.system::setproxy account proxy
- **account** the account which is updating it's proxy
- **proxy** the account which will have the power to vote account's stake

Expand All @@ -33,7 +33,7 @@ Indicates that a particular account wishes to become a producer

Storage changes will be billed to 'account'

## eosio.system::unstake account quantity
## enumivo.system::unstake account quantity
- **account** - the account which is requesting their balance be unstaked
- **quantity** - the quantity which will be unstaked, unstaked tokens lose voting influence immediately

Expand All @@ -48,37 +48,37 @@ Indicates that a particular account wishes to become a producer

- bandwidth and storage for the deferred transaction will be billed to 'from'

## eosio.system::withdraw account
- this action can only be triggered by eosio.system via a deferred transaction generated by unstake
- this will generate an inline enumivo.coin::transfer call from=eosio.system to=account and amount equal to the next withdraw increment
## enumivo.system::withdraw account
- this action can only be triggered by enumivo.system via a deferred transaction generated by unstake
- this will generate an inline enumivo.coin::transfer call from=enumivo.system to=account and amount equal to the next withdraw increment
- this will generate another deferred withdraw to continue the process if there are still withdraws to be made


## eosio.system::transfer from to amount memo
## enumivo.system::transfer from to amount memo
- decrements balance of from if amount <= balance
- increments balance of to by amount
- memo is ignored

## eosio.system::stakevote account amount
## enumivo.system::stakevote account amount
- the primary currency of eosio is controlled by the token contract which enables users to transfer
balances from one user to another. The receiver is notified on incoming balances and the vote contract
will stake the tokens on receipt.

- all producers this 'from' has voted for will have their votes updated immediately.


## eosio.system::onblock account blocktime blocknum
## enumivo.system::onblock account blocktime blocknum
- this special action is triggered when a block is applied by the given producer and cannot be generated from
any other source. It is used to pay producers and calculate missed blocks of other producers.

- producer pay is deposited into the producer's stake balance and can be withdrawn over time.

- if blocknum is the start of a new round this may update the active producer config from the producer votes.

## eosio.system::freeze producer accounts true|false
## enumivo.system::freeze producer accounts true|false
- requires permission of the @producers account
- if an account is frozen, all authorizations of that account are rejected and the code for that account will not be run

## eosio.system::paystandby producer
## enumivo.system::paystandby producer
- every block some amount of tokens is paid
- at most once per day a producer may claim a percentage of the standby pay equal to their totalvotes / allvotes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file
* @copyright defined in eos/LICENSE.txt
*/
#include "eosio.system.hpp"
#include "enumivo.system.hpp"

#include <enumivolib/eosio.hpp>
#include <enumivolib/print.hpp>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "eosio.system.hpp"
#include "enumivo.system.hpp"
#include <enumivolib/dispatcher.hpp>

#include "delegate_bandwidth.cpp"
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace eosiosystem {
_global.set( _gstate, _self );
}

} /// eosio.system
} /// enumivo.system


EOSIO_ABI( eosiosystem::system_contract,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*/
#pragma once

#include <eosio.system/native.hpp>
#include <enumivo.system/native.hpp>
#include <enumivolib/asset.hpp>
#include <enumivolib/privileged.hpp>
#include <enumivolib/singleton.hpp>
#include <eosio.system/exchange_state.hpp>
#include <enumivo.system/exchange_state.hpp>

#include <string>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "eosio.system.hpp"
#include "enumivo.system.hpp"

#include <enumivo.coin/enumivo.coin.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file
* @copyright defined in eos/LICENSE.txt
*/
#include "eosio.system.hpp"
#include "enumivo.system.hpp"

#include <enumivolib/eosio.hpp>
#include <enumivolib/crypto.h>
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/eosio_contract_abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace eosio { namespace chain {

abi_def eosio_contract_abi(const abi_def& eosio_system_abi)
abi_def eosio_contract_abi(const abi_def& enumivo_system_abi)
{
abi_def eos_abi(eosio_system_abi);
abi_def eos_abi(enumivo_system_abi);
eos_abi.types.push_back( type_def{"account_name","name"} );
eos_abi.types.push_back( type_def{"table_name","name"} );
eos_abi.types.push_back( type_def{"share_type","int64"} );
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/enumivo/chain/eosio_contract.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ namespace eosio { namespace chain {
void apply_eosio_canceldelay(apply_context&);
///@} end action handlers

abi_def eosio_contract_abi(const abi_def& eosio_system_abi);
abi_def eosio_contract_abi(const abi_def& enumivo_system_abi);

} } /// namespace eosio::chain
2 changes: 1 addition & 1 deletion programs/cleos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,7 @@ int main( int argc, char** argv ) {
);

// system subcommand
auto system = app.add_subcommand("system", localized("Send eosio.system contract action to the blockchain."), false);
auto system = app.add_subcommand("system", localized("Send enumivo.system contract action to the blockchain."), false);
system->require_subcommand();

auto createAccountSystem = create_account_subcommand( system, false /*simple*/ );
Expand Down
2 changes: 1 addition & 1 deletion testnet.template
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push
echo ==== End: $step ============== >> $logfile
step=$(($step + 1))

ecmd set contract eosio contracts/eosio.system contracts/eosio.system/eosio.system.wast contracts/eosio.system/eosio.system.abi
ecmd set contract eosio contracts/enumivo.system contracts/enumivo.system/enumivo.system.wast contracts/enumivo.system/enumivo.system.abi

echo ===== Start: $step ============ >> $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio issue '{"to":"eosio","quantity":"1000000000.0000 EOS","memo":"init"}' -p eosio@active | tee -a $logfile
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_executable( plugin_test ${UNIT_TESTS} ${WASM_UNIT_TESTS} main.cpp)
target_link_libraries( plugin_test eosio_testing eosio_chain chainbase eos_utilities chain_plugin wallet_plugin abi_generator fc ${PLATFORM_SPECIFIC_LIBS} )

target_include_directories( plugin_test PUBLIC ${CMAKE_SOURCE_DIR}/plugins/net_plugin/include )
add_dependencies(plugin_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange proxy identity identity_test stltest infinite eosio.system enumivo.coin enumivo.bios test.inline multi_index_test noop dice enumivo.msig)
add_dependencies(plugin_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange proxy identity identity_test stltest infinite enumivo.system enumivo.coin enumivo.bios test.inline multi_index_test noop dice enumivo.msig)

#
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_tests/sync/test.sh ${CMAKE_CURRENT_BINARY_DIR}/p2p_tests/sync/test.sh COPYONLY)
Expand Down
6 changes: 3 additions & 3 deletions tests/p2p_network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@
Print("host %s: %s" % (hosts[i], trans))


wastFile="contracts/eosio.system/eosio.system.wast"
abiFile="contracts/eosio.system/eosio.system.abi"
wastFile="contracts/enumivo.system/enumivo.system.wast"
abiFile="contracts/enumivo.system/enumivo.system.abi"
Print("\nPush system contract %s %s" % (wastFile, abiFile))
trans=node0.publishContract(eosio.name, wastFile, abiFile, waitForTransBlock=True)
if trans is None:
Utils.errorExit("Failed to publish eosio.system.")
Utils.errorExit("Failed to publish enumivo.system.")
else:
Print("transaction id %s" % (node0.getTransId(trans)))

Expand Down
2 changes: 1 addition & 1 deletion tests/testUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ def bootstrap(totalNodes, prodCount, biosHost, biosPort, dontKill=False, onlyBio
(expectedAmount, actualAmount))
return False

contract="eosio.system"
contract="enumivo.system"
contractDir="contracts/%s" % (contract)
wastFile="contracts/%s/%s.wast" % (contract, contract)
abiFile="contracts/%s/%s.abi" % (contract, contract)
Expand Down
2 changes: 1 addition & 1 deletion unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target_link_libraries( unit_test eosio_chain chainbase eosio_testing eos_utiliti
target_include_directories( unit_test PUBLIC ${CMAKE_BINARY_DIR}/contracts ${CMAKE_CURRENT_BINARY_DIR}/tests/contracts )
target_include_directories( unit_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/wasm_tests )
target_include_directories( unit_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include )
add_dependencies(unit_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange enumivo.coin proxy identity identity_test stltest infinite eosio.system enumivo.coin enumivo.bios test.inline multi_index_test noop dice enumivo.msig payloadless tic_tac_toe)
add_dependencies(unit_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange enumivo.coin proxy identity identity_test stltest infinite enumivo.system enumivo.coin enumivo.bios test.inline multi_index_test noop dice enumivo.msig payloadless tic_tac_toe)

#Manually run unit_test for all supported runtimes
#To run unit_test with all log from blockchain displayed, put --verbose after --, i.e. unit_test -- --verbose
Expand Down
18 changes: 9 additions & 9 deletions unittests/bootseq_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <enumivo/testing/tester.hpp>
#include <enumivo/chain/abi_serializer.hpp>

#include <eosio.system/eosio.system.wast.hpp>
#include <eosio.system/eosio.system.abi.hpp>
#include <enumivo.system/enumivo.system.wast.hpp>
#include <enumivo.system/enumivo.system.abi.hpp>
// These contracts are still under dev
#include <enumivo.bios/enumivo.bios.wast.hpp>
#include <enumivo.bios/enumivo.bios.abi.hpp>
Expand Down Expand Up @@ -198,7 +198,7 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) {
*/

// Set code for the following accounts:
// eosio.system (code: enumivo.bios)
// enumivo.system (code: enumivo.bios)
// enumivo.msig (code: enumivo.msig)
// enumivo.coin (code: enumivo.coin)
set_code_abi(N(enumivo.msig), enumivo_msig_wast, enumivo_msig_abi);//, &eosio_active_pk);
Expand All @@ -219,12 +219,12 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) {
auto max_supply = asset::from_string("10000000000.0000 EOS"); /// 1x larger than 1B initial tokens
auto initial_supply = asset::from_string("1000000000.0000 EOS"); /// 1x larger than 1B initial tokens

// Create EOS tokens in enumivo.coin, set its manager as eosio.system
// Create EOS tokens in enumivo.coin, set its manager as enumivo.system
create_currency(N(enumivo.coin), config::system_account_name, max_supply );


// Issue the genesis supply of 1 billion EOS tokens to eosio.system
// Issue the genesis supply of 1 billion EOS tokens to eosio.system
// Issue the genesis supply of 1 billion EOS tokens to enumivo.system
// Issue the genesis supply of 1 billion EOS tokens to enumivo.system
issue(N(enumivo.coin), config::system_account_name, config::system_account_name, initial_supply);


Expand All @@ -245,7 +245,7 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) {
("memo", "" ) );
*/
}
set_code_abi(N(eosio), eosio_system_wast, eosio_system_abi); //, &eosio_active_pk);
set_code_abi(N(eosio), enumivo_system_wast, enumivo_system_abi); //, &eosio_active_pk);

for( const auto& a : test_genesis ) {
auto ib = a.initial_balance;
Expand Down Expand Up @@ -337,8 +337,8 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) {

#warning Complete this test
/*
// Set code eosio.system from enumivo.bios to eosio.system
set_code_abi(config::system_account_name, eosio_system_wast, eosio_system_abi);
// Set code enumivo.system from enumivo.bios to enumivo.system
set_code_abi(config::system_account_name, enumivo_system_wast, enumivo_system_abi);
ilog(".");
Expand Down
4 changes: 2 additions & 2 deletions unittests/delay_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <enumivo/chain/producer_object.hpp>
#include <enumivo/chain/global_property_object.hpp>
#include <enumivo/chain/generated_transaction_object.hpp>
#include <eosio.system/eosio.system.wast.hpp>
#include <eosio.system/eosio.system.abi.hpp>
#include <enumivo.system/enumivo.system.wast.hpp>
#include <enumivo.system/enumivo.system.abi.hpp>
#include <enumivo.coin/enumivo.coin.wast.hpp>
#include <enumivo.coin/enumivo.coin.abi.hpp>

Expand Down
Loading

0 comments on commit 563f551

Please sign in to comment.