def test_create_account_action_returns_account_hash(): sender_wallet = Wallet() nonce = 1 expected = derive_hash(sender_wallet.address, nonce, 1) tx = Tx(sender_wallet.address, nonce, 0.01, 0) actual = tx.add_create_account_action() assert expected == actual
def test_create_account_action(): sender_wallet = Wallet() expected = """{ "senderAddress": "%s", "nonce": 1, "expirationTime": 0, "actionFee": 0.01, "actions": [ { "actionType": "CreateAccount", "actionData": {} } ] }""" % (sender_wallet.address) tx = Tx(sender_wallet.address, 1, 0.01, 0) tx.add_create_account_action() actual = tx.to_json() assert expected == actual