diff --git a/Docker/config.ini b/Docker/config.ini index 5ade138d99c..98265ccdf9d 100644 --- a/Docker/config.ini +++ b/Docker/config.ini @@ -79,7 +79,7 @@ required-participation = 33 # producer-name = # Tuple of [public key, WIF private key] (may specify multiple times) -private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] +private-key = ["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] # Plugin(s) to enable, may be specified multiple times # plugin = diff --git a/Docker/docker-compose-dawn4.0.yaml b/Docker/docker-compose-dawn4.0.yaml index aa1a99866a9..a50ee832b9b 100644 --- a/Docker/docker-compose-dawn4.0.yaml +++ b/Docker/docker-compose-dawn4.0.yaml @@ -11,7 +11,7 @@ services: nodeosd: image: enumivo/eos:latest - command: /opt/enumivo/bin/nodeosd.sh --data-dir /opt/enumivo/bin/data-dir --resync --mongodb-uri mongodb://mongo:27017/EOS + command: /opt/enumivo/bin/nodeosd.sh --data-dir /opt/enumivo/bin/data-dir --resync --mongodb-uri mongodb://mongo:27017/ENU hostname: nodeosd links: - mongo diff --git a/EXCHANGE_README.md b/EXCHANGE_README.md index 3a4db0b466f..dc3023fa59e 100644 --- a/EXCHANGE_README.md +++ b/EXCHANGE_README.md @@ -51,19 +51,19 @@ a couple of minutes, but either way enunode will keep you posted on the status. ## Initial Condition ``` -./enucli get currency balance enumivo.coin scott EOS -900.0000 EOS +./enucli get currency balance enumivo.coin scott ENU +900.0000 ENU ``` We will now deposit some funds to exchange: ``` -./enucli transfer scott exchange "1.0000 EOS" +./enucli transfer scott exchange "1.0000 ENU" executed transaction: 5ec797175dd24612acd8fc5a8685fa44caa8646cec0a87b12568db22a3df02fb 256 bytes 8k cycles -# enumivo.coin <= enumivo.coin::transfer {"from":"scott","to":"exchange","quantity":"1.0000 EOS","memo":""} +# enumivo.coin <= enumivo.coin::transfer {"from":"scott","to":"exchange","quantity":"1.0000 ENU","memo":""} >> transfer -# scott <= enumivo.coin::transfer {"from":"scott","to":"exchange","quantity":"1.0000 EOS","memo":""} -# exchange <= enumivo.coin::transfer {"from":"scott","to":"exchange","quantity":"1.0000 EOS","memo":""} +# scott <= enumivo.coin::transfer {"from":"scott","to":"exchange","quantity":"1.0000 ENU","memo":""} +# exchange <= enumivo.coin::transfer {"from":"scott","to":"exchange","quantity":"1.0000 ENU","memo":""} warning: transaction executed locally, but may not be confirmed by the network yet ``` @@ -83,7 +83,7 @@ can tell whether a transaction is confirmed or not by the first character, '#' f ./enucli get actions exchange # seq when contract::action => receiver trx id... args ================================================================================================================ -# 0 2018-04-29T01:09:45.000 enumivo.coin::transfer => exchange 5ec79717... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... +# 0 2018-04-29T01:09:45.000 enumivo.coin::transfer => exchange 5ec79717... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... ``` Do a few more transfers: @@ -92,9 +92,9 @@ Do a few more transfers: ./enucli get actions exchange # seq when contract::action => receiver trx id... args ================================================================================================================ -# 0 2018-04-29T01:09:45.000 enumivo.coin::transfer => exchange 5ec79717... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... -# 1 2018-04-29T01:16:25.000 enumivo.coin::transfer => exchange 2269828c... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... -? 2 2018-04-29T01:19:54.000 enumivo.coin::transfer => exchange 213f3797... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... +# 0 2018-04-29T01:09:45.000 enumivo.coin::transfer => exchange 5ec79717... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... +# 1 2018-04-29T01:16:25.000 enumivo.coin::transfer => exchange 2269828c... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... +? 2 2018-04-29T01:19:54.000 enumivo.coin::transfer => exchange 213f3797... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... ``` The last transfer is still pending, waiting on irreversibility. @@ -126,7 +126,7 @@ To get only the last action you would do the following... ./enucli get actions exchange -1 -1 # seq when contract::action => receiver trx id... args ================================================================================================================ -# 2 2018-04-29T01:19:54.000 enumivo.coin::transfer => exchange 213f3797... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... +# 2 2018-04-29T01:19:54.000 enumivo.coin::transfer => exchange 213f3797... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... ``` This says go to the last sequence number (indicated by pos = -1) and then fetch "1" item prior to it (offset = -1). This should @@ -144,7 +144,7 @@ We pass pos=1 and offset=0 to get the range [1,1+0] or [1,1]. ./enucli get actions exchange 1 0 # seq when contract::action => receiver trx id... args ================================================================================================================ -# 1 2018-04-29T01:16:25.000 enumivo.coin::transfer => exchange 2269828c... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... +# 1 2018-04-29T01:16:25.000 enumivo.coin::transfer => exchange 2269828c... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... ``` We can call this in a loop procesing each confirmed action (those starting with #) until we either run out of items or @@ -194,7 +194,7 @@ Here is the JSON returned when querying sequence 2. "data": { "from": "scott", "to": "exchange", - "quantity": "1.0000 EOS", + "quantity": "1.0000 ENU", "memo": "" }, "hex_data": "00000000809c29c20000008a4dd35057102700000000000004454f530000000000" @@ -219,7 +219,7 @@ You can identify irreversible deposits by the following: ``` actions[0].action_trace.act.account == "enumivo.coin" && actions[0].action_trace.act.name == "transfer" && - actions[0].action_trace.act.data.quantity == "X.0000 EOS" && + actions[0].action_trace.act.data.quantity == "X.0000 ENU" && actions[0].action_trace.to == "exchange" && actions[0].action_trace.memo == "KEY TO IDENTIFY INTERNAL ACCOUNT" && actions[0].action_trace.receipt.receiver == "exchange" && @@ -242,30 +242,30 @@ then you may process "false deposits". ### Validating Balance -Now that we have received 3 deposits we should see that the exchange has a balance of 3.0000 EOS. +Now that we have received 3 deposits we should see that the exchange has a balance of 3.0000 ENU. ``` -./enucli get currency balance enumivo.coin exchange EOS -3.0000 EOS +./enucli get currency balance enumivo.coin exchange ENU +3.0000 ENU ``` # Processing Withdraws -(note, while generating this tutorial scott deposited another 1.0000 EOS (seq 3) for total exchange balance of 4.0000 EOS.) +(note, while generating this tutorial scott deposited another 1.0000 ENU (seq 3) for total exchange balance of 4.0000 ENU.) When a user requests a withdraw from your exchange they will need to provide you with their enumivo account name and the amount to be withdrawn. You can then run the enucli command which will interact with the "unlocked" wallet running on `enunode` which should only enable localhost connections. More advanced usage would have a separate key-server (`keos`), but that will be covered later. -Lets assume scott wants to withdraw `1.0000 EOS`: +Lets assume scott wants to withdraw `1.0000 ENU`: ``` -./enucli transfer exchange scott "1.0000 EOS" +./enucli transfer exchange scott "1.0000 ENU" executed transaction: 93e785202e7502bb1383ad10e786cc20f7dd738d3fd3da38712b3fb38fb9af26 256 bytes 8k cycles -# enumivo.coin <= enumivo.coin::transfer {"from":"exchange","to":"scott","quantity":"1.0000 EOS","memo":""} +# enumivo.coin <= enumivo.coin::transfer {"from":"exchange","to":"scott","quantity":"1.0000 ENU","memo":""} >> transfer -# exchange <= enumivo.coin::transfer {"from":"exchange","to":"scott","quantity":"1.0000 EOS","memo":""} -# scott <= enumivo.coin::transfer {"from":"exchange","to":"scott","quantity":"1.0000 EOS","memo":""} +# exchange <= enumivo.coin::transfer {"from":"exchange","to":"scott","quantity":"1.0000 ENU","memo":""} +# scott <= enumivo.coin::transfer {"from":"exchange","to":"scott","quantity":"1.0000 ENU","memo":""} warning: transaction executed locally, but may not be confirmed by the network yet ``` @@ -281,13 +281,13 @@ state transitions based upon the action. ./enucli get actions exchange -1 -8 # seq when contract::action => receiver trx id... args ================================================================================================================ -# 0 2018-04-29T01:09:45.000 enumivo.coin::transfer => exchange 5ec79717... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... -# 1 2018-04-29T01:16:25.000 enumivo.coin::transfer => exchange 2269828c... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... -# 2 2018-04-29T01:19:54.000 enumivo.coin::transfer => exchange 213f3797... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... -# 3 2018-04-29T01:53:57.000 enumivo.coin::transfer => exchange 8b7766ac... {"from":"scott","to":"exchange","quantity":"1.0000 EOS","mem... -# 4 2018-04-29T01:54:17.500 enumivo.coin::transfer => enumivo.coin 93e78520... {"from":"exchange","to":"scott","quantity":"1.0000 EOS","mem... -# 5 2018-04-29T01:54:17.500 enumivo.coin::transfer => exchange 93e78520... {"from":"exchange","to":"scott","quantity":"1.0000 EOS","mem... -# 6 2018-04-29T01:54:17.500 enumivo.coin::transfer => scott 93e78520... {"from":"exchange","to":"scott","quantity":"1.0000 EOS","mem... +# 0 2018-04-29T01:09:45.000 enumivo.coin::transfer => exchange 5ec79717... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... +# 1 2018-04-29T01:16:25.000 enumivo.coin::transfer => exchange 2269828c... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... +# 2 2018-04-29T01:19:54.000 enumivo.coin::transfer => exchange 213f3797... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... +# 3 2018-04-29T01:53:57.000 enumivo.coin::transfer => exchange 8b7766ac... {"from":"scott","to":"exchange","quantity":"1.0000 ENU","mem... +# 4 2018-04-29T01:54:17.500 enumivo.coin::transfer => enumivo.coin 93e78520... {"from":"exchange","to":"scott","quantity":"1.0000 ENU","mem... +# 5 2018-04-29T01:54:17.500 enumivo.coin::transfer => exchange 93e78520... {"from":"exchange","to":"scott","quantity":"1.0000 ENU","mem... +# 6 2018-04-29T01:54:17.500 enumivo.coin::transfer => scott 93e78520... {"from":"exchange","to":"scott","quantity":"1.0000 ENU","mem... ``` By processing the history we can also be informed when our transaction was confirmed. In practice it may be useful to embed an exchange-specify memo @@ -305,7 +305,7 @@ when you least expect. By default enucli sets an expiration window of just 2 minutes. This is long enough to allow all 21 producers an opportunity to include the transaction. ``` - ./enucli transfer exchange scott "1.0000 EOS" -j -d + ./enucli transfer exchange scott "1.0000 ENU" -j -d { "expiration": "2018-04-29T01:58:12", "ref_block_num": 37282, diff --git a/contracts/dice/README.md b/contracts/dice/README.md index cb805d03cb5..10b468c07e7 100644 --- a/contracts/dice/README.md +++ b/contracts/dice/README.md @@ -5,8 +5,8 @@ This contract implements a simple DICE game between two players with 50/50 odds Before playing all players deposit funds into their @dice account just like the @exchange contract -1. Player 1 proposes to bet 1 EOS and submits SHA256(secret1) -2. Player 2 proposes to bet 1 EOS and submits SHA256(secret2) +1. Player 1 proposes to bet 1 ENU and submits SHA256(secret1) +2. Player 2 proposes to bet 1 ENU and submits SHA256(secret2) Because Player 1 and 2 bet equal amounts their orders are matched and the game begins. @@ -76,9 +76,9 @@ enucli create account enumivo dice EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7 enucli set contract dice build/contracts/dice -p dice ```` -##### Create native EOS token +##### Create native ENU token ````bash -enucli push action enumivo.coin create '[ "enumivo", "1000000000.0000 EOS", 0, 0, 0]' -p enumivo.coin +enucli push action enumivo.coin create '[ "enumivo", "1000000000.0000 ENU", 0, 0, 0]' -p enumivo.coin ```` ##### Create alice account @@ -91,34 +91,34 @@ enucli create account enumivo alice EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq enucli create account enumivo bob EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4 EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4 ```` -##### Issue 1000 EOS to alice +##### Issue 1000 ENU to alice ````bash -enucli push action enumivo.coin issue '[ "alice", "1000.0000 EOS", "" ]' -p enumivo +enucli push action enumivo.coin issue '[ "alice", "1000.0000 ENU", "" ]' -p enumivo ```` -##### Issue 1000 EOS to bob +##### Issue 1000 ENU to bob ````bash -enucli push action enumivo.coin issue '[ "bob", "1000.0000 EOS", "" ]' -p enumivo +enucli push action enumivo.coin issue '[ "bob", "1000.0000 ENU", "" ]' -p enumivo ```` ##### Allow dice contract to make transfers on alice behalf (deposit) ````bash -enucli set account permission alice active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"active"},"weight":1}]}' owner -p alice +enucli set account permission alice active '{"threshold": 1,"keys": [{"key": "ENU7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"active"},"weight":1}]}' owner -p alice ```` ##### Allow dice contract to make transfers on bob behalf (deposit) ````bash -enucli set account permission bob active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"active"},"weight":1}]}' owner -p bob +enucli set account permission bob active '{"threshold": 1,"keys": [{"key": "ENU7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"active"},"weight":1}]}' owner -p bob ```` -##### Alice deposits 100 EOS into the dice contract +##### Alice deposits 100 ENU into the dice contract ````bash -enucli push action dice deposit '[ "alice", "100.0000 EOS" ]' -p alice +enucli push action dice deposit '[ "alice", "100.0000 ENU" ]' -p alice ```` -##### Bob deposits 100 EOS into the dice contract +##### Bob deposits 100 ENU into the dice contract ````bash -enucli push action dice deposit '[ "bob", "100.0000 EOS" ]' -p bob +enucli push action dice deposit '[ "bob", "100.0000 ENU" ]' -p bob ```` ##### Alice generates a secret @@ -133,9 +133,9 @@ echo -n '28349b1d4bcdc9905e4ef9719019e55743c84efa0c5e9a0b077f0b54fcd84905' | xxd d533f24d6f28ddcef3f066474f7b8355383e485681ba8e793e037f5cf36e4883 ```` -##### Alice bets 3 EOS +##### Alice bets 3 ENU ````bash -enucli push action dice offerbet '[ "3.0000 EOS", "alice", "d533f24d6f28ddcef3f066474f7b8355383e485681ba8e793e037f5cf36e4883" ]' -p alice +enucli push action dice offerbet '[ "3.0000 ENU", "alice", "d533f24d6f28ddcef3f066474f7b8355383e485681ba8e793e037f5cf36e4883" ]' -p alice ```` ##### Bob generates a secret @@ -150,9 +150,9 @@ echo -n '15fe76d25e124b08feb835f12e00a879bd15666a33786e64b655891fba7d6c12' | xxd 50ed53fcdaf27f88d51ea4e835b1055efe779bb87e6cfdff47d28c88ffb27129 ```` -##### Bob also bets 3 EOS (a game is started) +##### Bob also bets 3 ENU (a game is started) ````bash -enucli push action dice offerbet '[ "3.0000 EOS", "bob", "50ed53fcdaf27f88d51ea4e835b1055efe779bb87e6cfdff47d28c88ffb27129" ]' -p bob +enucli push action dice offerbet '[ "3.0000 ENU", "bob", "50ed53fcdaf27f88d51ea4e835b1055efe779bb87e6cfdff47d28c88ffb27129" ]' -p bob ```` ##### Dice contract tables right after the game started @@ -163,12 +163,12 @@ enucli get table dice dice account { "rows": [{ "owner": "alice", - "enu_balance": "97.0000 EOS", + "enu_balance": "97.0000 ENU", "open_offers": 0, "open_games": 1 },{ "owner": "bob", - "enu_balance": "97.0000 EOS", + "enu_balance": "97.0000 ENU", "open_offers": 0, "open_games": 1 } @@ -184,7 +184,7 @@ enucli get table dice dice game { "rows": [{ "id": 1, - "bet": "3.0000 EOS", + "bet": "3.0000 ENU", "deadline": "1970-01-01T00:00:00", "player1": { "commitment": "d533f24d6f28ddcef3f066474f7b8355383e485681ba8e793e037f5cf36e4883", @@ -213,7 +213,7 @@ enucli get table dice dice game { "rows": [{ "id": 1, - "bet": "3.0000 EOS", + "bet": "3.0000 ENU", "deadline": "2018-04-17T07:45:49", "player1": { "commitment": "d533f24d6f28ddcef3f066474f7b8355383e485681ba8e793e037f5cf36e4883", @@ -242,12 +242,12 @@ enucli get table dice dice account { "rows": [{ "owner": "alice", - "enu_balance": "103.0000 EOS", + "enu_balance": "103.0000 ENU", "open_offers": 0, "open_games": 0 },{ "owner": "bob", - "enu_balance": "97.0000 EOS", + "enu_balance": "97.0000 ENU", "open_offers": 0, "open_games": 0 } @@ -256,14 +256,14 @@ enucli get table dice dice account } ```` -##### Alice withdraw from her dice account 103 EOS +##### Alice withdraw from her dice account 103 ENU ````bash -enucli push action dice withdraw '[ "alice", "103.0000 EOS" ]' -p alice +enucli push action dice withdraw '[ "alice", "103.0000 ENU" ]' -p alice ```` ##### Balance of alice after withdraw ````bash enucli get currency balance enumivo.coin alice enu -1003.0000 EOS +1003.0000 ENU ```` diff --git a/contracts/dice/dice.cpp b/contracts/dice/dice.cpp index 723ca3c1953..e4fb85e9064 100644 --- a/contracts/dice/dice.cpp +++ b/contracts/dice/dice.cpp @@ -35,7 +35,7 @@ class dice : public enumivo::contract { //@abi action void offerbet(const asset& bet, const account_name player, const checksum256& commitment) { - enumivo_assert( bet.symbol == S(4,EOS) , "only EOS token allowed" ); + enumivo_assert( bet.symbol == S(4,ENU) , "only ENU token allowed" ); enumivo_assert( bet.is_valid(), "invalid bet" ); enumivo_assert( bet.amount > 0, "must bet positive quantity" ); diff --git a/contracts/enumivo.msig/README.md b/contracts/enumivo.msig/README.md index cbfd94627e2..ff112a7b6f6 100644 --- a/contracts/enumivo.msig/README.md +++ b/contracts/enumivo.msig/README.md @@ -46,13 +46,13 @@ enucli usage example. Prerequisites: - enumivo.coin contract installed to enumivo.coin accountm, enumivo.msig contract installed on enumivo.msig account which is a priviliged account. - - account 'treasury' is the issuer of EOS token. + - account 'treasury' is the issuer of ENU token. - account 'tester' exists. - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked. One user creates a proposal: ```` -$ enucli multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' enumivo.coin issue '{"to": "tester", "quantity": "1000.0000 EOS", "memo": ""}' -p tester +$ enucli multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' enumivo.coin issue '{"to": "tester", "quantity": "1000.0000 ENU", "memo": ""}' -p tester executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles # enumivo.msig <= enumivo.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]... ```` @@ -88,7 +88,7 @@ $ enucli multisig review tester test -p treasury ], "data": { "to": "tester", - "quantity": "1000.0000 EOS", + "quantity": "1000.0000 ENU", "memo": "" }, "hex_data": "000000005c95b1ca809698000000000004454f530000000000" diff --git a/contracts/enumivo.system/delegate_bandwidth.cpp b/contracts/enumivo.system/delegate_bandwidth.cpp index 331c000e1b4..6fc0c258443 100644 --- a/contracts/enumivo.system/delegate_bandwidth.cpp +++ b/contracts/enumivo.system/delegate_bandwidth.cpp @@ -121,7 +121,7 @@ namespace enumivosystem { void system_contract::buyrambytes( account_name payer, account_name receiver, uint32_t bytes ) { auto itr = _rammarket.find(S(4,RAMEOS)); auto tmp = *itr; - auto eosout = tmp.convert( asset(bytes,S(0,RAM)), S(4,EOS) ); + auto eosout = tmp.convert( asset(bytes,S(0,RAM)), S(4,ENU) ); buyram( payer, receiver, eosout ); } @@ -193,7 +193,7 @@ namespace enumivosystem { auto itr = _rammarket.find(S(4,RAMEOS)); _rammarket.modify( itr, 0, [&]( auto& es ) { /// the cast to int64_t of bytes is safe because we certify bytes is <= quota which is limited by prior purchases - tokens_out = es.convert( asset(bytes,S(0,RAM)), S(4,EOS) ); + tokens_out = es.convert( asset(bytes,S(0,RAM)), S(4,ENU) ); }); _gstate.total_ram_bytes_reserved -= bytes; diff --git a/contracts/enumivo.system/enumivo.system.cpp b/contracts/enumivo.system/enumivo.system.cpp index e12835f0337..48391898470 100644 --- a/contracts/enumivo.system/enumivo.system.cpp +++ b/contracts/enumivo.system/enumivo.system.cpp @@ -30,7 +30,7 @@ namespace enumivosystem { m.base.balance.amount = int64_t(_gstate.free_ram()); m.base.balance.symbol = S(0,RAM); m.quote.balance.amount = system_token_supply / 1000; - m.quote.balance.symbol = S(4,EOS); + m.quote.balance.symbol = S(4,ENU); }); } } else { diff --git a/contracts/enumivo.system/enumivo.system.hpp b/contracts/enumivo.system/enumivo.system.hpp index a3472c33249..48dbcabac85 100644 --- a/contracts/enumivo.system/enumivo.system.hpp +++ b/contracts/enumivo.system/enumivo.system.hpp @@ -113,7 +113,7 @@ namespace enumivosystem { // static constexpr uint32_t max_inflation_rate = 5; // 5% annual inflation static constexpr uint32_t seconds_per_day = 24 * 3600; - static constexpr uint64_t system_token_symbol = S(4,EOS); + static constexpr uint64_t system_token_symbol = S(4,ENU); class system_contract : public native { private: diff --git a/contracts/enumivo.system/voting.cpp b/contracts/enumivo.system/voting.cpp index bf8a3cf351b..1826d0c72ef 100644 --- a/contracts/enumivo.system/voting.cpp +++ b/contracts/enumivo.system/voting.cpp @@ -131,7 +131,7 @@ namespace enumivosystem { * @pre if proxy is set then proxy account must exist and be registered as a proxy * @pre every listed producer or proxy must have been previously registered * @pre voter must authorize this action - * @pre voter must have previously staked some EOS for voting + * @pre voter must have previously staked some ENU for voting * @pre voter->staked must be up to date * * @post every producer previously voted for will have vote reduced by previous vote weight diff --git a/contracts/enumivolib/asset.hpp b/contracts/enumivolib/asset.hpp index c399b53edec..182d7fdce5a 100644 --- a/contracts/enumivolib/asset.hpp +++ b/contracts/enumivolib/asset.hpp @@ -114,7 +114,7 @@ namespace enumivo { static constexpr int64_t max_amount = (1LL << 62) - 1; - explicit asset( int64_t a = 0, symbol_name s = S(4,EOS)) + explicit asset( int64_t a = 0, symbol_name s = S(4,ENU)) :amount(a),symbol{s} { enumivo_assert( is_amount_within_range(), "magnitude of asset amount must be less than 2^62" ); diff --git a/contracts/enumivolib/rpc.dox b/contracts/enumivolib/rpc.dox index ccb06297627..81b1743bc2d 100644 --- a/contracts/enumivolib/rpc.dox +++ b/contracts/enumivolib/rpc.dox @@ -111,9 +111,9 @@ $ curl http://127.0.0.1:8888/v1/chain/get_account -X POST -d '{"account_name":" ``` { "name": "inita", - "enu_balance": "999998.9574 EOS", - "staked_balance": "0.0000 EOS", - "unstaking_balance": "0.0000 EOS", + "enu_balance": "999998.9574 ENU", + "staked_balance": "0.0000 ENU", + "unstaking_balance": "0.0000 ENU", "last_unstaking_time": "2106-02-07T06:28:15", "permissions": [ { @@ -123,7 +123,7 @@ $ curl http://127.0.0.1:8888/v1/chain/get_account -X POST -d '{"account_name":" "threshold": 1, "keys": [ { - "key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", + "key": "ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight": 1 } ], @@ -137,7 +137,7 @@ $ curl http://127.0.0.1:8888/v1/chain/get_account -X POST -d '{"account_name":" "threshold": 1, "keys": [ { - "key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", + "key": "ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight": 1 } ], @@ -329,14 +329,14 @@ Get required keys to sign a transaction from list of your keys. @subsubsection examplegetrequiredkeys Example get_required_keys Usage ``` -curl http://localhost:8888/v1/chain/get_required_keys -X POST -d '{"transaction": {"ref_block_num":"100","ref_block_prefix":"137469861","expiration":"2017-09-25T06:28:49","scope":["initb","initc"],"actions":[{"code":"currency","type":"transfer","recipients":["initb","initc"],"authorization":[{"account":"initb","permission":"active"}],"data":"000000000041934b000000008041934be803000000000000"}],"signatures":[],"authorizations":[]}, "available_keys":["EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq","EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA","EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"]}' +curl http://localhost:8888/v1/chain/get_required_keys -X POST -d '{"transaction": {"ref_block_num":"100","ref_block_prefix":"137469861","expiration":"2017-09-25T06:28:49","scope":["initb","initc"],"actions":[{"code":"currency","type":"transfer","recipients":["initb","initc"],"authorization":[{"account":"initb","permission":"active"}],"data":"000000000041934b000000008041934be803000000000000"}],"signatures":[],"authorizations":[]}, "available_keys":["ENU4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq","ENU7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA","ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"]}' ``` @subsubsection examplegetrequiredkeysresult Example get_required_keys Result ``` { "required_keys": [ - "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" + "ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" ] } ``` @@ -455,7 +455,7 @@ $ curl http://localhost:8889/v1/wallet/list_keys @subsubsection examplewalletlistkeysresult Example wallet_list_keys Result ``` -[["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]] +[["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]] ``` @subsection v1walletgetpublickeys wallet_get_public_keys @@ -469,7 +469,7 @@ $ curl http://localhost:8889/v1/wallet/get_public_keys @subsubsection examplewallegetpublickeysresult Example wallet_get_public_keys Result ``` -["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"] +["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"] ``` @subsection v1walletsettimeout wallet_set_timeout @@ -492,7 +492,7 @@ Sign transaction given an array of transaction, require public keys, and chain i @subsubsection examplewalletsigntrx Example wallet_sign_trx Usage ``` -$ curl http://localhost:8889/v1/wallet/sign_transaction -X POST -d '[{"ref_block_num":21453,"ref_block_prefix":3165644999,"expiration":"2017-12-08T10:28:49","scope":["initb","initc"],"read_scope":[],"messages":[{"code":"currency","type":"transfer","authorization":[{"account":"initb","permission":"active"}],"data":"000000008093dd74000000000094dd74e803000000000000"}],"signatures":[]}, ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], ""]' +$ curl http://localhost:8889/v1/wallet/sign_transaction -X POST -d '[{"ref_block_num":21453,"ref_block_prefix":3165644999,"expiration":"2017-12-08T10:28:49","scope":["initb","initc"],"read_scope":[],"messages":[{"code":"currency","type":"transfer","authorization":[{"account":"initb","permission":"active"}],"data":"000000008093dd74000000000094dd74e803000000000000"}],"signatures":[]}, ["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], ""]' ``` @subsubsection examplewalletsigntrxresult Example wallet_sign_trx Result diff --git a/contracts/social/social.cpp b/contracts/social/social.cpp index 73e03588e32..6a8994789a3 100644 --- a/contracts/social/social.cpp +++ b/contracts/social/social.cpp @@ -5,7 +5,7 @@ #include /** - * The purpose of this contract is to implement something like Steem on EOS, this + * The purpose of this contract is to implement something like Steem on ENU, this * means this contract defines its own currency, allows people to create posts, vote * on posts, and stake their voting power. * diff --git a/libraries/chain/include/enumivo/chain/asset.hpp b/libraries/chain/include/enumivo/chain/asset.hpp index 0605043b130..5987384cfe5 100644 --- a/libraries/chain/include/enumivo/chain/asset.hpp +++ b/libraries/chain/include/enumivo/chain/asset.hpp @@ -8,7 +8,7 @@ #include /// eos with 4 digits of precision -#define ENU_SYMBOL_VALUE (int64_t(4) | (uint64_t('E') << 8) | (uint64_t('O') << 16) | (uint64_t('S') << 24)) +#define ENU_SYMBOL_VALUE (int64_t(4) | (uint64_t('E') << 8) | (uint64_t('N') << 16) | (uint64_t('U') << 24)) static const enumivo::chain::symbol ENU_SYMBOL(ENU_SYMBOL_VALUE); /// Defined to be largest power of 10 that fits in 53 bits of precision diff --git a/libraries/chain/include/enumivo/chain/genesis_state.hpp b/libraries/chain/include/enumivo/chain/genesis_state.hpp index 8f00ecd759c..d40e5d41566 100644 --- a/libraries/chain/include/enumivo/chain/genesis_state.hpp +++ b/libraries/chain/include/enumivo/chain/genesis_state.hpp @@ -40,7 +40,7 @@ struct genesis_state { }; time_point initial_timestamp = fc::time_point::from_iso_string( "2018-03-02T12:00:00" );; - public_key_type initial_key = fc::variant("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV").as(); + public_key_type initial_key = fc::variant("ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV").as(); /** * Temporary, will be moved elsewhere. diff --git a/libraries/chain/include/enumivo/chain/symbol.hpp b/libraries/chain/include/enumivo/chain/symbol.hpp index 07d032e4497..50400c47d59 100644 --- a/libraries/chain/include/enumivo/chain/symbol.hpp +++ b/libraries/chain/include/enumivo/chain/symbol.hpp @@ -16,7 +16,7 @@ namespace enumivo { When encoded as a uint64_t, first byte represents the number of decimals, remaining bytes represent token name. Name must only include upper case alphabets. - from_string constructs a symbol from an input a string of the form "4,EOS" + from_string constructs a symbol from an input a string of the form "4,ENU" where the integer represents number of decimals. Number of decimals must be larger than zero. */ @@ -65,7 +65,7 @@ namespace enumivo { explicit symbol(uint8_t p, const char* s): m_value(string_to_symbol(p, s)) { FC_ASSERT(valid(), "invalid symbol: ${s}", ("s",s)); } - explicit symbol(uint64_t v = SY(4, EOS)): m_value(v) { + explicit symbol(uint64_t v = SY(4, ENU)): m_value(v) { FC_ASSERT(valid(), "invalid symbol: ${name}", ("name",name())); } static symbol from_string(const string& from) diff --git a/libraries/fc/include/fc/crypto/public_key.hpp b/libraries/fc/include/fc/crypto/public_key.hpp index be0655251a5..0255f4030f3 100644 --- a/libraries/fc/include/fc/crypto/public_key.hpp +++ b/libraries/fc/include/fc/crypto/public_key.hpp @@ -8,7 +8,7 @@ namespace fc { namespace crypto { namespace config { - constexpr const char* public_key_legacy_prefix = "EOS"; + constexpr const char* public_key_legacy_prefix = "ENU"; constexpr const char* public_key_base_prefix = "PUB"; constexpr const char* public_key_prefix[] = { "K1", diff --git a/libraries/fc/test/crypto/test_cypher_suites.cpp b/libraries/fc/test/crypto/test_cypher_suites.cpp index e83c67cbb10..a2fa4165d2d 100644 --- a/libraries/fc/test/crypto/test_cypher_suites.cpp +++ b/libraries/fc/test/crypto/test_cypher_suites.cpp @@ -12,7 +12,7 @@ using namespace fc; BOOST_AUTO_TEST_SUITE(cypher_suites) BOOST_AUTO_TEST_CASE(test_k1) try { auto private_key_string = std::string("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"); - auto expected_public_key = std::string("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"); + auto expected_public_key = std::string("ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"); auto test_private_key = private_key(private_key_string); auto test_public_key = test_private_key.get_public_key(); diff --git a/libraries/testing/test.cpp b/libraries/testing/test.cpp index e1d7ee2dda4..ba072edf9cd 100644 --- a/libraries/testing/test.cpp +++ b/libraries/testing/test.cpp @@ -40,7 +40,7 @@ int main( int argc, char** argv ) { auto cr = c.push_action( N(enumivo.coin), N(create), N(enumivo.coin), mutable_variant_object() ("issuer", "enumivo" ) - ("maximum_supply", "10000000.0000 EOS") + ("maximum_supply", "10000000.0000 ENU") ("can_freeze", 0) ("can_recall", 0) ("can_whitelist", 0) @@ -50,7 +50,7 @@ int main( int argc, char** argv ) { cr = c.push_action( N(enumivo.coin), N(issue), N(enumivo), mutable_variant_object() ("to", "dan" ) - ("quantity", "100.0000 EOS") + ("quantity", "100.0000 ENU") ("memo", "") ); @@ -189,7 +189,7 @@ int main( int argc, char** argv ) { cr = c.push_action( N(enumivo.coin), N(issue), N(enumivo), mutable_variant_object() ("to", "unregistered" ) - ("quantity", "100.0000 EOS") + ("quantity", "100.0000 ENU") ("memo", "") ); diff --git a/plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp b/plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp index b99aecdd8df..7ea2b809d30 100644 --- a/plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp +++ b/plugins/faucet_testnet_plugin/faucet_testnet_plugin.cpp @@ -283,7 +283,7 @@ const uint32_t faucet_testnet_plugin_impl::_default_create_interval_msec = 1000; const uint32_t faucet_testnet_plugin_impl::_default_create_alternates_to_return = 3; const std::string faucet_testnet_plugin_impl::_default_create_account_name = "faucet"; // defaults to the public/private key of init accounts in private testnet genesis.json -const key_pair faucet_testnet_plugin_impl::_default_key_pair = {"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"}; +const key_pair faucet_testnet_plugin_impl::_default_key_pair = {"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"}; faucet_testnet_plugin::faucet_testnet_plugin() diff --git a/plugins/mongo_db_plugin/CMakeLists.txt b/plugins/mongo_db_plugin/CMakeLists.txt index b0d24caaa72..ad82799a5c2 100644 --- a/plugins/mongo_db_plugin/CMakeLists.txt +++ b/plugins/mongo_db_plugin/CMakeLists.txt @@ -8,7 +8,7 @@ if(BUILD_MONGO_DB_PLUGIN) if (libmongoc-1.0_FOUND) - # EOS has no direct dependencies on libmongoc but its shared libraries + # ENU has no direct dependencies on libmongoc but its shared libraries # will need to be present at runtime for the C++ libraries we use: # libbsoncxx & libmongocxx (both from github.com/mongodb/mongo-cxx-driver) diff --git a/plugins/mongo_db_plugin/include/enumivo/mongo_db_plugin/mongo_db_plugin.hpp b/plugins/mongo_db_plugin/include/enumivo/mongo_db_plugin/mongo_db_plugin.hpp index 7b9c45b08af..81462f8934b 100644 --- a/plugins/mongo_db_plugin/include/enumivo/mongo_db_plugin/mongo_db_plugin.hpp +++ b/plugins/mongo_db_plugin/include/enumivo/mongo_db_plugin/mongo_db_plugin.hpp @@ -19,7 +19,7 @@ using mongo_db_plugin_impl_ptr = std::shared_ptr; * Actions * Accounts * - * See data dictionary (DB Schema Definition - EOS API) for description of MongoDB schema. + * See data dictionary (DB Schema Definition - ENU API) for description of MongoDB schema. * * The goal ultimately is for all chainbase data to be mirrored in MongoDB via a delayed node processing * irreversible blocks. Currently, only Blocks, Transactions, Messages, and Account balance it mirrored. diff --git a/plugins/mongo_db_plugin/mongo_db_plugin.cpp b/plugins/mongo_db_plugin/mongo_db_plugin.cpp index a3996332149..8e89699f3ac 100644 --- a/plugins/mongo_db_plugin/mongo_db_plugin.cpp +++ b/plugins/mongo_db_plugin/mongo_db_plugin.cpp @@ -259,8 +259,8 @@ namespace { msg_doc.append(kvp("data", value)); return; } catch (std::exception& e) { - elog("Unable to convert EOS JSON to MongoDB JSON: ${e}", ("e", e.what())); - elog(" EOS JSON: ${j}", ("j", json)); + elog("Unable to convert ENU JSON to MongoDB JSON: ${e}", ("e", e.what())); + elog(" ENU JSON: ${j}", ("j", json)); } } catch (fc::exception& e) { elog("Unable to convert action.data to ABI: ${s} :: ${n}, what: ${e}", ("s", msg.account)("n", msg.name)("e", e.to_string())); @@ -793,7 +793,7 @@ void mongo_db_plugin::set_program_options(options_description& cli, options_desc "The queue size between enunode and MongoDB plugin thread.") ("mongodb-uri,m", bpo::value(), "MongoDB URI connection string, see: https://docs.mongodb.com/master/reference/connection-string/." - " If not specified then plugin is disabled. Default database 'EOS' is used if not specified in URI.") + " If not specified then plugin is disabled. Default database 'ENU' is used if not specified in URI.") ; } @@ -822,7 +822,7 @@ void mongo_db_plugin::plugin_initialize(const variables_map& options) mongocxx::uri uri = mongocxx::uri{uri_str}; my->db_name = uri.database(); if (my->db_name.empty()) - my->db_name = "EOS"; + my->db_name = "ENU"; my->mongo_conn = mongocxx::client{uri}; // add callback to chain_controller config diff --git a/plugins/sql_db_plugin/include/enumivo/sql_db_plugin/sql_db_plugin.hpp b/plugins/sql_db_plugin/include/enumivo/sql_db_plugin/sql_db_plugin.hpp index a22342d81f3..a2db641d2a6 100644 --- a/plugins/sql_db_plugin/include/enumivo/sql_db_plugin/sql_db_plugin.hpp +++ b/plugins/sql_db_plugin/include/enumivo/sql_db_plugin/sql_db_plugin.hpp @@ -22,7 +22,7 @@ namespace enumivo { * Actions * Accounts * - * See data dictionary (DB Schema Definition - EOS API) for description of SQL DB schema. + * See data dictionary (DB Schema Definition - ENU API) for description of SQL DB schema. * * The goal ultimately is for all chainbase data to be mirrored in SQL DB via a delayed node processing * irreversible blocks. Currently, only Blocks, Transactions, Messages, and Account balance it mirrored. diff --git a/plugins/sql_db_plugin/sql_db_plugin.cpp b/plugins/sql_db_plugin/sql_db_plugin.cpp index 994e7dde1a2..c96faeb75d0 100644 --- a/plugins/sql_db_plugin/sql_db_plugin.cpp +++ b/plugins/sql_db_plugin/sql_db_plugin.cpp @@ -39,7 +39,7 @@ void sql_db_plugin::set_program_options(options_description& cli, options_descri "The queue size between nodeos and SQL DB plugin thread.") (SQL_DB_URI_OPTION, bpo::value(), "Sql DB URI connection string" - " If not specified then plugin is disabled. Default database 'EOS' is used if not specified in URI.") + " If not specified then plugin is disabled. Default database 'ENU' is used if not specified in URI.") ; } diff --git a/programs/enucli/eosc.pot b/programs/enucli/eosc.pot index a21ce55502a..8175c3b8da0 100644 --- a/programs/enucli/eosc.pot +++ b/programs/enucli/eosc.pot @@ -343,16 +343,16 @@ msgstr "" msgid "set or update blockchain action state" msgstr "" -msgid "Transfer EOS from account to account" +msgid "Transfer ENU from account to account" msgstr "" -msgid "The account sending EOS" +msgid "The account sending ENU" msgstr "" -msgid "The account receiving EOS" +msgid "The account receiving ENU" msgstr "" -msgid "The amount of EOS to send" +msgid "The amount of ENU to send" msgstr "" msgid "The memo for the transfer" diff --git a/programs/enucli/help_text.cpp b/programs/enucli/help_text.cpp index 2526fe074d6..84c4628f0cb 100644 --- a/programs/enucli/help_text.cpp +++ b/programs/enucli/help_text.cpp @@ -100,7 +100,7 @@ auto smatch_to_variant(const std::smatch& smatch) { }; const char* error_advice_name_type_exception = R"=====(Name should be less than 13 characters and only contains the following symbol .12345abcdefghijklmnopqrstuvwxyz)====="; -const char* error_advice_public_key_type_exception = R"=====(Public key should be encoded in base58 and starts with EOS prefix)====="; +const char* error_advice_public_key_type_exception = R"=====(Public key should be encoded in base58 and starts with ENU prefix)====="; const char* error_advice_private_key_type_exception = R"=====(Private key should be encoded in base58 WIF)====="; const char* error_advice_authority_type_exception = R"=====(Ensure that your authority JSON follows the right authority structure! You can refer to contracts/enumivolib/native.hpp for reference)====="; diff --git a/programs/enucli/main.cpp b/programs/enucli/main.cpp index 28954528d44..a34b8d46722 100644 --- a/programs/enucli/main.cpp +++ b/programs/enucli/main.cpp @@ -33,7 +33,7 @@ Usage: programs/cleos/cleos [OPTIONS] SUBCOMMAND create Create various items, on and off the blockchain get Retrieve various items and information from the blockchain set Set or update blockchain state - transfer Transfer EOS from account to account + transfer Transfer ENU from account to account net Interact with local p2p network connections wallet Interact with local wallet sign Sign a transaction @@ -563,7 +563,7 @@ authority parse_json_authority(const std::string& authorityJsonOrFile) { } authority parse_json_authority_or_key(const std::string& authorityJsonOrFile) { - if (boost::istarts_with(authorityJsonOrFile, "EOS")) { + if (boost::istarts_with(authorityJsonOrFile, "ENU")) { try { return authority(public_key_type(authorityJsonOrFile)); } ENU_RETHROW_EXCEPTIONS(public_key_type_exception, "Invalid public key: ${public_key}", ("public_key", authorityJsonOrFile)) @@ -822,15 +822,15 @@ struct create_account_subcommand { if (!simple) { createAccount->add_option("--stake-net", stake_net, - (localized("The amount of EOS delegated for net bandwidth")))->required(); + (localized("The amount of ENU delegated for net bandwidth")))->required(); createAccount->add_option("--stake-cpu", stake_cpu, - (localized("The amount of EOS delegated for CPU bandwidth")))->required(); + (localized("The amount of ENU delegated for CPU bandwidth")))->required(); createAccount->add_option("--buy-ram-bytes", buy_ram_bytes_in_kbytes, (localized("The amount of RAM bytes to purchase for the new account in kilobytes KiB, default is 8 KiB"))); - createAccount->add_option("--buy-ram-EOS", buy_ram_eos, - (localized("The amount of RAM bytes to purchase for the new account in EOS"))); + createAccount->add_option("--buy-ram-ENU", buy_ram_eos, + (localized("The amount of RAM bytes to purchase for the new account in ENU"))); createAccount->add_flag("--transfer", transfer, - (localized("Transfer voting power and right to unstake EOS to receiver"))); + (localized("Transfer voting power and right to unstake ENU to receiver"))); } add_standard_transaction_options(createAccount); @@ -1059,9 +1059,9 @@ struct delegate_bandwidth_subcommand { auto delegate_bandwidth = actionRoot->add_subcommand("delegatebw", localized("Delegate bandwidth")); delegate_bandwidth->add_option("from", from_str, localized("The account to delegate bandwidth from"))->required(); delegate_bandwidth->add_option("receiver", receiver_str, localized("The account to receive the delegated bandwidth"))->required(); - delegate_bandwidth->add_option("stake_net_quantity", stake_net_amount, localized("The amount of EOS to stake for network bandwidth"))->required(); - delegate_bandwidth->add_option("stake_cpu_quantity", stake_cpu_amount, localized("The amount of EOS to stake for CPU bandwidth"))->required(); - delegate_bandwidth->add_flag("--transfer", transfer, localized("Transfer voting power and right to unstake EOS to receiver")); + delegate_bandwidth->add_option("stake_net_quantity", stake_net_amount, localized("The amount of ENU to stake for network bandwidth"))->required(); + delegate_bandwidth->add_option("stake_cpu_quantity", stake_cpu_amount, localized("The amount of ENU to stake for CPU bandwidth"))->required(); + delegate_bandwidth->add_flag("--transfer", transfer, localized("Transfer voting power and right to unstake ENU to receiver")); add_standard_transaction_options(delegate_bandwidth); delegate_bandwidth->set_callback([this] { @@ -1089,8 +1089,8 @@ struct undelegate_bandwidth_subcommand { auto undelegate_bandwidth = actionRoot->add_subcommand("undelegatebw", localized("Undelegate bandwidth")); undelegate_bandwidth->add_option("from", from_str, localized("The account undelegating bandwidth"))->required(); undelegate_bandwidth->add_option("receiver", receiver_str, localized("The account to undelegate bandwidth from"))->required(); - undelegate_bandwidth->add_option("unstake_net_quantity", unstake_net_amount, localized("The amount of EOS to undelegate for network bandwidth"))->required(); - undelegate_bandwidth->add_option("unstake_cpu_quantity", unstake_cpu_amount, localized("The amount of EOS to undelegate for CPU bandwidth"))->required(); + undelegate_bandwidth->add_option("unstake_net_quantity", unstake_net_amount, localized("The amount of ENU to undelegate for network bandwidth"))->required(); + undelegate_bandwidth->add_option("unstake_cpu_quantity", unstake_cpu_amount, localized("The amount of ENU to undelegate for CPU bandwidth"))->required(); add_standard_transaction_options(undelegate_bandwidth); undelegate_bandwidth->set_callback([this] { @@ -1113,7 +1113,7 @@ struct buyram_subcommand { auto buyram = actionRoot->add_subcommand("buyram", localized("Buy RAM")); buyram->add_option("payer", from_str, localized("The account paying for RAM"))->required(); buyram->add_option("receiver", receiver_str, localized("The account receiving bought RAM"))->required(); - buyram->add_option("tokens", amount, localized("The amount of EOS to pay for RAM"))->required(); + buyram->add_option("tokens", amount, localized("The amount of ENU to pay for RAM"))->required(); add_standard_transaction_options(buyram); buyram->set_callback([this] { fc::variant act_payload = fc::mutable_variant_object() @@ -1132,7 +1132,7 @@ struct sellram_subcommand { sellram_subcommand(CLI::App* actionRoot) { auto sellram = actionRoot->add_subcommand("sellram", localized("Sell RAM")); - sellram->add_option("account", receiver_str, localized("The account to receive EOS for sold RAM"))->required(); + sellram->add_option("account", receiver_str, localized("The account to receive ENU for sold RAM"))->required(); sellram->add_option("bytes", amount, localized("Number of RAM bytes to sell"))->required(); add_standard_transaction_options(sellram); @@ -1851,10 +1851,10 @@ int main( int argc, char** argv ) { string recipient; string amount; string memo; - auto transfer = app.add_subcommand("transfer", localized("Transfer EOS from account to account"), false); - transfer->add_option("sender", sender, localized("The account sending EOS"))->required(); - transfer->add_option("recipient", recipient, localized("The account receiving EOS"))->required(); - transfer->add_option("amount", amount, localized("The amount of EOS to send"))->required(); + auto transfer = app.add_subcommand("transfer", localized("Transfer ENU from account to account"), false); + transfer->add_option("sender", sender, localized("The account sending ENU"))->required(); + transfer->add_option("recipient", recipient, localized("The account receiving ENU"))->required(); + transfer->add_option("amount", amount, localized("The amount of ENU to send"))->required(); transfer->add_option("memo", memo, localized("The memo for the transfer")); transfer->add_option("--contract,-c", con, localized("The contract which controls the token")); diff --git a/programs/enulauncher/main.cpp b/programs/enulauncher/main.cpp index 88a3b39f6bf..c57a49a2759 100644 --- a/programs/enulauncher/main.cpp +++ b/programs/enulauncher/main.cpp @@ -1068,7 +1068,7 @@ launcher_def::init_genesis () { while(getline(src,str)) { size_t pos = str.find(prefix); if (pos != string::npos) { - size_t cut = str.find("EOS",pos); + size_t cut = str.find("ENU",pos); genesis_block.push_back(str.substr(0,cut) + bioskey + "\","); } else { diff --git a/programs/exchange-tutorial-python/README.md b/programs/exchange-tutorial-python/README.md index d84e03ec65a..5f410ba25f0 100644 --- a/programs/exchange-tutorial-python/README.md +++ b/programs/exchange-tutorial-python/README.md @@ -5,7 +5,7 @@ The following steps must be taken for the example script to work. 0. Create account for scott 0. Create account for exchange 0. Set token contract on enumivo.coin -0. Create EOS token +0. Create ENU token 0. Issue initial tokens to scott **Note**: @@ -29,8 +29,8 @@ Deleting the `transactions.txt` file will prevent replay from working. ### Set contract steps `enucli set contract enumivo.coin /contracts/enumivo.coin -p enumivo.coin@active` -### Create EOS token steps -`enucli push action enumivo.coin create '{"issuer": "enumivo.coin", "maximum_supply": "100000.0000 EOS", "can_freeze": 1, "can_recall": 1, "can_whitelist": 1}' -p enumivo.coin@active` +### Create ENU token steps +`enucli push action enumivo.coin create '{"issuer": "enumivo.coin", "maximum_supply": "100000.0000 ENU", "can_freeze": 1, "can_recall": 1, "can_whitelist": 1}' -p enumivo.coin@active` ### Issue token steps -`enucli push action enumivo.coin issue '{"to": "scott", "quantity": "900.0000 EOS", "memo": "testing"}' -p enumivo.coin@active` +`enucli push action enumivo.coin issue '{"to": "scott", "quantity": "900.0000 ENU", "memo": "testing"}' -p enumivo.coin@active` diff --git a/programs/exchange-tutorial-python/exchange_tutorial.py b/programs/exchange-tutorial-python/exchange_tutorial.py index 207e059676e..ada4e4f2c62 100644 --- a/programs/exchange-tutorial-python/exchange_tutorial.py +++ b/programs/exchange-tutorial-python/exchange_tutorial.py @@ -62,8 +62,8 @@ def update_balance(action, to): def transfer(to, quantity): - if quantity[:-4] != ' EOS': - quantity += ' EOS' + if quantity[:-4] != ' ENU': + quantity += ' ENU' results = enucli('transfer exchange {} "{}" {} -j'.format(to, quantity, KEY_TO_INTERNAL_ACCOUNT)) transaction_info = json.loads(str(results.stdout, 'utf-8')) transaction_id = transaction_info['transaction_id'] @@ -99,7 +99,7 @@ def is_valid_deposit(action): memo == KEY_TO_INTERNAL_ACCOUNT and valid_user and from_user == DEMO_USER and - token == 'EOS'): + token == 'ENU'): return True print('Invalid deposit') @@ -127,7 +127,7 @@ def is_valid_withdrawal(action): valid_user and to_user == DEMO_USER and transaction_id in get_transactions() and - token == 'EOS'): + token == 'ENU'): return True print('Invalid withdrawal') diff --git a/testnet.md b/testnet.md index dc4487ad5be..7039bff536d 100644 --- a/testnet.md +++ b/testnet.md @@ -124,7 +124,7 @@ The ssh helper fields are paths to ssh and scp, an identity if necessary, and an "http_port": 8888, "filesize": 8192, "keys": [{ - "public_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", + "public_key": "ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "wif_private_key": "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" } ], diff --git a/testnet.template b/testnet.template index 4a3cdafc257..cba9979131c 100644 --- a/testnet.template +++ b/testnet.template @@ -98,9 +98,9 @@ step=$(($step + 1)) ecmd set contract enumivo contracts/enumivo.system contracts/enumivo.system/enumivo.system.wast contracts/enumivo.system/enumivo.system.abi echo ===== Start: $step ============ >> $logfile -echo executing: enucli --wallet-url $wdurl --url http://$bioshost:$biosport push action enumivo issue '{"to":"enumivo","quantity":"1000000000.0000 EOS","memo":"init"}' -p enumivo@active | tee -a $logfile +echo executing: enucli --wallet-url $wdurl --url http://$bioshost:$biosport push action enumivo issue '{"to":"enumivo","quantity":"1000000000.0000 ENU","memo":"init"}' -p enumivo@active | tee -a $logfile echo ----------------------- >> $logfile -programs/enucli/enucli --wallet-url $wdurl --url http://$bioshost:$biosport push action enumivo issue '{"to":"enumivo","quantity":"1000000000.0000 EOS","memo":"init"}' -p enumivo@active >> $logfile 2>&1 +programs/enucli/enucli --wallet-url $wdurl --url http://$bioshost:$biosport push action enumivo issue '{"to":"enumivo","quantity":"1000000000.0000 ENU","memo":"init"}' -p enumivo@active >> $logfile 2>&1 echo ==== End: $step ============== >> $logfile step=$(($step + 1)) diff --git a/tests/consensus-validation-malicious-producers.py b/tests/consensus-validation-malicious-producers.py index 568de28210a..18e94705e72 100755 --- a/tests/consensus-validation-malicious-producers.py +++ b/tests/consensus-validation-malicious-producers.py @@ -98,7 +98,7 @@ allowed-connection = any p2p-peer-address = localhost:9877 required-participation = true -private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] +private-key = ["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] producer-name = initu plugin = enumivo::producer_plugin plugin = enumivo::chain_api_plugin @@ -118,7 +118,7 @@ allowed-connection = any p2p-peer-address = localhost:9876 required-participation = true -private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] +private-key = ["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] producer-name = defproducerb plugin = enumivo::producer_plugin plugin = enumivo::chain_api_plugin diff --git a/tests/distributed-transactions-test.py b/tests/distributed-transactions-test.py index 05ea2c20f8b..ff6634689f2 100755 --- a/tests/distributed-transactions-test.py +++ b/tests/distributed-transactions-test.py @@ -80,7 +80,7 @@ def errorExit(msg="", errorCode=1): #exit(0) - Print("Stand up EOS wallet enuwallet") + Print("Stand up ENU wallet enuwallet") if walletMgr.launch() is False: errorExit("Failed to stand up enuwallet.") diff --git a/tests/enunode_run_test.py b/tests/enunode_run_test.py index ef84e47aa7d..b982ca33685 100755 --- a/tests/enunode_run_test.py +++ b/tests/enunode_run_test.py @@ -255,7 +255,7 @@ def cmdError(name, cmdCode=0, exitNow=False): if not node.verifyAccount(testeraAccount): errorExit("FAILURE - account creation failed.", raw=True) - transferAmount="97.5321 EOS" + transferAmount="97.5321 ENU" Print("Transfer funds %s from account %s to %s" % (transferAmount, defproduceraAccount.name, testeraAccount.name)) if node.transferFunds(defproduceraAccount, testeraAccount, transferAmount, "test transfer") is None: cmdError("%s transfer" % (ClientName)) @@ -269,7 +269,7 @@ def cmdError(name, cmdCode=0, exitNow=False): cmdError("FAILURE - transfer failed") errorExit("Transfer verification failed. Excepted %s, actual: %s" % (expectedAmount, actualAmount)) - transferAmount="0.0100 EOS" + transferAmount="0.0100 ENU" Print("Force transfer funds %s from account %s to %s" % ( transferAmount, defproduceraAccount.name, testeraAccount.name)) if node.transferFunds(defproduceraAccount, testeraAccount, transferAmount, "test transfer", force=True) is None: @@ -277,7 +277,7 @@ def cmdError(name, cmdCode=0, exitNow=False): errorExit("Failed to force transfer funds %d from account %s to %s" % ( transferAmount, defproduceraAccount.name, testeraAccount.name)) - expectedAmount="97.5421 EOS" + expectedAmount="97.5421 ENU" Print("Verify transfer, Expected: %s" % (expectedAmount)) actualAmount=node.getAccountEnuBalanceStr(testeraAccount.name) if expectedAmount != actualAmount: @@ -298,7 +298,7 @@ def cmdError(name, cmdCode=0, exitNow=False): cmdError("%s wallet unlock" % (ClientName)) errorExit("Failed to unlock wallet %s" % (testWallet.name)) - transferAmount="97.5311 EOS" + transferAmount="97.5311 ENU" Print("Transfer funds %s from account %s to %s" % ( transferAmount, testeraAccount.name, currencyAccount.name)) trans=node.transferFunds(testeraAccount, currencyAccount, transferAmount, "test transfer a->b") @@ -308,7 +308,7 @@ def cmdError(name, cmdCode=0, exitNow=False): transferAmount, testeraAccount.name, currencyAccount.name)) transId=testUtils.Node.getTransId(trans) - expectedAmount="98.0311 EOS" # 5000 initial deposit + expectedAmount="98.0311 ENU" # 5000 initial deposit Print("Verify transfer, Expected: %s" % (expectedAmount)) actualAmount=node.getAccountEnuBalanceStr(currencyAccount.name) if expectedAmount != actualAmount: @@ -447,7 +447,7 @@ def cmdError(name, cmdCode=0, exitNow=False): abiActionName=account["abi"]["actions"][0]["name"] abiType=account["abi"]["actions"][0]["type"] if abiName != "transfer" or abiActionName != "transfer" or abiType != "transfer": - errorExit("FAILURE - get EOS account failed", raw=True) + errorExit("FAILURE - get ENU account failed", raw=True) Print("push create action to currency1111 contract") contract="currency1111" diff --git a/tests/nodeos_run_test.py b/tests/nodeos_run_test.py index 4953bd7d3c4..50ed0fa4754 100644 --- a/tests/nodeos_run_test.py +++ b/tests/nodeos_run_test.py @@ -233,7 +233,7 @@ def cmdError(name, cmdCode=0, exitNow=False): if not node.verifyAccount(testeraAccount): errorExit("FAILURE - account creation failed.", raw=True) - transferAmount="97.5321 EOS" + transferAmount="97.5321 ENU" Print("Transfer funds %s from account %s to %s" % (transferAmount, defproduceraAccount.name, testeraAccount.name)) if node.transferFunds(defproduceraAccount, testeraAccount, transferAmount, "test transfer") is None: cmdError("%s transfer" % (ClientName)) @@ -247,7 +247,7 @@ def cmdError(name, cmdCode=0, exitNow=False): cmdError("FAILURE - transfer failed") errorExit("Transfer verification failed. Excepted %s, actual: %s" % (expectedAmount, actualAmount)) - transferAmount="0.0100 EOS" + transferAmount="0.0100 ENU" Print("Force transfer funds %s from account %s to %s" % ( transferAmount, defproduceraAccount.name, testeraAccount.name)) if node.transferFunds(defproduceraAccount, testeraAccount, transferAmount, "test transfer", force=True) is None: @@ -255,7 +255,7 @@ def cmdError(name, cmdCode=0, exitNow=False): errorExit("Failed to force transfer funds %d from account %s to %s" % ( transferAmount, defproduceraAccount.name, testeraAccount.name)) - expectedAmount="97.5421 EOS" + expectedAmount="97.5421 ENU" Print("Verify transfer, Expected: %s" % (expectedAmount)) actualAmount=node.getAccountEnuBalanceStr(testeraAccount.name) if expectedAmount != actualAmount: @@ -284,7 +284,7 @@ def cmdError(name, cmdCode=0, exitNow=False): cmdError("%s wallet unlock" % (ClientName)) errorExit("Failed to unlock wallet %s" % (testWallet.name)) - transferAmount="97.5311 EOS" + transferAmount="97.5311 ENU" Print("Transfer funds %s from account %s to %s" % ( transferAmount, testeraAccount.name, currencyAccount.name)) trans=node.transferFunds(testeraAccount, currencyAccount, transferAmount, "test transfer a->b") @@ -294,7 +294,7 @@ def cmdError(name, cmdCode=0, exitNow=False): transferAmount, testeraAccount.name, currencyAccount.name)) transId=testUtils.Node.getTransId(trans) - expectedAmount="98.0311 EOS" # 5000 initial deposit + expectedAmount="98.0311 ENU" # 5000 initial deposit Print("Verify transfer, Expected: %s" % (expectedAmount)) actualAmount=node.getAccountEnuBalanceStr(currencyAccount.name) if expectedAmount != actualAmount: @@ -433,7 +433,7 @@ def cmdError(name, cmdCode=0, exitNow=False): abiActionName=account["abi"]["actions"][0]["name"] abiType=account["abi"]["actions"][0]["type"] if abiName != "transfer" or abiActionName != "transfer" or abiType != "transfer": - errorExit("FAILURE - get EOS account failed", raw=True) + errorExit("FAILURE - get ENU account failed", raw=True) Print("push create action to currency1111 contract") contract="currency1111" diff --git a/tests/p2p_stress.py b/tests/p2p_stress.py index 14cc1a5d7b0..5d58407aff1 100644 --- a/tests/p2p_stress.py +++ b/tests/p2p_stress.py @@ -50,7 +50,7 @@ def execute(self, cmdInd, node, ta, enumivo): print("issue currency0000 into %s" % (acc1.name)) contract="enumivo" action="issue" - data="{\"to\":\"" + acc1.name + "\",\"quantity\":\"1000000.0000 EOS\"}" + data="{\"to\":\"" + acc1.name + "\",\"quantity\":\"1000000.0000 ENU\"}" opts="--permission enumivo@active" tr=node.pushMessage(contract, action, data, opts) trid = node.getTransId(tr[1]) diff --git a/tests/p2p_tests/dawn_515/test.sh b/tests/p2p_tests/dawn_515/test.sh index 32d43e52a53..b7ac5009268 100755 --- a/tests/p2p_tests/dawn_515/test.sh +++ b/tests/p2p_tests/dawn_515/test.sh @@ -22,7 +22,7 @@ http-server-address = 127.0.0.1:8888 block-log-dir = blocks p2p-listen-endpoint = 0.0.0.0:9876 allowed-connection = any -private-key = ['EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV','5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'] +private-key = ['ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV','5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'] send-whole-blocks = true readonly = 0 genesis-json = ./genesis.json diff --git a/tests/p2p_tests/pump/run_test.pl b/tests/p2p_tests/pump/run_test.pl index bb58be5d855..20bccce99f8 100755 --- a/tests/p2p_tests/pump/run_test.pl +++ b/tests/p2p_tests/pump/run_test.pl @@ -112,7 +112,7 @@ sub write_config { if (defined $producer) { print $cfg "enable-stale-production = true\n"; print $cfg "required-participation = true\n"; - print $cfg "private-key = [\"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\",\"5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3\"]\n"; + print $cfg "private-key = [\"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\",\"5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3\"]\n"; print $cfg "plugin = enumivo::producer_plugin\n"; print $cfg "plugin = enumivo::chain_api_plugin\n"; diff --git a/tests/testUtils.py b/tests/testUtils.py index 708395916b1..6c3bbd80d25 100755 --- a/tests/testUtils.py +++ b/tests/testUtils.py @@ -137,7 +137,7 @@ class Node(object): # pylint: disable=too-many-instance-attributes # pylint: disable=too-many-arguments - def __init__(self, host, port, pid=None, cmd=None, enableMongo=False, mongoHost="localhost", mongoPort=27017, mongoDb="EOStest"): + def __init__(self, host, port, pid=None, cmd=None, enableMongo=False, mongoHost="localhost", mongoPort=27017, mongoDb="ENUtest"): self.host=host self.port=port self.pid=pid @@ -537,7 +537,7 @@ def getMessageFromDb(self, transId, retry=True, silentErrors=False): # Create & initialize account and return creation transactions. Return transaction json object def createInitializeAccount(self, account, creatorAccount, stakedDeposit=1000, waitForTransBlock=False): - cmd='%s %s system newaccount -j %s %s %s %s --stake-net "100 EOS" --stake-cpu "100 EOS" --buy-ram-EOS "100 EOS"' % ( + cmd='%s %s system newaccount -j %s %s %s %s --stake-net "100 ENU" --stake-cpu "100 ENU" --buy-ram-ENU "100 ENU"' % ( Utils.EnuClientPath, self.endpointArgs, creatorAccount.name, account.name, account.ownerPublicKey, account.activePublicKey) @@ -553,7 +553,7 @@ def createInitializeAccount(self, account, creatorAccount, stakedDeposit=1000, w if stakedDeposit > 0: self.waitForTransIdOnNode(transId) # seems like account creation needs to be finlized before transfer can happen - trans = self.transferFunds(creatorAccount, account, "%0.04f EOS" % (stakedDeposit/10000), "init") + trans = self.transferFunds(creatorAccount, account, "%0.04f ENU" % (stakedDeposit/10000), "init") transId=Node.getTransId(trans) if waitForTransBlock and not self.waitForTransIdOnNode(transId): @@ -580,7 +580,7 @@ def createAccount(self, account, creatorAccount, stakedDeposit=1000, waitForTran if stakedDeposit > 0: self.waitForTransIdOnNode(transId) # seems like account creation needs to be finlized before transfer can happen - trans = self.transferFunds(creatorAccount, account, "%0.04f EOS" % (stakedDeposit/10000), "init") + trans = self.transferFunds(creatorAccount, account, "%0.04f ENU" % (stakedDeposit/10000), "init") transId=Node.getTransId(trans) if waitForTransBlock and not self.waitForTransIdOnNode(transId): @@ -786,7 +786,7 @@ def getServantsArr(self, name): return servants def getAccountEnuBalanceStr(self, scope): - """Returns EOS currency0000 account balance from enucli get table command. Returned balance is string following syntax "98.0311 EOS". """ + """Returns ENU currency0000 account balance from enucli get table command. Returned balance is string following syntax "98.0311 ENU". """ assert isinstance(scope, str) if not self.enableMongo: amount=self.getNodeAccountBalance("enumivo.coin", scope) @@ -806,7 +806,7 @@ def getAccountEnuBalanceStr(self, scope): return None def getAccountEnuBalance(self, scope): - """Returns EOS currency0000 account balance from enucli get table command. Returned balance is an integer e.g. 980311. """ + """Returns ENU currency0000 account balance from enucli get table command. Returned balance is an integer e.g. 980311. """ balanceStr=self.getAccountEnuBalanceStr(scope) balanceStr=balanceStr.split()[0] balance=int(decimal.Decimal(balanceStr[1:])*10000) @@ -1245,7 +1245,7 @@ class Cluster(object): # pylint: disable=too-many-arguments # walletd [True|False] Is enuwallet running. If not load the wallet plugin - def __init__(self, walletd=False, localCluster=True, host="localhost", port=8888, walletHost="localhost", walletPort=8899, enableMongo=False, mongoHost="localhost", mongoPort=27017, mongoDb="EOStest", defproduceraPrvtKey=None, defproducerbPrvtKey=None, staging=False): + def __init__(self, walletd=False, localCluster=True, host="localhost", port=8888, walletHost="localhost", walletPort=8899, enableMongo=False, mongoHost="localhost", mongoPort=27017, mongoDb="ENUtest", defproduceraPrvtKey=None, defproducerbPrvtKey=None, staging=False): """Cluster container. walletd [True|False] Is wallet enuwallet running. If not load the wallet plugin localCluster [True|False] Is cluster local to host. @@ -1773,7 +1773,7 @@ def parseClusterKeys(totalNodes): @staticmethod def bootstrap(totalNodes, prodCount, biosHost, biosPort, dontKill=False, onlyBios=False): - """Create 'prodCount' init accounts and deposits 10000000000 EOS in each. If prodCount is -1 will initialize all possible producers. + """Create 'prodCount' init accounts and deposits 10000000000 ENU in each. If prodCount is -1 will initialize all possible producers. Ensure nodes are inter-connected prior to this call. One way to validate this will be to check if every node has block 1.""" Utils.Print("Starting cluster bootstrap.") @@ -1927,7 +1927,7 @@ def bootstrap(totalNodes, prodCount, biosHost, biosPort, dontKill=False, onlyBio contract=enumivoTokenAccount.name Utils.Print("push create action to %s contract" % (contract)) action="create" - data="{\"issuer\":\"%s\",\"maximum_supply\":\"1000000000.0000 EOS\",\"can_freeze\":\"0\",\"can_recall\":\"0\",\"can_whitelist\":\"0\"}" % (enumivoTokenAccount.name) + data="{\"issuer\":\"%s\",\"maximum_supply\":\"1000000000.0000 ENU\",\"can_freeze\":\"0\",\"can_recall\":\"0\",\"can_whitelist\":\"0\"}" % (enumivoTokenAccount.name) opts="--permission %s@active" % (contract) trans=biosNode.pushMessage(contract, action, data, opts) if trans is None or not trans[0]: @@ -1941,7 +1941,7 @@ def bootstrap(totalNodes, prodCount, biosHost, biosPort, dontKill=False, onlyBio contract=enumivoTokenAccount.name Utils.Print("push issue action to %s contract" % (contract)) action="issue" - data="{\"to\":\"%s\",\"quantity\":\"1000000000.0000 EOS\",\"memo\":\"initial issue\"}" % (enumivoAccount.name) + data="{\"to\":\"%s\",\"quantity\":\"1000000000.0000 ENU\",\"memo\":\"initial issue\"}" % (enumivoAccount.name) opts="--permission %s@active" % (contract) trans=biosNode.pushMessage(contract, action, data, opts) if trans is None or not trans[0]: @@ -1953,7 +1953,7 @@ def bootstrap(totalNodes, prodCount, biosHost, biosPort, dontKill=False, onlyBio transId=Node.getTransId(trans[1]) biosNode.waitForTransIdOnNode(transId) - expectedAmount="1000000000.0000 EOS" + expectedAmount="1000000000.0000 ENU" Utils.Print("Verify enumivo issue, Expected: %s" % (expectedAmount)) actualAmount=biosNode.getAccountEnuBalanceStr(enumivoAccount.name) if expectedAmount != actualAmount: @@ -1973,7 +1973,7 @@ def bootstrap(totalNodes, prodCount, biosHost, biosPort, dontKill=False, onlyBio Node.validateTransaction(trans) - initialFunds="1000000.0000 EOS" + initialFunds="1000000.0000 ENU" Utils.Print("Transfer initial fund %s to individual accounts." % (initialFunds)) trans=None contract=enumivoTokenAccount.name diff --git a/unittests/abi_tests.cpp b/unittests/abi_tests.cpp index d5e116e9c20..090f94c9cfc 100644 --- a/unittests/abi_tests.cpp +++ b/unittests/abi_tests.cpp @@ -1868,10 +1868,10 @@ BOOST_AUTO_TEST_CASE(general) const char *my_other = R"=====( { - "publickey" : "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "publickey_arr" : ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], - "asset" : "100.0000 EOS", - "asset_arr" : ["100.0000 EOS","100.0000 EOS"], + "publickey" : "ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", + "publickey_arr" : ["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], + "asset" : "100.0000 ENU", + "asset_arr" : ["100.0000 ENU","100.0000 ENU"], "string" : "ola ke ase", "string_arr" : ["ola ke ase","ola ke desi"], @@ -2005,22 +2005,22 @@ BOOST_AUTO_TEST_CASE(general) "delay_sec":0, "transaction_extensions": [] }], - "keyweight": {"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"}, - "keyweight_arr": [{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"},{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"200"}], + "keyweight": {"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"}, + "keyweight_arr": [{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"},{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"200"}], "authority": { "threshold":"10", - "keys":[{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":100},{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":200}], + "keys":[{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":100},{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":200}], "accounts":[{"permission":{"actor":"acc1","permission":"permname1"},"weight":"1"},{"permission":{"actor":"acc2","permission":"permname2"},"weight":"2"}], "waits":[] }, "authority_arr": [{ "threshold":"10", - "keys":[{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"},{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"200"}], + "keys":[{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"},{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"200"}], "accounts":[{"permission":{"actor":"acc1","permission":"permname1"},"weight":"1"},{"permission":{"actor":"acc2","permission":"permname2"},"weight":"2"}], "waits":[] },{ "threshold":"10", - "keys":[{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"},{"key":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"200"}], + "keys":[{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"100"},{"key":"ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "weight":"200"}], "accounts":[{"permission":{"actor":"acc1","permission":"permname1"},"weight":"1"},{"permission":{"actor":"acc2","permission":"permname2"},"weight":"2"}], "waits":[] }], @@ -2200,8 +2200,8 @@ BOOST_AUTO_TEST_CASE(updateauth_test) "parent" : "updauth.prnt", "auth" : { "threshold" : "2147483145", - "keys" : [ {"key" : "EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005}, - {"key" : "EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ], + "keys" : [ {"key" : "ENU65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005}, + {"key" : "ENU5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ], "accounts" : [ {"permission" : {"actor" : "prm.acct1", "permission" : "prm.prm1"}, "weight" : 53005 }, {"permission" : {"actor" : "prm.acct2", "permission" : "prm.prm2"}, "weight" : 53405 } ], "waits" : [] @@ -2218,9 +2218,9 @@ BOOST_AUTO_TEST_CASE(updateauth_test) BOOST_TEST(2147483145u == updauth.auth.threshold); BOOST_TEST_REQUIRE(2 == updauth.auth.keys.size()); - BOOST_TEST("EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (std::string)updauth.auth.keys[0].key); + BOOST_TEST("ENU65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (std::string)updauth.auth.keys[0].key); BOOST_TEST(57005u == updauth.auth.keys[0].weight); - BOOST_TEST("EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)updauth.auth.keys[1].key); + BOOST_TEST("ENU5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)updauth.auth.keys[1].key); BOOST_TEST(57605u == updauth.auth.keys[1].weight); BOOST_TEST_REQUIRE(2 == updauth.auth.accounts.size()); @@ -2297,16 +2297,16 @@ BOOST_AUTO_TEST_CASE(newaccount_test) "name" : "newacct.name", "owner" : { "threshold" : 2147483145, - "keys" : [ {"key" : "EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005}, - {"key" : "EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ], + "keys" : [ {"key" : "ENU65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005}, + {"key" : "ENU5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ], "accounts" : [ {"permission" : {"actor" : "prm.acct1", "permission" : "prm.prm1"}, "weight" : 53005 }, {"permission" : {"actor" : "prm.acct2", "permission" : "prm.prm2"}, "weight" : 53405 }], "waits" : [] }, "active" : { "threshold" : 2146483145, - "keys" : [ {"key" : "EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005}, - {"key" : "EOS5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ], + "keys" : [ {"key" : "ENU65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im", "weight" : 57005}, + {"key" : "ENU5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf", "weight" : 57605} ], "accounts" : [ {"permission" : {"actor" : "prm.acct1", "permission" : "prm.prm1"}, "weight" : 53005 }, {"permission" : {"actor" : "prm.acct2", "permission" : "prm.prm2"}, "weight" : 53405 }], "waits" : [] @@ -2322,9 +2322,9 @@ BOOST_AUTO_TEST_CASE(newaccount_test) BOOST_TEST(2147483145u == newacct.owner.threshold); BOOST_TEST_REQUIRE(2 == newacct.owner.keys.size()); - BOOST_TEST("EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (std::string)newacct.owner.keys[0].key); + BOOST_TEST("ENU65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (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("ENU5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)newacct.owner.keys[1].key); BOOST_TEST(57605u == newacct.owner.keys[1].weight); BOOST_TEST_REQUIRE(2 == newacct.owner.accounts.size()); @@ -2338,9 +2338,9 @@ BOOST_AUTO_TEST_CASE(newaccount_test) BOOST_TEST(2146483145u == newacct.active.threshold); BOOST_TEST_REQUIRE(2 == newacct.active.keys.size()); - BOOST_TEST("EOS65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (std::string)newacct.active.keys[0].key); + BOOST_TEST("ENU65rXebLhtk2aTTzP4e9x1AQZs7c5NNXJp89W8R3HyaA6Zyd4im" == (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("ENU5eVr9TVnqwnUBNwf9kwMTbrHvX5aPyyEG97dz2b2TNeqWRzbJf" == (std::string)newacct.active.keys[1].key); BOOST_TEST(57605u == newacct.active.keys[1].weight); BOOST_TEST_REQUIRE(2 == newacct.active.accounts.size()); diff --git a/unittests/api_tests.cpp b/unittests/api_tests.cpp index 76d8c76c67f..321ada3a847 100644 --- a/unittests/api_tests.cpp +++ b/unittests/api_tests.cpp @@ -1645,7 +1645,7 @@ BOOST_FIXTURE_TEST_CASE(permission_tests, TESTER) { try { .account = N(testapi), .permission = N(active), .pubkeys = { - public_key_type(string("EOS7GfRtyDWWgxV88a5TRaYY59XmHptyfjsFmHHfioGNJtPjpSmGX")) + public_key_type(string("ENU7GfRtyDWWgxV88a5TRaYY59XmHptyfjsFmHHfioGNJtPjpSmGX")) } }) ); @@ -1657,7 +1657,7 @@ BOOST_FIXTURE_TEST_CASE(permission_tests, TESTER) { try { .permission = N(active), .pubkeys = { get_public_key(N(testapi), "active"), - public_key_type(string("EOS7GfRtyDWWgxV88a5TRaYY59XmHptyfjsFmHHfioGNJtPjpSmGX")) + public_key_type(string("ENU7GfRtyDWWgxV88a5TRaYY59XmHptyfjsFmHHfioGNJtPjpSmGX")) } }) ); diff --git a/unittests/bootseq_tests.cpp b/unittests/bootseq_tests.cpp index 847aaaee0c1..94b723d7c68 100644 --- a/unittests/bootseq_tests.cpp +++ b/unittests/bootseq_tests.cpp @@ -155,7 +155,7 @@ class bootseq_tester : public TESTER { } asset get_balance( const account_name& act ) { - return get_currency_balance(N(enumivo.coin), symbol(SY(4,EOS)), act); + return get_currency_balance(N(enumivo.coin), symbol(SY(4,ENU)), act); } void set_code_abi(const account_name& account, const char* wast, const char* abi, const private_key_type* signer = nullptr) { @@ -200,11 +200,11 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) { const auto& enumivo_coin_acc = get(N(enumivo.coin)); BOOST_TEST(enumivo_coin_acc.privileged == true); - // Create EOS tokens in enumivo.coin, set its manager as enumivo - 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 ENU tokens in enumivo.coin, set its manager as enumivo + auto max_supply = asset::from_string("10000000000.0000 ENU"); /// 1x larger than 1B initial tokens + auto initial_supply = asset::from_string("1000000000.0000 ENU"); /// 1x larger than 1B initial tokens create_currency(N(enumivo.coin), config::system_account_name, max_supply); - // Issue the genesis supply of 1 billion EOS tokens to enumivo.system + // Issue the genesis supply of 1 billion ENU tokens to enumivo.system issue(N(enumivo.coin), config::system_account_name, config::system_account_name, initial_supply); auto actual = get_balance(config::system_account_name); @@ -319,7 +319,7 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) { BOOST_REQUIRE(control->head_block_time().time_since_epoch() < first_june_2028); // This should thrown an error, since block one can only unstake all his stake after 10 years - BOOST_REQUIRE_THROW(undelegate_bandwidth(N(b1), N(b1), asset::from_string("49999500.0000 EOS"), asset::from_string("49999500.0000 EOS")), assert_exception); + BOOST_REQUIRE_THROW(undelegate_bandwidth(N(b1), N(b1), asset::from_string("49999500.0000 ENU"), asset::from_string("49999500.0000 ENU")), assert_exception); // Skip 10 years produce_block(first_june_2028 - control->head_block_time().time_since_epoch()); @@ -328,7 +328,7 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) { register_producer(pro); } // Block one should be able to unstake all his stake now - undelegate_bandwidth(N(b1), N(b1), asset::from_string("49999500.0000 EOS"), asset::from_string("49999500.0000 EOS")); + undelegate_bandwidth(N(b1), N(b1), asset::from_string("49999500.0000 ENU"), asset::from_string("49999500.0000 ENU")); return; produce_blocks(7000); /// produce blocks until virutal bandwidth can acomadate a small user diff --git a/unittests/currency_tests.cpp b/unittests/currency_tests.cpp index 8d69f5ee1f8..d1d063766d2 100644 --- a/unittests/currency_tests.cpp +++ b/unittests/currency_tests.cpp @@ -275,18 +275,18 @@ BOOST_FIXTURE_TEST_CASE(test_symbol, TESTER) try { } { - symbol enu(4, "EOS"); + symbol enu(4, "ENU"); BOOST_REQUIRE_EQUAL(ENU_SYMBOL_VALUE, enu.value()); - BOOST_REQUIRE_EQUAL("4,EOS", enu.to_string()); - BOOST_REQUIRE_EQUAL("EOS", enu.name()); + BOOST_REQUIRE_EQUAL("4,ENU", enu.to_string()); + BOOST_REQUIRE_EQUAL("ENU", enu.name()); BOOST_REQUIRE_EQUAL(4, enu.decimals()); } - // default is "4,EOS" + // default is "4,ENU" { symbol def; BOOST_REQUIRE_EQUAL(4, def.decimals()); - BOOST_REQUIRE_EQUAL("EOS", def.name()); + BOOST_REQUIRE_EQUAL("ENU", def.name()); } // from string { diff --git a/unittests/dice_tests.cpp b/unittests/dice_tests.cpp index 846aebb9065..d7962759318 100644 --- a/unittests/dice_tests.cpp +++ b/unittests/dice_tests.cpp @@ -237,18 +237,18 @@ BOOST_FIXTURE_TEST_CASE( dice_test, dice_tester ) try { push_action(N(enumivo.coin), N(create), N(enumivo.coin), mvo() ("issuer", "enumivo.coin") - ("maximum_supply", "1000000000.0000 EOS") + ("maximum_supply", "1000000000.0000 ENU") ); push_action(N(enumivo.coin), N(issue), N(enumivo.coin), mvo() ("to", "enumivo") - ("quantity", "1000000000.0000 EOS") + ("quantity", "1000000000.0000 ENU") ("memo", "") ); - transfer( N(enumivo), N(alice), "10000.0000 EOS", "", N(enumivo.coin) ); - transfer( N(enumivo), N(bob), "10000.0000 EOS", "", N(enumivo.coin) ); - transfer( N(enumivo), N(carol), "10000.0000 EOS", "", N(enumivo.coin) ); + transfer( N(enumivo), N(alice), "10000.0000 ENU", "", N(enumivo.coin) ); + transfer( N(enumivo), N(bob), "10000.0000 ENU", "", N(enumivo.coin) ); + transfer( N(enumivo), N(carol), "10000.0000 ENU", "", N(enumivo.coin) ); produce_block(); @@ -257,54 +257,54 @@ BOOST_FIXTURE_TEST_CASE( dice_test, dice_tester ) try { produce_block(); - // Alice deposits 1000 EOS - deposit( N(alice), asset::from_string("1000.0000 EOS")); + // Alice deposits 1000 ENU + deposit( N(alice), asset::from_string("1000.0000 ENU")); produce_block(); - BOOST_REQUIRE_EQUAL( balance_of(N(alice)), asset::from_string("1000.0000 EOS")); + BOOST_REQUIRE_EQUAL( balance_of(N(alice)), asset::from_string("1000.0000 ENU")); BOOST_REQUIRE_EQUAL( open_games(N(alice)), 0); - // Alice tries to bet 0 EOS (fail) + // Alice tries to bet 0 ENU (fail) // secret : 9b886346e1351d4144d0b8392a975612eb0f8b6de7eae1cc9bcc55eb52be343c - BOOST_CHECK_THROW( offer_bet( N(alice), asset::from_string("0.0000 EOS"), + BOOST_CHECK_THROW( offer_bet( N(alice), asset::from_string("0.0000 ENU"), commitment_for("9b886346e1351d4144d0b8392a975612eb0f8b6de7eae1cc9bcc55eb52be343c") ), fc::exception); - // Alice bets 10 EOS (success) + // Alice bets 10 ENU (success) // secret : 0ba044d2833758ee2c8f24d8a3f70c82c334abe6ce13219a4cf3b862abb03c46 - offer_bet( N(alice), asset::from_string("10.0000 EOS"), + offer_bet( N(alice), asset::from_string("10.0000 ENU"), commitment_for("0ba044d2833758ee2c8f24d8a3f70c82c334abe6ce13219a4cf3b862abb03c46") ); produce_block(); // Bob tries to bet using a secret previously used by Alice (fail) // secret : 00000000000000000000000000000002c334abe6ce13219a4cf3b862abb03c46 - BOOST_CHECK_THROW( offer_bet( N(bob), asset::from_string("10.0000 EOS"), + BOOST_CHECK_THROW( offer_bet( N(bob), asset::from_string("10.0000 ENU"), commitment_for("0ba044d2833758ee2c8f24d8a3f70c82c334abe6ce13219a4cf3b862abb03c46") ), fc::exception); produce_block(); - // Alice tries to bet 1000 EOS (fail) + // Alice tries to bet 1000 ENU (fail) // secret : a512f6b1b589a8906d574e9de74a529e504a5c53a760f0991a3e00256c027971 - BOOST_CHECK_THROW( offer_bet( N(alice), asset::from_string("1000.0000 EOS"), + BOOST_CHECK_THROW( offer_bet( N(alice), asset::from_string("1000.0000 ENU"), commitment_for("a512f6b1b589a8906d574e9de74a529e504a5c53a760f0991a3e00256c027971") ), fc::exception); produce_block(); - // Bob tries to bet 90 EOS without deposit + // Bob tries to bet 90 ENU without deposit // secret : 4facfc98932dde46fdc4403125a16337f6879a842a7ff8b0dc8e1ecddd59f3c8 - BOOST_CHECK_THROW( offer_bet( N(bob), asset::from_string("90.0000 EOS"), + BOOST_CHECK_THROW( offer_bet( N(bob), asset::from_string("90.0000 ENU"), commitment_for("4facfc98932dde46fdc4403125a16337f6879a842a7ff8b0dc8e1ecddd59f3c8") ), fc::exception); produce_block(); - // Bob deposits 500 EOS - deposit( N(bob), asset::from_string("500.0000 EOS")); - BOOST_REQUIRE_EQUAL( balance_of(N(bob)), asset::from_string("500.0000 EOS")); + // Bob deposits 500 ENU + deposit( N(bob), asset::from_string("500.0000 ENU")); + BOOST_REQUIRE_EQUAL( balance_of(N(bob)), asset::from_string("500.0000 ENU")); - // Bob bets 11 EOS (success) + // Bob bets 11 ENU (success) // secret : eec3272712d974c474a3e7b4028b53081344a5f50008e9ccf918ba0725a8d784 - offer_bet( N(bob), asset::from_string("11.0000 EOS"), + offer_bet( N(bob), asset::from_string("11.0000 ENU"), commitment_for("eec3272712d974c474a3e7b4028b53081344a5f50008e9ccf918ba0725a8d784") ); produce_block(); @@ -314,12 +314,12 @@ BOOST_FIXTURE_TEST_CASE( dice_test, dice_tester ) try { cancel_offer( N(bob), commitment_for("eec3272712d974c474a3e7b4028b53081344a5f50008e9ccf918ba0725a8d784") ); BOOST_REQUIRE_EQUAL( open_offers(N(bob)), 0); - // Carol deposits 300 EOS - deposit( N(carol), asset::from_string("300.0000 EOS")); + // Carol deposits 300 ENU + deposit( N(carol), asset::from_string("300.0000 ENU")); - // Carol bets 10 EOS (success) + // Carol bets 10 ENU (success) // secret : 3efb4bd5e19b780f4980c919330c0306f8157f93db1fc72c7cefec63e0e7f37a - offer_bet( N(carol), asset::from_string("10.0000 EOS"), + offer_bet( N(carol), asset::from_string("10.0000 ENU"), commitment_for("3efb4bd5e19b780f4980c919330c0306f8157f93db1fc72c7cefec63e0e7f37a") ); produce_block(); @@ -330,7 +330,7 @@ BOOST_FIXTURE_TEST_CASE( dice_test, dice_tester ) try { BOOST_REQUIRE_EQUAL( open_games(N(carol)), 1); BOOST_REQUIRE_EQUAL( open_offers(N(carol)), 0); - BOOST_REQUIRE_EQUAL( game_bet(1), asset::from_string("10.0000 EOS")); + BOOST_REQUIRE_EQUAL( game_bet(1), asset::from_string("10.0000 ENU")); // Alice tries to cancel a nonexistent bet (fail) @@ -376,31 +376,31 @@ BOOST_FIXTURE_TEST_CASE( dice_test, dice_tester ) try { BOOST_REQUIRE_EQUAL( open_games(N(alice)), 0); BOOST_REQUIRE_EQUAL( open_offers(N(alice)), 0); - BOOST_REQUIRE_EQUAL( balance_of(N(alice)), asset::from_string("1010.0000 EOS")); + BOOST_REQUIRE_EQUAL( balance_of(N(alice)), asset::from_string("1010.0000 ENU")); BOOST_REQUIRE_EQUAL( open_games(N(carol)), 0); BOOST_REQUIRE_EQUAL( open_offers(N(carol)), 0); - BOOST_REQUIRE_EQUAL( balance_of(N(carol)), asset::from_string("290.0000 EOS")); + BOOST_REQUIRE_EQUAL( balance_of(N(carol)), asset::from_string("290.0000 ENU")); - // Alice withdraw 1009 EOS (success) - withdraw( N(alice), asset::from_string("1009.0000 EOS")); - BOOST_REQUIRE_EQUAL( balance_of(N(alice)), asset::from_string("1.0000 EOS")); + // Alice withdraw 1009 ENU (success) + withdraw( N(alice), asset::from_string("1009.0000 ENU")); + BOOST_REQUIRE_EQUAL( balance_of(N(alice)), asset::from_string("1.0000 ENU")); BOOST_REQUIRE_EQUAL( get_currency_balance(N(enumivo.coin), ENU_SYMBOL, N(alice)), - asset::from_string("10009.0000 EOS") + asset::from_string("10009.0000 ENU") ); - // Alice withdraw 2 EOS (fail) - BOOST_CHECK_THROW( withdraw( N(alice), asset::from_string("2.0000 EOS")), + // Alice withdraw 2 ENU (fail) + BOOST_CHECK_THROW( withdraw( N(alice), asset::from_string("2.0000 ENU")), fc::exception); - // Alice withdraw 1 EOS (success) - withdraw( N(alice), asset::from_string("1.0000 EOS")); + // Alice withdraw 1 ENU (success) + withdraw( N(alice), asset::from_string("1.0000 ENU")); BOOST_REQUIRE_EQUAL( get_currency_balance(N(enumivo.coin), ENU_SYMBOL, N(alice)), - asset::from_string("10010.0000 EOS") + asset::from_string("10010.0000 ENU") ); // Verify alice account was deleted diff --git a/unittests/enumivo.system_tests.cpp b/unittests/enumivo.system_tests.cpp index 6c940a2d019..953baaaefc2 100644 --- a/unittests/enumivo.system_tests.cpp +++ b/unittests/enumivo.system_tests.cpp @@ -53,9 +53,9 @@ class enumivo_system_tester : public TESTER { token_abi_ser.set_abi(abi); } - create_currency( N(enumivo.coin), config::system_account_name, asset::from_string("10000000000.0000 EOS") ); - issue(config::system_account_name, "1000000000.0000 EOS"); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); + create_currency( N(enumivo.coin), config::system_account_name, asset::from_string("10000000000.0000 ENU") ); + issue(config::system_account_name, "1000000000.0000 ENU"); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); set_code( config::system_account_name, enumivo_system_wast ); set_abi( config::system_account_name, enumivo_system_abi ); @@ -69,11 +69,11 @@ class enumivo_system_tester : public TESTER { produce_blocks(); - create_account_with_resources( N(alice1111111), N(enumivo), asset::from_string("1.0000 EOS"), false ); - create_account_with_resources( N(bob111111111), N(enumivo), asset::from_string("0.4500 EOS"), false ); - create_account_with_resources( N(carol1111111), N(enumivo), asset::from_string("1.0000 EOS"), false ); + create_account_with_resources( N(alice1111111), N(enumivo), asset::from_string("1.0000 ENU"), false ); + create_account_with_resources( N(bob111111111), N(enumivo), asset::from_string("0.4500 ENU"), false ); + create_account_with_resources( N(carol1111111), N(enumivo), asset::from_string("1.0000 ENU"), false ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); } @@ -108,8 +108,8 @@ class enumivo_system_tester : public TESTER { mvo() ("from", creator) ("receiver", a) - ("stake_net_quantity", "10.0000 EOS" ) - ("stake_cpu_quantity", "10.0000 EOS" ) + ("stake_net_quantity", "10.0000 ENU" ) + ("stake_cpu_quantity", "10.0000 ENU" ) ("transfer", 0 ) ) ); @@ -120,7 +120,7 @@ class enumivo_system_tester : public TESTER { } transaction_trace_ptr create_account_with_resources( account_name a, account_name creator, asset ramfunds, bool multisig, - asset net = asset::from_string("10.0000 EOS"), asset cpu = asset::from_string("10.0000 EOS") ) { + asset net = asset::from_string("10.0000 ENU"), asset cpu = asset::from_string("10.0000 ENU") ) { signed_transaction trx; set_transaction_headers(trx); @@ -166,9 +166,9 @@ class enumivo_system_tester : public TESTER { account_name creator(N(enumivo)); signed_transaction trx; set_transaction_headers(trx); - asset cpu = asset::from_string("80.0000 EOS"); - asset net = asset::from_string("80.0000 EOS"); - asset ram = asset::from_string("1.0000 EOS"); + asset cpu = asset::from_string("80.0000 ENU"); + asset net = asset::from_string("80.0000 ENU"); + asset ram = asset::from_string("1.0000 ENU"); for (const auto& a: accounts) { authority owner_auth( get_public_key( a, "owner" ) ); @@ -306,8 +306,8 @@ class enumivo_system_tester : public TESTER { } asset get_balance( const account_name& act ) { - vector data = get_row_by_account( N(enumivo.coin), act, N(accounts), symbol(SY(4,EOS)).to_symbol_code().value ); - return data.empty() ? asset(0, symbol(SY(4,EOS))) : token_abi_ser.binary_to_variant("account", data)["balance"].as(); + vector data = get_row_by_account( N(enumivo.coin), act, N(accounts), symbol(SY(4,ENU)).to_symbol_code().value ); + return data.empty() ? asset(0, symbol(SY(4,ENU))) : token_abi_ser.binary_to_variant("account", data)["balance"].as(); } fc::variant get_total_stake( const account_name& act ) { @@ -366,7 +366,7 @@ class enumivo_system_tester : public TESTER { } asset get_token_supply() { - return get_stats("4,EOS")["supply"].as(); + return get_stats("4,ENU")["supply"].as(); } fc::variant get_global_state() { @@ -415,17 +415,17 @@ BOOST_AUTO_TEST_SUITE(enumivo_system_tests) BOOST_FIXTURE_TEST_CASE( buysell, enumivo_system_tester ) try { - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 ENU"), get_balance( "alice1111111" ) ); - transfer( "enumivo", "alice1111111", "1000.0000 EOS", "enumivo" ); - BOOST_REQUIRE_EQUAL( success(), stake( "enumivo", "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); + transfer( "enumivo", "alice1111111", "1000.0000 ENU", "enumivo" ); + BOOST_REQUIRE_EQUAL( success(), stake( "enumivo", "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); auto total = get_total_stake( "alice1111111" ); auto init_bytes = total["ram_bytes"].as_uint64(); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "200.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("800.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "200.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("800.0000 ENU"), get_balance( "alice1111111" ) ); total = get_total_stake( "alice1111111" ); auto bytes = total["ram_bytes"].as_uint64(); @@ -435,13 +435,13 @@ BOOST_FIXTURE_TEST_CASE( buysell, enumivo_system_tester ) try { BOOST_REQUIRE_EQUAL( true, 0 < bought_bytes ); BOOST_REQUIRE_EQUAL( success(), sellram( "alice1111111", bought_bytes ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("999.9999 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("999.9999 ENU"), get_balance( "alice1111111" ) ); total = get_total_stake( "alice1111111" ); BOOST_REQUIRE_EQUAL( true, total["ram_bytes"].as_uint64() == init_bytes ); - transfer( "enumivo", "alice1111111", "100000000.0000 EOS", "enumivo" ); - BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9999 EOS"), get_balance( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 EOS" ) ); + transfer( "enumivo", "alice1111111", "100000000.0000 ENU", "enumivo" ); + BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9999 ENU"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 ENU" ) ); total = get_total_stake( "alice1111111" ); bytes = total["ram_bytes"].as_uint64(); @@ -456,19 +456,19 @@ BOOST_FIXTURE_TEST_CASE( buysell, enumivo_system_tester ) try { wdump((init_bytes)(bought_bytes)(bytes) ); BOOST_REQUIRE_EQUAL( true, total["ram_bytes"].as_uint64() == init_bytes ); - BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9993 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9993 ENU"), get_balance( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "30.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("100000439.9993 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "30.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("100000439.9993 ENU"), get_balance( "alice1111111" ) ); auto newtotal = get_total_stake( "alice1111111" ); @@ -477,22 +477,22 @@ BOOST_FIXTURE_TEST_CASE( buysell, enumivo_system_tester ) try { wdump((newbytes)(bytes)(bought_bytes) ); BOOST_REQUIRE_EQUAL( success(), sellram( "alice1111111", bought_bytes ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9991 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9991 ENU"), get_balance( "alice1111111" ) ); newtotal = get_total_stake( "alice1111111" ); auto startbytes = newtotal["ram_bytes"].as_uint64(); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "300000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("49400999.9991 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "10000000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "100000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", "300000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("49400999.9991 ENU"), get_balance( "alice1111111" ) ); auto finaltotal = get_total_stake( "alice1111111" ); auto endbytes = finaltotal["ram_bytes"].as_uint64(); @@ -502,127 +502,127 @@ BOOST_FIXTURE_TEST_CASE( buysell, enumivo_system_tester ) try { BOOST_REQUIRE_EQUAL( success(), sellram( "alice1111111", bought_bytes ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9943 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9943 ENU"), get_balance( "alice1111111" ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( stake_unstake, enumivo_system_tester ) try { - //issue( "enumivo", "1000.0000 EOS", config::system_account_name ); + //issue( "enumivo", "1000.0000 ENU", config::system_account_name ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 EOS"), get_balance( "alice1111111" ) ); - transfer( "enumivo", "alice1111111", "1000.0000 EOS", "enumivo" ); - BOOST_REQUIRE_EQUAL( asset::from_string("999999000.0000 EOS"), get_balance( "enumivo" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 EOS"), get_balance( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( success(), stake( "enumivo", "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 ENU"), get_balance( "alice1111111" ) ); + transfer( "enumivo", "alice1111111", "1000.0000 ENU", "enumivo" ); + BOOST_REQUIRE_EQUAL( asset::from_string("999999000.0000 ENU"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 ENU"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "enumivo", "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); auto total = get_total_stake("alice1111111"); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["cpu_weight"].as()); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); produce_block( fc::hours(3*24-1) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); //after 3 days funds should be released produce_block( fc::hours(1) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 ENU"), get_balance( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "200.0000 EOS", "100.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "200.0000 ENU", "100.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); total = get_total_stake("bob111111111"); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["cpu_weight"].as()); total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS").amount, total["net_weight"].as().amount ); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS").amount, total["cpu_weight"].as().amount ); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU").amount, total["net_weight"].as().amount ); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU").amount, total["cpu_weight"].as().amount ); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 EOS"), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 ENU"), get_voter_info( "alice1111111" ) ); auto bytes = total["ram_bytes"].as_uint64(); BOOST_REQUIRE_EQUAL( true, 0 < bytes ); //unstake from bob111111111 - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "bob111111111", "200.0000 EOS", "100.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "bob111111111", "200.0000 ENU", "100.0000 ENU" ) ); total = get_total_stake("bob111111111"); - BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 ENU"), total["cpu_weight"].as()); produce_block( fc::hours(3*24-1) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); //after 3 days funds should be released produce_block( fc::hours(1) ); produce_blocks(1); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "0.0000 EOS" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "0.0000 ENU" ), get_voter_info( "alice1111111" ) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 ENU"), get_balance( "alice1111111" ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( stake_unstake_with_transfer, enumivo_system_tester ) try { - //issue( "enumivo", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 EOS"), get_balance( "alice1111111" ) ); + //issue( "enumivo", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 ENU"), get_balance( "alice1111111" ) ); //enumivo stakes for alice with transfer flag - BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "enumivo", "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "enumivo", "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); //check that alice has both bandwidth and voting power auto total = get_total_stake("alice1111111"); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["cpu_weight"].as()); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 EOS"), get_voter_info( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["cpu_weight"].as()); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 ENU"), get_voter_info( "alice1111111" ) ); - //BOOST_REQUIRE_EQUAL( asset::from_string("999999700.0000 EOS"), get_balance( "enumivo" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 EOS"), get_balance( "alice1111111" ) ); + //BOOST_REQUIRE_EQUAL( asset::from_string("999999700.0000 ENU"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 ENU"), get_balance( "alice1111111" ) ); //alice stakes for herself - transfer( "enumivo", "alice1111111", "1000.0000 EOS", "enumivo" ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); + transfer( "enumivo", "alice1111111", "1000.0000 ENU", "enumivo" ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); //now alice's stake should be equal to transfered from enumivo + own stake total = get_total_stake("alice1111111"); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("410.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["cpu_weight"].as()); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "600.0000 EOS"), get_voter_info( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("410.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["cpu_weight"].as()); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "600.0000 ENU"), get_voter_info( "alice1111111" ) ); //alice can unstake everything (including what was transfered) - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "alice1111111", "400.0000 EOS", "200.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "alice1111111", "400.0000 ENU", "200.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); produce_block( fc::hours(3*24-1) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); //after 3 days funds should be released produce_block( fc::hours(1) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("1300.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1300.0000 ENU"), get_balance( "alice1111111" ) ); //stake should be equal to what was staked in constructor, votring power should be 0 total = get_total_stake("alice1111111"); - BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 EOS"), total["cpu_weight"].as()); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "0.0000 EOS"), get_voter_info( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("10.0000 ENU"), total["cpu_weight"].as()); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "0.0000 ENU"), get_voter_info( "alice1111111" ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( fail_without_auth, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "enumivo", "alice1111111", "2000.0000 EOS", "1000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "10.0000 EOS", "10.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "enumivo", "alice1111111", "2000.0000 ENU", "1000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "10.0000 ENU", "10.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( error("missing authority of alice1111111"), push_action( N(alice1111111), N(delegatebw), mvo() ("from", "alice1111111") ("receiver", "bob111111111") - ("stake_net_quantity", "10.0000 EOS") - ("stake_cpu_quantity", "10.0000 EOS") + ("stake_net_quantity", "10.0000 ENU") + ("stake_cpu_quantity", "10.0000 ENU") ("transfer", 0 ) ,false ) @@ -632,8 +632,8 @@ BOOST_FIXTURE_TEST_CASE( fail_without_auth, enumivo_system_tester ) try { push_action(N(alice1111111), N(undelegatebw), mvo() ("from", "alice1111111") ("receiver", "bob111111111") - ("unstake_net_quantity", "200.0000 EOS") - ("unstake_cpu_quantity", "100.0000 EOS") + ("unstake_net_quantity", "200.0000 ENU") + ("unstake_cpu_quantity", "100.0000 ENU") ("transfer", 0 ) ,false ) @@ -643,22 +643,22 @@ BOOST_FIXTURE_TEST_CASE( fail_without_auth, enumivo_system_tester ) try { BOOST_FIXTURE_TEST_CASE( stake_negative, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must stake a positive amount"), - stake( "alice1111111", "-0.0001 EOS", "0.0000 EOS" ) + stake( "alice1111111", "-0.0001 ENU", "0.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must stake a positive amount"), - stake( "alice1111111", "0.0000 EOS", "-0.0001 EOS" ) + stake( "alice1111111", "0.0000 ENU", "-0.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must stake a positive amount"), - stake( "alice1111111", "00.0000 EOS", "00.0000 EOS" ) + stake( "alice1111111", "00.0000 ENU", "00.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must stake a positive amount"), - stake( "alice1111111", "0.0000 EOS", "00.0000 EOS" ) + stake( "alice1111111", "0.0000 ENU", "00.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( true, get_voter_info( "alice1111111" ).is_null() ); @@ -666,190 +666,190 @@ BOOST_FIXTURE_TEST_CASE( stake_negative, enumivo_system_tester ) try { BOOST_FIXTURE_TEST_CASE( unstake_negative, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "200.0001 EOS", "100.0001 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "200.0001 ENU", "100.0001 ENU" ) ); auto total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0001 EOS"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0001 ENU"), total["net_weight"].as()); auto vinfo = get_voter_info("alice1111111" ); wdump((vinfo)); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0002 EOS" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0002 ENU" ), get_voter_info( "alice1111111" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must unstake a positive amount"), - unstake( "alice1111111", "bob111111111", "-1.0000 EOS", "0.0000 EOS" ) + unstake( "alice1111111", "bob111111111", "-1.0000 ENU", "0.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must unstake a positive amount"), - unstake( "alice1111111", "bob111111111", "0.0000 EOS", "-1.0000 EOS" ) + unstake( "alice1111111", "bob111111111", "0.0000 ENU", "-1.0000 ENU" ) ); //unstake all zeros BOOST_REQUIRE_EQUAL( error("condition: assertion failed: must unstake a positive amount"), - unstake( "alice1111111", "bob111111111", "0.0000 EOS", "0.0000 EOS" ) + unstake( "alice1111111", "bob111111111", "0.0000 ENU", "0.0000 ENU" ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( unstake_more_than_at_stake, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "200.0000 EOS", "100.0000 EOS" ) ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "200.0000 ENU", "100.0000 ENU" ) ); auto total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["cpu_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); //trying to unstake more net bandwith than at stake BOOST_REQUIRE_EQUAL( error("condition: assertion failed: insufficient staked net bandwidth"), - unstake( "alice1111111", "200.0001 EOS", "0.0000 EOS" ) + unstake( "alice1111111", "200.0001 ENU", "0.0000 ENU" ) ); //trying to unstake more cpu bandwith than at stake BOOST_REQUIRE_EQUAL( error("condition: assertion failed: insufficient staked cpu bandwidth"), - unstake( "alice1111111", "0.0000 EOS", "100.0001 EOS" ) + unstake( "alice1111111", "0.0000 ENU", "100.0001 ENU" ) ); //check that nothing has changed total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["cpu_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( delegate_to_another_user, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake ( "alice1111111", "bob111111111", "200.0000 EOS", "100.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake ( "alice1111111", "bob111111111", "200.0000 ENU", "100.0000 ENU" ) ); auto total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["cpu_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("210.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); //all voting power goes to alice1111111 - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 EOS" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 ENU" ), get_voter_info( "alice1111111" ) ); //but not to bob111111111 BOOST_REQUIRE_EQUAL( true, get_voter_info( "bob111111111" ).is_null() ); //bob111111111 should not be able to unstake what was staked by alice1111111 BOOST_REQUIRE_EQUAL( error("condition: assertion failed: unable to find key"), - unstake( "bob111111111", "0.0000 EOS", "10.0000 EOS" ) + unstake( "bob111111111", "0.0000 ENU", "10.0000 ENU" ) ); - issue( "carol1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "bob111111111", "20.0000 EOS", "10.0000 EOS" ) ); + issue( "carol1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "bob111111111", "20.0000 ENU", "10.0000 ENU" ) ); total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 EOS"), total["cpu_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("970.0000 EOS"), get_balance( "carol1111111" ) ); - REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "30.0000 EOS" ), get_voter_info( "carol1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 ENU"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("970.0000 ENU"), get_balance( "carol1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "30.0000 ENU" ), get_voter_info( "carol1111111" ) ); //alice1111111 should not be able to unstake money staked by carol1111111 BOOST_REQUIRE_EQUAL( error("condition: assertion failed: insufficient staked net bandwidth"), - unstake( "alice1111111", "bob111111111", "2001.0000 EOS", "1.0000 EOS" ) + unstake( "alice1111111", "bob111111111", "2001.0000 ENU", "1.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: insufficient staked cpu bandwidth"), - unstake( "alice1111111", "bob111111111", "1.0000 EOS", "101.0000 EOS" ) + unstake( "alice1111111", "bob111111111", "1.0000 ENU", "101.0000 ENU" ) ); total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 ENU"), total["cpu_weight"].as()); //balance should not change after unsuccessfull attempts to unstake - BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("700.0000 ENU"), get_balance( "alice1111111" ) ); //voting power too - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 EOS" ), get_voter_info( "alice1111111" ) ); - REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "30.0000 EOS" ), get_voter_info( "carol1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 ENU" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "30.0000 ENU" ), get_voter_info( "carol1111111" ) ); BOOST_REQUIRE_EQUAL( true, get_voter_info( "bob111111111" ).is_null() ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( stake_unstake_separate, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 EOS"), get_balance( "alice1111111" ) ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 ENU"), get_balance( "alice1111111" ) ); //everything at once - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "10.0000 EOS", "20.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "10.0000 ENU", "20.0000 ENU" ) ); auto total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("20.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("30.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("20.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("30.0000 ENU"), total["cpu_weight"].as()); //cpu - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "100.0000 EOS", "0.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "100.0000 ENU", "0.0000 ENU" ) ); total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("30.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("30.0000 ENU"), total["cpu_weight"].as()); //net - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "0.0000 EOS", "200.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "0.0000 ENU", "200.0000 ENU" ) ); total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("120.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 ENU"), total["cpu_weight"].as()); //unstake cpu - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "100.0000 EOS", "0.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "100.0000 ENU", "0.0000 ENU" ) ); total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("20.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("20.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("230.0000 ENU"), total["cpu_weight"].as()); //unstake net - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "0.0000 EOS", "200.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "0.0000 ENU", "200.0000 ENU" ) ); total = get_total_stake( "alice1111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("20.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("30.0000 EOS"), total["cpu_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("20.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("30.0000 ENU"), total["cpu_weight"].as()); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( adding_stake_partial_unstake, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "200.0000 EOS", "100.0000 EOS" ) ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "200.0000 ENU", "100.0000 ENU" ) ); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 EOS" ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "300.0000 ENU" ), get_voter_info( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "100.0000 EOS", "50.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "bob111111111", "100.0000 ENU", "50.0000 ENU" ) ); auto total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("310.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("160.0000 EOS"), total["cpu_weight"].as()); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "450.0000 EOS" ), get_voter_info( "alice1111111" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("550.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("310.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("160.0000 ENU"), total["cpu_weight"].as()); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "450.0000 ENU" ), get_voter_info( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("550.0000 ENU"), get_balance( "alice1111111" ) ); //unstake a share - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "bob111111111", "150.0000 EOS", "75.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "bob111111111", "150.0000 ENU", "75.0000 ENU" ) ); total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("160.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("85.0000 EOS"), total["cpu_weight"].as()); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "225.0000 EOS" ), get_voter_info( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("160.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("85.0000 ENU"), total["cpu_weight"].as()); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "225.0000 ENU" ), get_voter_info( "alice1111111" ) ); //unstake more - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "bob111111111", "50.0000 EOS", "25.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "bob111111111", "50.0000 ENU", "25.0000 ENU" ) ); total = get_total_stake( "bob111111111" ); - BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 EOS"), total["net_weight"].as()); - BOOST_REQUIRE_EQUAL( asset::from_string("60.0000 EOS"), total["cpu_weight"].as()); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "150.0000 EOS" ), get_voter_info( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("110.0000 ENU"), total["net_weight"].as()); + BOOST_REQUIRE_EQUAL( asset::from_string("60.0000 ENU"), total["cpu_weight"].as()); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111", "150.0000 ENU" ), get_voter_info( "alice1111111" ) ); //combined amount should be available only in 3 days produce_block( fc::days(2) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("550.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("550.0000 ENU"), get_balance( "alice1111111" ) ); produce_block( fc::days(1) ); produce_blocks(1); - BOOST_REQUIRE_EQUAL( asset::from_string("850.0000 EOS"), get_balance( "alice1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("850.0000 ENU"), get_balance( "alice1111111" ) ); } FC_LOG_AND_RETHROW() // Tests for voting BOOST_FIXTURE_TEST_CASE( producer_register_unregister, enumivo_system_tester ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); fc::variant params = producer_parameters_example(1); - auto key = fc::crypto::public_key( std::string("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV") ); + auto key = fc::crypto::public_key( std::string("ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV") ); BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") ("producer_key", key ) @@ -896,7 +896,7 @@ BOOST_FIXTURE_TEST_CASE( producer_register_unregister, enumivo_system_tester ) t BOOST_FIXTURE_TEST_CASE( vote_for_producer, enumivo_system_tester, * boost::unit_test::tolerance(1e+5) ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); fc::variant params = producer_parameters_example(1); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") @@ -910,13 +910,13 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, enumivo_system_tester, * boost::unit BOOST_REQUIRE_EQUAL( 0, prod["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( "http://block.one", prod["url"].as_string() ); - issue( "bob111111111", "2000.0000 EOS", config::system_account_name ); - issue( "carol1111111", "3000.0000 EOS", config::system_account_name ); + issue( "bob111111111", "2000.0000 ENU", config::system_account_name ); + issue( "carol1111111", "3000.0000 ENU", config::system_account_name ); //bob111111111 makes stake - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "11.0000 EOS", "0.1111 EOS" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("1988.8889 EOS"), get_balance( "bob111111111" ) ); - REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "11.1111 EOS" ), get_voter_info( "bob111111111" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "11.0000 ENU", "0.1111 ENU" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1988.8889 ENU"), get_balance( "bob111111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "11.1111 ENU" ), get_voter_info( "bob111111111" ) ); //bob111111111 votes for alice1111111 BOOST_REQUIRE_EQUAL( success(), push_action(N(bob111111111), N(voteproducer), mvo() @@ -928,14 +928,14 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, enumivo_system_tester, * boost::unit //check that producer parameters stay the same after voting prod = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("11.1111 EOS") == prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("11.1111 ENU") == prod["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( "alice1111111", prod["owner"].as_string() ); BOOST_REQUIRE_EQUAL( "http://block.one", prod["url"].as_string() ); //carol1111111 makes stake - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "22.0000 EOS", "0.2222 EOS" ) ); - REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "22.2222 EOS" ), get_voter_info( "carol1111111" ) ); - BOOST_REQUIRE_EQUAL( asset::from_string("2977.7778 EOS"), get_balance( "carol1111111" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "22.0000 ENU", "0.2222 ENU" ) ); + REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "22.2222 ENU" ), get_voter_info( "carol1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("2977.7778 ENU"), get_balance( "carol1111111" ) ); //carol1111111 votes for alice1111111 BOOST_REQUIRE_EQUAL( success(), push_action(N(carol1111111), N(voteproducer), mvo() ("voter", "carol1111111") @@ -945,20 +945,20 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, enumivo_system_tester, * boost::unit ); //new stake votes be added to alice1111111's total_votes prod = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("33.3333 EOS") == prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("33.3333 ENU") == prod["total_votes"].as_double() ); //bob111111111 increases his stake - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "55.0000 EOS", "0.5555 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "55.0000 ENU", "0.5555 ENU" ) ); //should increase alice1111111's total_votes prod = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("88.8888 EOS") == prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("88.8888 ENU") == prod["total_votes"].as_double() ); //carol1111111 unstakes part of the stake - BOOST_REQUIRE_EQUAL( success(), unstake( "carol1111111", "2.0000 EOS", "0.0002 EOS"/*"2.0000 EOS", "0.0002 EOS"*/ ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "carol1111111", "2.0000 ENU", "0.0002 ENU"/*"2.0000 ENU", "0.0002 ENU"*/ ) ); //should decrease alice1111111's total_votes prod = get_producer_info( "alice1111111" ); wdump((prod)); - BOOST_TEST_REQUIRE( stake2votes("86.8886 EOS") == prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("86.8886 ENU") == prod["total_votes"].as_double() ); //bob111111111 revokes his vote BOOST_REQUIRE_EQUAL( success(), push_action( N(bob111111111), N(voteproducer), mvo() @@ -969,12 +969,12 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, enumivo_system_tester, * boost::unit ); //should decrease alice1111111's total_votes prod = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("20.2220 EOS") == prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("20.2220 ENU") == prod["total_votes"].as_double() ); //but enu should still be at stake - BOOST_REQUIRE_EQUAL( asset::from_string("1933.3334 EOS"), get_balance( "bob111111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1933.3334 ENU"), get_balance( "bob111111111" ) ); //carol1111111 unstakes rest of enu - BOOST_REQUIRE_EQUAL( success(), unstake( "carol1111111", "20.0000 EOS", "0.2220 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "carol1111111", "20.0000 ENU", "0.2220 ENU" ) ); //should decrease alice1111111's total_votes to zero prod = get_producer_info( "alice1111111" ); BOOST_TEST_REQUIRE( 0.0 == prod["total_votes"].as_double() ); @@ -982,15 +982,15 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, enumivo_system_tester, * boost::unit //carol1111111 should receive funds in 3 days produce_block( fc::days(3) ); produce_block(); - BOOST_REQUIRE_EQUAL( asset::from_string("3000.0000 EOS"), get_balance( "carol1111111" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("3000.0000 ENU"), get_balance( "carol1111111" ) ); } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( unregistered_producer_voting, enumivo_system_tester, * boost::unit_test::tolerance(1e+5) ) try { - issue( "bob111111111", "2000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "13.0000 EOS", "0.5791 EOS" ) ); - REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "13.5791 EOS" ), get_voter_info( "bob111111111" ) ); + issue( "bob111111111", "2000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "13.0000 ENU", "0.5791 ENU" ) ); + REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "13.5791 ENU" ), get_voter_info( "bob111111111" ) ); //bob111111111 should not be able to vote for alice1111111 who is not a producer BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: producer is not registered" ), @@ -1002,7 +1002,7 @@ BOOST_FIXTURE_TEST_CASE( unregistered_producer_voting, enumivo_system_tester, * ); //alice1111111 registers as a producer - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); fc::variant params = producer_parameters_example(1); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") @@ -1033,9 +1033,9 @@ BOOST_FIXTURE_TEST_CASE( unregistered_producer_voting, enumivo_system_tester, * BOOST_FIXTURE_TEST_CASE( more_than_30_producer_voting, enumivo_system_tester ) try { - issue( "bob111111111", "2000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "13.0000 EOS", "0.5791 EOS" ) ); - REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "13.5791 EOS" ), get_voter_info( "bob111111111" ) ); + issue( "bob111111111", "2000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "13.0000 ENU", "0.5791 ENU" ) ); + REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "13.5791 ENU" ), get_voter_info( "bob111111111" ) ); //bob111111111 should not be able to vote for alice1111111 who is not a producer BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: attempt to vote for too many producers" ), @@ -1050,12 +1050,12 @@ BOOST_FIXTURE_TEST_CASE( more_than_30_producer_voting, enumivo_system_tester ) t BOOST_FIXTURE_TEST_CASE( vote_same_producer_30_times, enumivo_system_tester ) try { - issue( "bob111111111", "2000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "50.0000 EOS", "50.0000 EOS" ) ); - REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "100.0000 EOS" ), get_voter_info( "bob111111111" ) ); + issue( "bob111111111", "2000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "50.0000 ENU", "50.0000 ENU" ) ); + REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "100.0000 ENU" ), get_voter_info( "bob111111111" ) ); //alice1111111 becomes a producer - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); fc::variant params = producer_parameters_example(1); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() ("producer", "alice1111111") @@ -1081,7 +1081,7 @@ BOOST_FIXTURE_TEST_CASE( vote_same_producer_30_times, enumivo_system_tester ) tr BOOST_FIXTURE_TEST_CASE( producer_keep_votes, enumivo_system_tester, * boost::unit_test::tolerance(1e+5) ) try { - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); fc::variant params = producer_parameters_example(1); vector key = fc::raw::pack( get_public_key( N(alice1111111), "active" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproducer), mvo() @@ -1093,9 +1093,9 @@ BOOST_FIXTURE_TEST_CASE( producer_keep_votes, enumivo_system_tester, * boost::un ); //bob111111111 makes stake - issue( "bob111111111", "2000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "13.0000 EOS", "0.5791 EOS" ) ); - REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "13.5791 EOS" ), get_voter_info( "bob111111111" ) ); + issue( "bob111111111", "2000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "13.0000 ENU", "0.5791 ENU" ) ); + REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "13.5791 ENU" ), get_voter_info( "bob111111111" ) ); //bob111111111 votes for alice1111111 BOOST_REQUIRE_EQUAL( success(), push_action(N(bob111111111), N(voteproducer), mvo() @@ -1106,7 +1106,7 @@ BOOST_FIXTURE_TEST_CASE( producer_keep_votes, enumivo_system_tester, * boost::un ); auto prod = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("13.5791 EOS") == prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("13.5791 ENU") == prod["total_votes"].as_double() ); //unregister producer BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(unregprod), mvo() @@ -1119,7 +1119,7 @@ BOOST_FIXTURE_TEST_CASE( producer_keep_votes, enumivo_system_tester, * boost::un //check parameters just in case //REQUIRE_MATCHING_OBJECT( params, prod["prefs"]); //votes should stay the same - BOOST_TEST_REQUIRE( stake2votes("13.5791 EOS"), prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("13.5791 ENU"), prod["total_votes"].as_double() ); //regtister the same producer again params = producer_parameters_example(2); @@ -1132,7 +1132,7 @@ BOOST_FIXTURE_TEST_CASE( producer_keep_votes, enumivo_system_tester, * boost::un ); prod = get_producer_info( "alice1111111" ); //votes should stay the same - BOOST_TEST_REQUIRE( stake2votes("13.5791 EOS"), prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("13.5791 ENU"), prod["total_votes"].as_double() ); //change parameters params = producer_parameters_example(3); @@ -1145,7 +1145,7 @@ BOOST_FIXTURE_TEST_CASE( producer_keep_votes, enumivo_system_tester, * boost::un ); prod = get_producer_info( "alice1111111" ); //votes should stay the same - BOOST_TEST_REQUIRE( stake2votes("13.5791 EOS"), prod["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("13.5791 ENU"), prod["total_votes"].as_double() ); //check parameters just in case //REQUIRE_MATCHING_OBJECT( params, prod["prefs"]); @@ -1175,8 +1175,8 @@ BOOST_FIXTURE_TEST_CASE( vote_for_two_producers, enumivo_system_tester, * boost: ); //carol1111111 votes for alice1111111 and bob111111111 - issue( "carol1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "15.0005 EOS", "5.0000 EOS" ) ); + issue( "carol1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "15.0005 ENU", "5.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action(N(carol1111111), N(voteproducer), mvo() ("voter", "carol1111111") ("proxy", name(0).to_string() ) @@ -1185,9 +1185,9 @@ BOOST_FIXTURE_TEST_CASE( vote_for_two_producers, enumivo_system_tester, * boost: ); auto alice_info = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("20.0005 EOS") == alice_info["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("20.0005 ENU") == alice_info["total_votes"].as_double() ); auto bob_info = get_producer_info( "bob111111111" ); - BOOST_TEST_REQUIRE( stake2votes("20.0005 EOS") == bob_info["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("20.0005 ENU") == bob_info["total_votes"].as_double() ); //carol1111111 votes for alice1111111 (but revokes vote for bob111111111) BOOST_REQUIRE_EQUAL( success(), push_action(N(carol1111111), N(voteproducer), mvo() @@ -1198,13 +1198,13 @@ BOOST_FIXTURE_TEST_CASE( vote_for_two_producers, enumivo_system_tester, * boost: ); alice_info = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("20.0005 EOS") == alice_info["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("20.0005 ENU") == alice_info["total_votes"].as_double() ); bob_info = get_producer_info( "bob111111111" ); BOOST_TEST_REQUIRE( 0 == bob_info["total_votes"].as_double() ); //alice1111111 votes for herself and bob111111111 - issue( "alice1111111", "2.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "1.0000 EOS", "1.0000 EOS" ) ); + issue( "alice1111111", "2.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "1.0000 ENU", "1.0000 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(voteproducer), mvo() ("voter", "alice1111111") ("proxy", name(0).to_string() ) @@ -1213,10 +1213,10 @@ BOOST_FIXTURE_TEST_CASE( vote_for_two_producers, enumivo_system_tester, * boost: ); alice_info = get_producer_info( "alice1111111" ); - BOOST_TEST_REQUIRE( stake2votes("22.0005 EOS") == alice_info["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("22.0005 ENU") == alice_info["total_votes"].as_double() ); bob_info = get_producer_info( "bob111111111" ); - BOOST_TEST_REQUIRE( stake2votes("2.0000 EOS") == bob_info["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("2.0000 ENU") == bob_info["total_votes"].as_double() ); } FC_LOG_AND_RETHROW() @@ -1239,8 +1239,8 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, enumivo_system_t REQUIRE_MATCHING_OBJECT( voter( "alice1111111" ), get_voter_info( "alice1111111" ) ); //stake and then register as a proxy - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "200.0002 EOS", "100.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "200.0002 ENU", "100.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(bob111111111), N(regproxy), mvo() ("proxy", "bob111111111") ("isproxy", true) @@ -1253,7 +1253,7 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, enumivo_system_t ("isproxy", false) ) ); - REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "300.0003 EOS" ), get_voter_info( "bob111111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "bob111111111", "300.0003 ENU" ), get_voter_info( "bob111111111" ) ); //register as a proxy and then stake BOOST_REQUIRE_EQUAL( success(), push_action( N(carol1111111), N(regproxy), mvo() @@ -1261,8 +1261,8 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, enumivo_system_t ("isproxy", true) ) ); - issue( "carol1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "246.0002 EOS", "531.0001 EOS" ) ); + issue( "carol1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "246.0002 ENU", "531.0001 ENU" ) ); //check that both proxy flag and stake a correct REQUIRE_MATCHING_OBJECT( proxy( "carol1111111" )( "staked", 7770003 ), get_voter_info( "carol1111111" ) ); @@ -1272,7 +1272,7 @@ BOOST_FIXTURE_TEST_CASE( proxy_register_unregister_keeps_stake, enumivo_system_t ("isproxy", false) ) ); - REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "777.0003 EOS" ), get_voter_info( "carol1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "carol1111111", "777.0003 ENU" ), get_voter_info( "carol1111111" ) ); } FC_LOG_AND_RETHROW() @@ -1283,25 +1283,25 @@ BOOST_FIXTURE_TEST_CASE( proxy_stake_unstake_keeps_proxy_flag, enumivo_system_te ("isproxy", true) ) ); - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" ), get_voter_info( "alice1111111" ) ); //stake - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "100.0000 EOS", "50.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "100.0000 ENU", "50.0000 ENU" ) ); //check that account is still a proxy REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "staked", 1500000 ), get_voter_info( "alice1111111" ) ); //stake more - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "30.0000 EOS", "20.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "30.0000 ENU", "20.0000 ENU" ) ); //check that account is still a proxy REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )("staked", 2000000 ), get_voter_info( "alice1111111" ) ); //unstake more - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "65.0000 EOS", "35.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "65.0000 ENU", "35.0000 ENU" ) ); REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )("staked", 1000000 ), get_voter_info( "alice1111111" ) ); //unstake the rest - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "65.0000 EOS", "35.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "65.0000 ENU", "35.0000 ENU" ) ); REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "staked", 0 ), get_voter_info( "alice1111111" ) ); } FC_LOG_AND_RETHROW() @@ -1321,15 +1321,15 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, enumivo_system_tester, ); //accumulate proxied votes - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 ENU", "50.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action(N(bob111111111), N(voteproducer), mvo() ("voter", "bob111111111") ("proxy", "alice1111111" ) ("producers", vector() ) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 EOS") ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 ENU") ), get_voter_info( "alice1111111" ) ); //vote for producers BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(voteproducer), mvo() @@ -1338,8 +1338,8 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, enumivo_system_tester, ("producers", vector{ N(defproducer1), N(defproducer2) } ) ) ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_TEST_REQUIRE( 0 == get_producer_info( "defproducer3" )["total_votes"].as_double() ); //vote for another producers @@ -1349,9 +1349,9 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, enumivo_system_tester, ("producers", vector{ N(defproducer1), N(defproducer3) } ) ) ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer2" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_producer_info( "defproducer3" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_producer_info( "defproducer3" )["total_votes"].as_double() ); //unregister proxy BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproxy), mvo() @@ -1359,7 +1359,7 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, enumivo_system_tester, ("isproxy", false) ) ); - //REQUIRE_MATCHING_OBJECT( voter( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 EOS") ), get_voter_info( "alice1111111" ) ); + //REQUIRE_MATCHING_OBJECT( voter( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 ENU") ), get_voter_info( "alice1111111" ) ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer1" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); @@ -1370,22 +1370,22 @@ BOOST_FIXTURE_TEST_CASE( proxy_actions_affect_producers, enumivo_system_tester, ("isproxy", true) ) ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer2" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_producer_info( "defproducer3" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_producer_info( "defproducer3" )["total_votes"].as_double() ); //stake increase by proxy itself affects producers - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "30.0001 EOS", "20.0001 EOS" ) ); - BOOST_REQUIRE_EQUAL( stake2votes("200.0005 EOS"), get_producer_info( "defproducer1" )["total_votes"].as_double() ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "30.0001 ENU", "20.0001 ENU" ) ); + BOOST_REQUIRE_EQUAL( stake2votes("200.0005 ENU"), get_producer_info( "defproducer1" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer2" )["total_votes"].as_double() ); - BOOST_REQUIRE_EQUAL( stake2votes("200.0005 EOS"), get_producer_info( "defproducer3" )["total_votes"].as_double() ); + BOOST_REQUIRE_EQUAL( stake2votes("200.0005 ENU"), get_producer_info( "defproducer3" )["total_votes"].as_double() ); //stake decrease by proxy itself affects producers - BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "10.0001 EOS", "10.0001 EOS" ) ); - BOOST_TEST_REQUIRE( stake2votes("180.0003 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_REQUIRE_EQUAL( success(), unstake( "alice1111111", "10.0001 ENU", "10.0001 ENU" ) ); + BOOST_TEST_REQUIRE( stake2votes("180.0003 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer2" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("180.0003 EOS") == get_producer_info( "defproducer3" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("180.0003 ENU") == get_producer_info( "defproducer3" )["total_votes"].as_double() ); } FC_LOG_AND_RETHROW() @@ -1395,21 +1395,21 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, enumivo_system_tester, * boost::unit_test: const double usecs_per_year = 52 * 7 * 24 * 3600 * 1000000ll; const double secs_per_year = 52 * 7 * 24 * 3600; - const asset large_asset = asset::from_string("80.0000 EOS"); - create_account_with_resources( N(defproducera), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); - create_account_with_resources( N(defproducerb), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); - create_account_with_resources( N(defproducerc), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); + const asset large_asset = asset::from_string("80.0000 ENU"); + create_account_with_resources( N(defproducera), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); + create_account_with_resources( N(defproducerb), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); + create_account_with_resources( N(defproducerc), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); - create_account_with_resources( N(producvotera), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); - create_account_with_resources( N(producvoterb), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); + create_account_with_resources( N(producvotera), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); + create_account_with_resources( N(producvoterb), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); BOOST_REQUIRE_EQUAL(success(), regproducer(N(defproducera))); auto prod = get_producer_info( N(defproducera) ); BOOST_REQUIRE_EQUAL("defproducera", prod["owner"].as_string()); BOOST_REQUIRE_EQUAL(0, prod["total_votes"].as_double()); - transfer( config::system_account_name, "producvotera", "400000000.0000 EOS", config::system_account_name); - BOOST_REQUIRE_EQUAL(success(), stake("producvotera", "100000000.0000 EOS", "100000000.0000 EOS")); + transfer( config::system_account_name, "producvotera", "400000000.0000 ENU", config::system_account_name); + BOOST_REQUIRE_EQUAL(success(), stake("producvotera", "100000000.0000 ENU", "100000000.0000 ENU")); BOOST_REQUIRE_EQUAL(success(), push_action(N(producvotera), N(voteproducer), mvo() ("voter", "producvotera") @@ -1597,11 +1597,11 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, enumivo_system_tester, * boost::u const double usecs_per_year = secs_per_year * 1000000; const double cont_rate = 4.879/100.; - const asset net = asset::from_string("80.0000 EOS"); - const asset cpu = asset::from_string("80.0000 EOS"); - create_account_with_resources( N(producvotera), config::system_account_name, asset::from_string("1.0000 EOS"), false, net, cpu ); - create_account_with_resources( N(producvoterb), config::system_account_name, asset::from_string("1.0000 EOS"), false, net, cpu ); - create_account_with_resources( N(producvoterc), config::system_account_name, asset::from_string("1.0000 EOS"), false, net, cpu ); + const asset net = asset::from_string("80.0000 ENU"); + const asset cpu = asset::from_string("80.0000 ENU"); + create_account_with_resources( N(producvotera), config::system_account_name, asset::from_string("1.0000 ENU"), false, net, cpu ); + create_account_with_resources( N(producvoterb), config::system_account_name, asset::from_string("1.0000 ENU"), false, net, cpu ); + create_account_with_resources( N(producvoterc), config::system_account_name, asset::from_string("1.0000 ENU"), false, net, cpu ); // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers std::vector producer_names; @@ -1622,12 +1622,12 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, enumivo_system_tester, * boost::u } { - transfer( config::system_account_name, "producvotera", "100000000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL(success(), stake("producvotera", "30000000.0000 EOS", "30000000.0000 EOS") ); - transfer( config::system_account_name, "producvoterb", "100000000.0000 EOS", config::system_account_name); - BOOST_REQUIRE_EQUAL(success(), stake("producvoterb", "30000000.0000 EOS", "30000000.0000 EOS") ); - transfer( config::system_account_name, "producvoterc", "100000000.0000 EOS", config::system_account_name); - BOOST_REQUIRE_EQUAL(success(), stake("producvoterc", "30000000.0000 EOS", "30000000.0000 EOS") ); + transfer( config::system_account_name, "producvotera", "100000000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL(success(), stake("producvotera", "30000000.0000 ENU", "30000000.0000 ENU") ); + transfer( config::system_account_name, "producvoterb", "100000000.0000 ENU", config::system_account_name); + BOOST_REQUIRE_EQUAL(success(), stake("producvoterb", "30000000.0000 ENU", "30000000.0000 ENU") ); + transfer( config::system_account_name, "producvoterc", "100000000.0000 ENU", config::system_account_name); + BOOST_REQUIRE_EQUAL(success(), stake("producvoterc", "30000000.0000 ENU", "30000000.0000 ENU") ); } // producvotera votes for defproducera ... defproducerj @@ -1896,7 +1896,7 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, enumivo_system_tester abi_serializer msig_abi_ser; { create_account_with_resources( N(enumivo.msig), N(enumivo) ); - BOOST_REQUIRE_EQUAL( success(), buyram( "enumivo", "enumivo.msig", "5000.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), buyram( "enumivo", "enumivo.msig", "5000.0000 ENU" ) ); produce_block(); auto trace = base_tester::push_action(config::system_account_name, N(setpriv), @@ -1915,9 +1915,9 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, enumivo_system_tester msig_abi_ser.set_abi(msig_abi); } - //stake more than 15% of total EOS supply to activate chain - transfer( "enumivo", "alice1111111", "650000000.0000 EOS", "enumivo" ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "300000000.0000 EOS", "300000000.0000 EOS" ) ); + //stake more than 15% of total ENU supply to activate chain + transfer( "enumivo", "alice1111111", "650000000.0000 ENU", "enumivo" ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "300000000.0000 ENU", "300000000.0000 ENU" ) ); // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers std::vector producer_names; @@ -1951,9 +1951,9 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, enumivo_system_tester //vote for producers { - transfer( config::system_account_name, "alice1111111", "100000000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL(success(), stake( "alice1111111", "30000000.0000 EOS", "30000000.0000 EOS" ) ); - BOOST_REQUIRE_EQUAL(success(), buyram( "alice1111111", "alice1111111", "30000000.0000 EOS" ) ); + transfer( config::system_account_name, "alice1111111", "100000000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL(success(), stake( "alice1111111", "30000000.0000 ENU", "30000000.0000 ENU" ) ); + BOOST_REQUIRE_EQUAL(success(), buyram( "alice1111111", "alice1111111", "30000000.0000 ENU" ) ); BOOST_REQUIRE_EQUAL(success(), push_action(N(alice1111111), N(voteproducer), mvo() ("voter", "alice1111111") ("proxy", name(0).to_string()) @@ -2072,10 +2072,10 @@ BOOST_FIXTURE_TEST_CASE(producers_upgrade_system_contract, enumivo_system_tester BOOST_FIXTURE_TEST_CASE(producer_onblock_check, enumivo_system_tester) try { - const asset large_asset = asset::from_string("80.0000 EOS"); - create_account_with_resources( N(producvotera), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); - create_account_with_resources( N(producvoterb), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); - create_account_with_resources( N(producvoterc), config::system_account_name, asset::from_string("1.0000 EOS"), false, large_asset, large_asset ); + const asset large_asset = asset::from_string("80.0000 ENU"); + create_account_with_resources( N(producvotera), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); + create_account_with_resources( N(producvoterb), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); + create_account_with_resources( N(producvoterc), config::system_account_name, asset::from_string("1.0000 ENU"), false, large_asset, large_asset ); // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers std::vector producer_names; @@ -2092,9 +2092,9 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, enumivo_system_tester) try { BOOST_REQUIRE_EQUAL(0, get_producer_info( producer_names.front() )["total_votes"].as()); BOOST_REQUIRE_EQUAL(0, get_producer_info( producer_names.back() )["total_votes"].as()); - transfer(config::system_account_name, "producvotera", "200000000.0000 EOS", config::system_account_name); + transfer(config::system_account_name, "producvotera", "200000000.0000 ENU", config::system_account_name); - BOOST_REQUIRE_EQUAL(success(), stake("producvotera", "70000000.0000 EOS", "70000000.0000 EOS")); + BOOST_REQUIRE_EQUAL(success(), stake("producvotera", "70000000.0000 ENU", "70000000.0000 ENU")); BOOST_REQUIRE_EQUAL(success(), push_action(N(producvotera), N(voteproducer), mvo() ("voter", "producvotera") ("proxy", name(0).to_string()) @@ -2131,10 +2131,10 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, enumivo_system_tester) try { } // stake across 15% boundary - transfer(config::system_account_name, "producvoterb", "100000000.0000 EOS", config::system_account_name); - BOOST_REQUIRE_EQUAL(success(), stake("producvoterb", "4000000.0000 EOS", "4000000.0000 EOS")); - transfer(config::system_account_name, "producvoterc", "100000000.0000 EOS", config::system_account_name); - BOOST_REQUIRE_EQUAL(success(), stake("producvoterc", "2000000.0000 EOS", "2000000.0000 EOS")); + transfer(config::system_account_name, "producvoterb", "100000000.0000 ENU", config::system_account_name); + BOOST_REQUIRE_EQUAL(success(), stake("producvoterb", "4000000.0000 ENU", "4000000.0000 ENU")); + transfer(config::system_account_name, "producvoterc", "100000000.0000 ENU", config::system_account_name); + BOOST_REQUIRE_EQUAL(success(), stake("producvoterc", "2000000.0000 ENU", "2000000.0000 ENU")); BOOST_REQUIRE_EQUAL(success(), push_action(N(producvoterb), N(voteproducer), mvo() ("voter", "producvoterb") @@ -2189,16 +2189,16 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, enumivo_syst REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" ), get_voter_info( "alice1111111" ) ); //alice1111111 makes stake and votes - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "30.0001 EOS", "20.0001 EOS" ) ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "30.0001 ENU", "20.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(voteproducer), mvo() ("voter", "alice1111111") ("proxy", name(0).to_string() ) ("producers", vector{ N(defproducer1), N(defproducer2) } ) ) ); - BOOST_TEST_REQUIRE( stake2votes("50.0002 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("50.0002 EOS") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("50.0002 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("50.0002 ENU") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( success(), push_action( N(donald111111), N(regproxy), mvo() @@ -2209,46 +2209,46 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, enumivo_syst REQUIRE_MATCHING_OBJECT( proxy( "donald111111" ), get_voter_info( "donald111111" ) ); //bob111111111 chooses alice1111111 as a proxy - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 ENU", "50.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(bob111111111), N(voteproducer), mvo() ("voter", "bob111111111") ("proxy", "alice1111111" ) ("producers", vector() ) ) ); - BOOST_TEST_REQUIRE( stake2votes("150.0003 EOS") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("200.0005 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("200.0005 EOS") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("150.0003 ENU") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("200.0005 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("200.0005 ENU") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); //carol1111111 chooses alice1111111 as a proxy - issue( "carol1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "30.0001 EOS", "20.0001 EOS" ) ); + issue( "carol1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "30.0001 ENU", "20.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(carol1111111), N(voteproducer), mvo() ("voter", "carol1111111") ("proxy", "alice1111111" ) ("producers", vector() ) ) ); - BOOST_TEST_REQUIRE( stake2votes("200.0005 EOS") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("250.0007 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("250.0007 EOS") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("200.0005 ENU") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("250.0007 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("250.0007 ENU") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); //proxied voter carol1111111 increases stake - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "50.0000 EOS", "70.0000 EOS" ) ); - BOOST_TEST_REQUIRE( stake2votes("320.0005 EOS") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("370.0007 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("370.0007 EOS") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "50.0000 ENU", "70.0000 ENU" ) ); + BOOST_TEST_REQUIRE( stake2votes("320.0005 ENU") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("370.0007 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("370.0007 ENU") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); //proxied voter bob111111111 decreases stake - BOOST_REQUIRE_EQUAL( success(), unstake( "bob111111111", "50.0001 EOS", "50.0001 EOS" ) ); - BOOST_TEST_REQUIRE( stake2votes("220.0003 EOS") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("270.0005 EOS") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("270.0005 EOS") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_REQUIRE_EQUAL( success(), unstake( "bob111111111", "50.0001 ENU", "50.0001 ENU" ) ); + BOOST_TEST_REQUIRE( stake2votes("220.0003 ENU") == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("270.0005 ENU") == get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("270.0005 ENU") == get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); //proxied voter carol1111111 chooses another proxy @@ -2258,10 +2258,10 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, enumivo_syst ("producers", vector() ) ) ); - BOOST_TEST_REQUIRE( stake2votes("50.0001 EOS"), get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("170.0002 EOS"), get_voter_info( "donald111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("100.0003 EOS"), get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("100.0003 EOS"), get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("50.0001 ENU"), get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("170.0002 ENU"), get_voter_info( "donald111111" )["proxied_vote_weight"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("100.0003 ENU"), get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("100.0003 ENU"), get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_REQUIRE_EQUAL( 0, get_producer_info( "defproducer3" )["total_votes"].as_double() ); //bob111111111 switches to direct voting and votes for one of the same producers, but not for another one @@ -2272,8 +2272,8 @@ BOOST_FIXTURE_TEST_CASE( voters_actions_affect_proxy_and_producers, enumivo_syst ) ); BOOST_TEST_REQUIRE( 0.0 == get_voter_info( "alice1111111" )["proxied_vote_weight"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("50.0002 EOS"), get_producer_info( "defproducer1" )["total_votes"].as_double() ); - BOOST_TEST_REQUIRE( stake2votes("100.0003 EOS"), get_producer_info( "defproducer2" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("50.0002 ENU"), get_producer_info( "defproducer1" )["total_votes"].as_double() ); + BOOST_TEST_REQUIRE( stake2votes("100.0003 ENU"), get_producer_info( "defproducer2" )["total_votes"].as_double() ); BOOST_TEST_REQUIRE( 0.0 == get_producer_info( "defproducer3" )["total_votes"].as_double() ); } FC_LOG_AND_RETHROW() @@ -2292,8 +2292,8 @@ BOOST_FIXTURE_TEST_CASE( vote_both_proxy_and_producers, enumivo_system_tester ) BOOST_REQUIRE_EQUAL( success(), regproducer( "carol1111111", 1) ); //bob111111111 chooses alice1111111 as a proxy - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 ENU", "50.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( error("condition: assertion failed: cannot vote for producers and proxy at same time"), push_action( N(bob111111111), N(voteproducer), mvo() ("voter", "bob111111111") @@ -2307,8 +2307,8 @@ BOOST_FIXTURE_TEST_CASE( vote_both_proxy_and_producers, enumivo_system_tester ) BOOST_FIXTURE_TEST_CASE( select_invalid_proxy, enumivo_system_tester ) try { //accumulate proxied votes - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 ENU", "50.0001 ENU" ) ); //selecting account not registered as a proxy BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: invalid proxy specified" ), @@ -2338,21 +2338,21 @@ BOOST_FIXTURE_TEST_CASE( double_register_unregister_proxy_keeps_votes, enumivo_s ("isproxy", 1) ) ); - issue( "alice1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "5.0000 EOS", "5.0000 EOS" ) ); + issue( "alice1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "5.0000 ENU", "5.0000 ENU" ) ); edump((get_voter_info("alice1111111"))); REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //bob111111111 stakes and selects alice1111111 as a proxy - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 ENU", "50.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(bob111111111), N(voteproducer), mvo() ("voter", "bob111111111") ("proxy", "alice1111111" ) ("producers", vector() ) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes( "150.0003 EOS" ))( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes( "150.0003 ENU" ))( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //double regestering should fail without affecting total votes and stake BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: action has no effect" ), @@ -2361,7 +2361,7 @@ BOOST_FIXTURE_TEST_CASE( double_register_unregister_proxy_keeps_votes, enumivo_s ("isproxy", 1) ) ); - REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 EOS") )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( proxy( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 ENU") )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //uregister BOOST_REQUIRE_EQUAL( success(), push_action( N(alice1111111), N(regproxy), mvo() @@ -2369,7 +2369,7 @@ BOOST_FIXTURE_TEST_CASE( double_register_unregister_proxy_keeps_votes, enumivo_s ("isproxy", 0) ) ); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 EOS") )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 ENU") )( "staked", 100000 ), get_voter_info( "alice1111111" ) ); //double unregistering should not affect proxied_votes and stake BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: action has no effect" ), @@ -2378,7 +2378,7 @@ BOOST_FIXTURE_TEST_CASE( double_register_unregister_proxy_keeps_votes, enumivo_s ("isproxy", 0) ) ); - REQUIRE_MATCHING_OBJECT( voter( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 EOS"))( "staked", 100000 ), get_voter_info( "alice1111111" ) ); + REQUIRE_MATCHING_OBJECT( voter( "alice1111111" )( "proxied_vote_weight", stake2votes("150.0003 ENU"))( "staked", 100000 ), get_voter_info( "alice1111111" ) ); } FC_LOG_AND_RETHROW() @@ -2398,8 +2398,8 @@ BOOST_FIXTURE_TEST_CASE( proxy_cannot_use_another_proxy, enumivo_system_tester ) ) ); //proxy should not be able to use a proxy - issue( "bob111111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "bob111111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "100.0002 ENU", "50.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: account registered as a proxy is not allowed to use a proxy" ), push_action( N(bob111111111), N(voteproducer), mvo() ("voter", "bob111111111") @@ -2409,8 +2409,8 @@ BOOST_FIXTURE_TEST_CASE( proxy_cannot_use_another_proxy, enumivo_system_tester ) ); //voter that uses a proxy should not be allowed to become a proxy - issue( "carol1111111", "1000.0000 EOS", config::system_account_name ); - BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "100.0002 EOS", "50.0001 EOS" ) ); + issue( "carol1111111", "1000.0000 ENU", config::system_account_name ); + BOOST_REQUIRE_EQUAL( success(), stake( "carol1111111", "100.0002 ENU", "50.0001 ENU" ) ); BOOST_REQUIRE_EQUAL( success(), push_action( N(carol1111111), N(voteproducer), mvo() ("voter", "carol1111111") ("proxy", "alice1111111" ) @@ -2462,9 +2462,9 @@ BOOST_FIXTURE_TEST_CASE( elect_producers /*_and_parameters*/, enumivo_system_tes BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer2", 2) ); BOOST_REQUIRE_EQUAL( success(), regproducer( "defproducer3", 3) ); - //stake more than 15% of total EOS supply to activate chain - transfer( "enumivo", "alice1111111", "600000000.0000 EOS", "enumivo" ); - BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "300000000.0000 EOS", "300000000.0000 EOS" ) ); + //stake more than 15% of total ENU supply to activate chain + transfer( "enumivo", "alice1111111", "600000000.0000 ENU", "enumivo" ); + BOOST_REQUIRE_EQUAL( success(), stake( "alice1111111", "alice1111111", "300000000.0000 ENU", "300000000.0000 ENU" ) ); // 1000000000.0000 //vote for producers BOOST_REQUIRE_EQUAL( success(), push_action(N(alice1111111), N(voteproducer), mvo() @@ -2483,9 +2483,9 @@ BOOST_FIXTURE_TEST_CASE( elect_producers /*_and_parameters*/, enumivo_system_tes //REQUIRE_EQUAL_OBJECTS(prod1_config, config); // elect 2 producers - issue( "bob111111111", "80000.0000 EOS", config::system_account_name ); + issue( "bob111111111", "80000.0000 ENU", config::system_account_name ); ilog("stake"); - BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "40000.0000 EOS", "40000.0000 EOS" ) ); + BOOST_REQUIRE_EQUAL( success(), stake( "bob111111111", "40000.0000 ENU", "40000.0000 ENU" ) ); ilog("start vote"); BOOST_REQUIRE_EQUAL( success(), push_action(N(bob111111111), N(voteproducer), mvo() ("voter", "bob111111111") diff --git a/unittests/forked_tests.cpp b/unittests/forked_tests.cpp index 3aa99927a97..3412cd5d759 100644 --- a/unittests/forked_tests.cpp +++ b/unittests/forked_tests.cpp @@ -62,14 +62,14 @@ BOOST_AUTO_TEST_CASE( forking ) try { auto cr = c.push_action( N(enumivo.coin), N(create), N(enumivo.coin), mutable_variant_object() ("issuer", "enumivo" ) - ("maximum_supply", "10000000.0000 EOS") + ("maximum_supply", "10000000.0000 ENU") ); wdump((fc::json::to_pretty_string(cr))); cr = c.push_action( N(enumivo.coin), N(issue), N(enumivo), mutable_variant_object() ("to", "dan" ) - ("quantity", "100.0000 EOS") + ("quantity", "100.0000 ENU") ("memo", "") ); diff --git a/unittests/multisig_tests.cpp b/unittests/multisig_tests.cpp index c17947772e0..80701966d19 100644 --- a/unittests/multisig_tests.cpp +++ b/unittests/multisig_tests.cpp @@ -53,7 +53,7 @@ class enumivo_msig_tester : public tester { } transaction_trace_ptr create_account_with_resources( account_name a, account_name creator, asset ramfunds, bool multisig, - asset net = asset::from_string("10.0000 EOS"), asset cpu = asset::from_string("10.0000 EOS") ) { + asset net = asset::from_string("10.0000 ENU"), asset cpu = asset::from_string("10.0000 ENU") ) { signed_transaction trx; set_transaction_headers(trx); @@ -120,7 +120,7 @@ class enumivo_msig_tester : public tester { ); } asset get_balance( const account_name& act ) { - //return get_currency_balance( config::system_account_name, symbol(SY(4,EOS)), act ); + //return get_currency_balance( config::system_account_name, symbol(SY(4,ENU)), act ); //temporary code. current get_currency_balancy uses table name N(accounts) from currency.h //generic_currency table name is N(account). const auto& db = control->db(); @@ -129,14 +129,14 @@ class enumivo_msig_tester : public tester { // the balance is implied to be 0 if either the table or row does not exist if (tbl) { - const auto *obj = db.find(boost::make_tuple(tbl->id, symbol(SY(4,EOS)).to_symbol_code())); + const auto *obj = db.find(boost::make_tuple(tbl->id, symbol(SY(4,ENU)).to_symbol_code())); if (obj) { // balance is the first field in the serialization fc::datastream ds(obj->value.data(), obj->value.size()); fc::raw::unpack(ds, result); } } - return asset( result, symbol(SY(4,EOS)) ); + return asset( result, symbol(SY(4,ENU)) ); } transaction_trace_ptr push_action( const account_name& signer, const action_name& name, const variant_object& data, bool auth = true ) { @@ -421,20 +421,20 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, enumivo_msig_tester set_code( N(enumivo.coin), enumivo_coin_wast ); set_abi( N(enumivo.coin), enumivo_coin_abi ); - create_currency( N(enumivo.coin), config::system_account_name, asset::from_string("10000000000.0000 EOS") ); - issue(config::system_account_name, "1000000000.0000 EOS"); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); + create_currency( N(enumivo.coin), config::system_account_name, asset::from_string("10000000000.0000 ENU") ); + issue(config::system_account_name, "1000000000.0000 ENU"); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); set_code( config::system_account_name, enumivo_system_wast ); set_abi( config::system_account_name, enumivo_system_abi ); produce_blocks(); - create_account_with_resources( N(alice1111111), N(enumivo), asset::from_string("1.0000 EOS"), false ); - create_account_with_resources( N(bob111111111), N(enumivo), asset::from_string("0.4500 EOS"), false ); - create_account_with_resources( N(carol1111111), N(enumivo), asset::from_string("1.0000 EOS"), false ); + create_account_with_resources( N(alice1111111), N(enumivo), asset::from_string("1.0000 ENU"), false ); + create_account_with_resources( N(bob111111111), N(enumivo), asset::from_string("0.4500 ENU"), false ); + create_account_with_resources( N(carol1111111), N(enumivo), asset::from_string("1.0000 ENU"), false ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); vector perm = { { N(alice), config::active_name }, { N(bob), config::active_name }, {N(carol), config::active_name} }; @@ -508,7 +508,7 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, enumivo_msig_tester BOOST_REQUIRE_EQUAL( transaction_receipt::executed, trace->receipt->status ); // can't create account because system contract was replace by the test_api contract - BOOST_REQUIRE_EXCEPTION(create_account_with_resources( N(alice1111112), N(enumivo), asset::from_string("1.0000 EOS"), false ), + BOOST_REQUIRE_EXCEPTION(create_account_with_resources( N(alice1111112), N(enumivo), asset::from_string("1.0000 ENU"), false ), fc::assert_exception, [](const fc::exception& e) { return expect_assert_message(e, "condition: assertion failed: Unknown Test"); @@ -532,20 +532,20 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, enumivo_msig_test set_code( N(enumivo.coin), enumivo_coin_wast ); set_abi( N(enumivo.coin), enumivo_coin_abi ); - create_currency( N(enumivo.coin), config::system_account_name, asset::from_string("10000000000.0000 EOS") ); - issue(config::system_account_name, "1000000000.0000 EOS"); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); + create_currency( N(enumivo.coin), config::system_account_name, asset::from_string("10000000000.0000 ENU") ); + issue(config::system_account_name, "1000000000.0000 ENU"); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); set_code( config::system_account_name, enumivo_system_wast ); set_abi( config::system_account_name, enumivo_system_abi ); produce_blocks(); - create_account_with_resources( N(alice1111111), N(enumivo), asset::from_string("1.0000 EOS"), false ); - create_account_with_resources( N(bob111111111), N(enumivo), asset::from_string("0.4500 EOS"), false ); - create_account_with_resources( N(carol1111111), N(enumivo), asset::from_string("1.0000 EOS"), false ); + create_account_with_resources( N(alice1111111), N(enumivo), asset::from_string("1.0000 ENU"), false ); + create_account_with_resources( N(bob111111111), N(enumivo), asset::from_string("0.4500 ENU"), false ); + create_account_with_resources( N(carol1111111), N(enumivo), asset::from_string("1.0000 ENU"), false ); - BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 EOS"), get_balance( "enumivo" ) ); + BOOST_REQUIRE_EQUAL( asset::from_string("1000000000.0000 ENU"), get_balance( "enumivo" ) ); vector perm = { { N(alice), config::active_name }, { N(bob), config::active_name }, {N(carol), config::active_name}, {N(apple), config::active_name}}; @@ -634,7 +634,7 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, enumivo_msig_test BOOST_REQUIRE_EQUAL( transaction_receipt::executed, trace->receipt->status ); // can't create account because system contract was replace by the test_api contract - BOOST_REQUIRE_EXCEPTION(create_account_with_resources( N(alice1111112), N(enumivo), asset::from_string("1.0000 EOS"), false ), + BOOST_REQUIRE_EXCEPTION(create_account_with_resources( N(alice1111112), N(enumivo), asset::from_string("1.0000 ENU"), false ), fc::assert_exception, [](const fc::exception& e) { return expect_assert_message(e, "condition: assertion failed: Unknown Test");