未验证 提交 04d4b400 编写于 作者: L luchiagogogo 提交者: GitHub

Merge pull request #4 from big4david/feature/ytaseo

Feature/ytaseo
......@@ -19,7 +19,7 @@ wdurl=http://$wdaddr
# bioshost=$BIOS_HOSTNAME
# biosport=$BIOS_HTTP_PORT
# cnt_dir=$CONTRACT_DIR
# sys=$SYS_CONTRACT
# YTA=$SYS_CONTRACT
# where $BIOS_HOSTNAME is replaced by the hostname portion of the http-server-address configured
# for the nodeos instance running to bios producer
# ------ DO NOT ALTER THE NEXT LINE -------
......@@ -56,7 +56,7 @@ wcmd () {
}
cacmd () {
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport system newaccount --transfer --stake-net "10000000.0000 SYS" --stake-cpu "10000000.0000 SYS" --buy-ram "10000000.0000 SYS" eosio $* >> $logfile 2>&1
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport system newaccount --transfer --stake-net "10000000.0000 YTA" --stake-cpu "10000000.0000 YTA" --buy-ram "10000000.0000 YTA" eosio $* >> $logfile 2>&1
ecmd system regproducer $1 $2
ecmd system voteproducer prods $1 $1
}
......@@ -99,11 +99,11 @@ ecmd set contract eosio.msig contracts/eosio.msig eosio.msig.wasm eosio.msig.abi
ecmd set contract eosio.sudo contracts/eosio.sudo eosio.sudo.wasm eosio.sudo.abi
echo ===== Start: $step ============ >> $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token | tee -a $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio | tee -a $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 YTA" ]' -p eosio.token | tee -a $logfile
echo executing: cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 YTA", "memo" ]' -p eosio | tee -a $logfile
echo ----------------------- >> $logfile
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 SYS" ]' -p eosio.token >> $logfile 2>&1
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio >> $logfile 2>&1
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token create '[ "eosio", "10000000000.0000 YTA" ]' -p eosio.token >> $logfile 2>&1
programs/cleos/cleos --wallet-url $wdurl --url http://$bioshost:$biosport push action eosio.token issue '[ "eosio", "1000000000.0000 YTA", "memo" ]' -p eosio >> $logfile 2>&1
echo ==== End: $step ============== >> $logfile
step=$(($step + 1))
......
......@@ -720,7 +720,7 @@ class Node(object):
@staticmethod
def currencyStrToInt(balanceStr):
"""Converts currency string of form "12.3456 SYS" to int 123456"""
"""Converts currency string of form "12.3456 YTA" to int 123456"""
assert(isinstance(balanceStr, str))
balanceStr=balanceStr.split()[0]
#balance=int(decimal.Decimal(balanceStr[1:])*10000)
......@@ -730,7 +730,7 @@ class Node(object):
@staticmethod
def currencyIntToStr(balance, symbol):
"""Converts currency int of form 123456 to string "12.3456 SYS" where SYS is symbol string"""
"""Converts currency int of form 123456 to string "12.3456 YTA" where YTA is symbol string"""
assert(isinstance(balance, int))
assert(isinstance(symbol, str))
balanceStr="%.04f %s" % (balance/10000.0, symbol)
......@@ -738,7 +738,7 @@ class Node(object):
return balanceStr
def validateFunds(self, initialBalances, transferAmount, source, accounts):
"""Validate each account has the expected SYS balance. Validate cumulative balance matches expectedTotal."""
"""Validate each account has the expected YTA balance. Validate cumulative balance matches expectedTotal."""
assert(source)
assert(isinstance(source, Account))
assert(accounts)
......@@ -849,7 +849,7 @@ class Node(object):
return servants
def getAccountEosBalanceStr(self, scope):
"""Returns SYS currency0000 account balance from cleos get table command. Returned balance is string following syntax "98.0311 SYS". """
"""Returns YTA currency0000 account balance from cleos get table command. Returned balance is string following syntax "98.0311 YTA". """
assert isinstance(scope, str)
amount=self.getTableAccountBalance("eosio.token", scope)
if Utils.Debug: Utils.Print("getNodeAccountEosBalance %s %s" % (scope, amount))
......@@ -857,7 +857,7 @@ class Node(object):
return amount
def getAccountEosBalance(self, scope):
"""Returns SYS currency0000 account balance from cleos get table command. Returned balance is an integer e.g. 980311. """
"""Returns YTA currency0000 account balance from cleos get table command. Returned balance is an integer e.g. 980311. """
balanceStr=self.getAccountEosBalanceStr(scope)
balance=Node.currencyStrToInt(balanceStr)
return balance
......
......@@ -58,14 +58,14 @@ BOOST_FIXTURE_TEST_CASE( get_scope_test, TESTER ) try {
// create currency
auto act = mutable_variant_object()
("issuer", "eosio")
("maximum_supply", eosio::chain::asset::from_string("1000000000.0000 SYS"));
("maximum_supply", eosio::chain::asset::from_string("1000000000.0000 YTA"));
push_action(N(eosio.token), N(create), N(eosio.token), act );
// issue
for (account_name a: accs) {
push_action( N(eosio.token), N(issue), "eosio", mutable_variant_object()
("to", name(a) )
("quantity", eosio::chain::asset::from_string("999.0000 SYS") )
("quantity", eosio::chain::asset::from_string("999.0000 YTA") )
("memo", "")
);
}
......@@ -134,14 +134,14 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
// create currency
auto act = mutable_variant_object()
("issuer", "eosio")
("maximum_supply", eosio::chain::asset::from_string("1000000000.0000 SYS"));
("maximum_supply", eosio::chain::asset::from_string("1000000000.0000 YTA"));
push_action(N(eosio.token), N(create), N(eosio.token), act );
// issue
for (account_name a: accs) {
push_action( N(eosio.token), N(issue), "eosio", mutable_variant_object()
("to", name(a) )
("quantity", eosio::chain::asset::from_string("10000.0000 SYS") )
("quantity", eosio::chain::asset::from_string("10000.0000 YTA") )
("memo", "")
);
}
......@@ -207,7 +207,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL("9999.0000 AAA", result.rows[0]["balance"].as_string());
BOOST_REQUIRE_EQUAL("8888.0000 BBB", result.rows[1]["balance"].as_string());
BOOST_REQUIRE_EQUAL("7777.0000 CCC", result.rows[2]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 SYS", result.rows[3]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 YTA", result.rows[3]["balance"].as_string());
}
// get table: reverse ordered
......@@ -219,7 +219,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL("9999.0000 AAA", result.rows[3]["balance"].as_string());
BOOST_REQUIRE_EQUAL("8888.0000 BBB", result.rows[2]["balance"].as_string());
BOOST_REQUIRE_EQUAL("7777.0000 CCC", result.rows[1]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 SYS", result.rows[0]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 YTA", result.rows[0]["balance"].as_string());
}
// get table: reverse ordered, with ram payer
......@@ -232,7 +232,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL("9999.0000 AAA", result.rows[3]["data"]["balance"].as_string());
BOOST_REQUIRE_EQUAL("8888.0000 BBB", result.rows[2]["data"]["balance"].as_string());
BOOST_REQUIRE_EQUAL("7777.0000 CCC", result.rows[1]["data"]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 SYS", result.rows[0]["data"]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 YTA", result.rows[0]["data"]["balance"].as_string());
BOOST_REQUIRE_EQUAL("eosio", result.rows[0]["payer"].as_string());
BOOST_REQUIRE_EQUAL("eosio", result.rows[1]["payer"].as_string());
BOOST_REQUIRE_EQUAL("eosio", result.rows[2]["payer"].as_string());
......@@ -283,7 +283,7 @@ BOOST_FIXTURE_TEST_CASE( get_table_test, TESTER ) try {
BOOST_REQUIRE_EQUAL(1, result.rows.size());
BOOST_REQUIRE_EQUAL(true, result.more);
if (result.rows.size() >= 1) {
BOOST_REQUIRE_EQUAL("10000.0000 SYS", result.rows[0]["balance"].as_string());
BOOST_REQUIRE_EQUAL("10000.0000 YTA", result.rows[0]["balance"].as_string());
}
// get table: normal case, with bound & limit
......@@ -329,14 +329,14 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
// create currency
auto act = mutable_variant_object()
("issuer", "eosio")
("maximum_supply", eosio::chain::asset::from_string("1000000000.0000 SYS"));
("maximum_supply", eosio::chain::asset::from_string("1000000000.0000 YTA"));
push_action(N(eosio.token), N(create), N(eosio.token), act );
// issue
for (account_name a: accs) {
push_action( N(eosio.token), N(issue), "eosio", mutable_variant_object()
("to", name(a) )
("quantity", eosio::chain::asset::from_string("10000.0000 SYS") )
("quantity", eosio::chain::asset::from_string("10000.0000 YTA") )
("memo", "")
);
}
......@@ -354,10 +354,10 @@ BOOST_FIXTURE_TEST_CASE( get_table_by_seckey_test, TESTER ) try {
);
};
bidname(N(inita), N(com), eosio::chain::asset::from_string("10.0000 SYS"));
bidname(N(initb), N(org), eosio::chain::asset::from_string("11.0000 SYS"));
bidname(N(initc), N(io), eosio::chain::asset::from_string("12.0000 SYS"));
bidname(N(initd), N(html), eosio::chain::asset::from_string("14.0000 SYS"));
bidname(N(inita), N(com), eosio::chain::asset::from_string("10.0000 YTA"));
bidname(N(initb), N(org), eosio::chain::asset::from_string("11.0000 YTA"));
bidname(N(initc), N(io), eosio::chain::asset::from_string("12.0000 YTA"));
bidname(N(initd), N(html), eosio::chain::asset::from_string("14.0000 YTA"));
produce_blocks(1);
// get table: normal case
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册