def init_addresses(): #global dev_reward_address global small_bet_address_dict, small_address_number_dict, small_number_address_dict global big_bet_address_dict, big_address_number_dict, big_number_address_dict global large_bet_address_dict, large_address_number_dict, large_number_address_dict #dev_reward_address = api.get_or_create_address(dev_reward_account) # init small addresses for x in range(10): account_name = "{}{}".format(small_bet_account_name_prefix, x) address = api.get_or_create_address(account_name) small_bet_address_dict[account_name] = address small_address_number_dict[address] = x small_number_address_dict[x] = address # init big addresses for x in range(10): account_name = "{}{}".format(big_bet_account_name_prefix, x) address = api.get_or_create_address(account_name) big_bet_address_dict[account_name] = address big_address_number_dict[address] = x big_number_address_dict[x] = address # init large addresses for x in range(10): account_name = "{}{}".format(large_bet_account_name_prefix, x) address = api.get_or_create_address(account_name) large_bet_address_dict[account_name] = address large_address_number_dict[address] = x large_number_address_dict[x] = address
def init_addresses(): global dev_reward_address dev_reward_address = api.get_or_create_address(dev_reward_account) # init small addresses for x in range(10): account_name = "{}{}".format(model.small_bet_account_name_prefix, x) address = api.get_or_create_address(account_name) model.small_bet_address_dict[account_name] = address model.small_address_number_dict[address] = x model.small_number_address_dict[x] = address # init big addresses for x in range(10): account_name = "{}{}".format(model.big_bet_account_name_prefix, x) address = api.get_or_create_address(account_name) model.big_bet_address_dict[account_name] = address model.big_address_number_dict[address] = x model.big_number_address_dict[x] = address # init large addresses for x in range(10): account_name = "{}{}".format(model.large_bet_account_name_prefix, x) address = api.get_or_create_address(account_name) model.large_bet_address_dict[account_name] = address model.large_address_number_dict[address] = x model.large_number_address_dict[x] = address
def send_balance_from_bank(): send_dict = {} for account in player_address_dict: address = player_address_dict[account] send_dict[address] = 2500 bank_address = api.get_or_create_address("bank") print(send_dict) api.send_to_many(bank_address, send_dict)
def init_player_address(): for x in range(10): account_name = "Player_{}".format(x) address = api.get_or_create_address(account_name) player_address_dict[account_name] = address print(account_name, address)
log.Info("End Take Rare Bet ----------------") def send_balance_from_bank(): send_dict = {} for account in player_address_dict: address = player_address_dict[account] send_dict[address] = 2500 bank_address = api.get_or_create_address("bank") print(send_dict) api.send_to_many(bank_address, send_dict) model.init_addresses() init_player_address() bank_balance = api.get_account_balance("bank") print("Bank Balance: ", bank_balance) print("Bank Address: ", api.get_or_create_address("bank")) show_all_player_balance() #send_balance_from_bank() #take_small_bet(6, "GURJ8TWR86NjABqkkr4J9vQBMuAer2yT5W", 1000) #take_big_bet(7, 3, 51) #take_big_bet(8, 3, 31) #take_rare_bet(1,1,100)
import rpcapi as api import log log.init_logger() bank_address = api.get_or_create_address("dev") print(bank_address)