Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hive/wax
1 result
Show changes
Showing
with 246 additions and 258 deletions
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
asset_pb2,
account_create_with_delegation_pb2,
operation_pb2,
transaction_pb2,
future_extensions_pb2,
authority_pb2
)
from wax.proto.operations import account_create_with_delegation, operation
from wax.proto.asset import asset
from wax.proto.transaction import transaction
from wax.proto.authority import authority
from wax._private.proto.future_extensions_pb2 import future_extensions
def test_account_create_with_delegation():
extension: future_extensions_pb2.future_extensions = future_extensions_pb2.future_extensions()
vests: asset_pb2.asset = asset_pb2.asset(
extension: future_extensions = future_extensions()
vests: asset = asset(
nai="@@000000037", precision=6, amount="10"
)
hive: asset_pb2.asset = asset_pb2.asset(
hive: asset = asset(
nai="@@000000021", precision=3, amount="10"
)
authority: authority_pb2.authority = authority_pb2.authority(
proto_authority: authority = authority(
weight_threshold=1,
account_auths={"account": 1, "account1": 2},
key_auths={"STM76EQNV2RTA6yF9TnBvGSV71mW7eW36MM7XQp24JxdoArTfKA76": 1},
)
account_create_with_delegation: account_create_with_delegation_pb2.account_create_with_delegation = account_create_with_delegation_pb2.account_create_with_delegation(
account_create_with_delegation_proto: account_create_with_delegation = account_create_with_delegation(
fee=hive,
delegation=vests,
creator="creator",
new_account_name="account2",
owner=authority,
active=authority,
posting=authority,
owner=proto_authority,
active=proto_authority,
posting=proto_authority,
memo_key="STM6FATHLohxTN8RWWkU9ZZwVywXo6MEDjHHui1jEBYkG2tTdvMYo",
json_metadata="{}",
extensions=[]
)
account_create_with_delegation_operation: operation_pb2.operation = operation_pb2.operation(
account_create_with_delegation=account_create_with_delegation
account_create_with_delegation_operation: operation = operation(
account_create_with_delegation=account_create_with_delegation_proto
)
check_operations(account_create_with_delegation_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[account_create_with_delegation_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
account_update_pb2,
authority_pb2,
operation_pb2,
transaction_pb2
)
from wax.proto.operations import account_update, operation
from wax.proto.authority import authority
from wax.proto.transaction import transaction
def test_account_update():
posting: authority_pb2.authority = authority_pb2.authority(
posting: authority = authority(
weight_threshold=1,
account_auths={"account": 1, "account1": 2},
key_auths={"STM76EQNV2RTA6yF9TnBvGSV71mW7eW36MM7XQp24JxdoArTfKA76": 1},
)
account_update: account_update_pb2.account_update = (
account_update_pb2.account_update(
account_update_proto: account_update = (
account_update(
account="theoretical",
posting=posting,
memo_key="STM6FATHLohxTN8RWWkU9ZZwVywXo6MEDjHHui1jEBYkG2tTdvMYo",
......@@ -23,14 +20,14 @@ def test_account_update():
)
)
account_update_operation: operation_pb2.operation = operation_pb2.operation(
account_update=account_update
account_update_operation: operation = operation(
account_update=account_update_proto
)
check_operations(account_update_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[account_update_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
......@@ -9,19 +9,17 @@
# }
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto.operations import account_update2, operation
from wax.proto.transaction import transaction
from wax._private.proto.future_extensions_pb2 import future_extensions
from wax.proto import (
account_update2_pb2,
operation_pb2,
transaction_pb2,
future_extensions_pb2
)
def test_account_update2():
extension: future_extensions_pb2.future_extensions = future_extensions_pb2.future_extensions()
account_update2: account_update2_pb2.account_update2 = (
account_update2_pb2.account_update2(
extension: future_extensions = future_extensions()
account_update2_proto: account_update2 = (
account_update2(
account="rosylisboa",
json_metadata="",
posting_json_metadata="{}",
......@@ -29,14 +27,14 @@ def test_account_update2():
)
)
account_update2_operation: operation_pb2.operation = operation_pb2.operation(
account_update2=account_update2
account_update2_operation: operation = operation(
account_update2=account_update2_proto
)
check_operations(account_update2_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[account_update2_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
......@@ -6,29 +6,27 @@
# }
# }
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto.operations import account_witness_proxy, operation
from wax.proto.transaction import transaction
from wax.proto import (
account_witness_proxy_pb2,
operation_pb2,
transaction_pb2
)
def test_account_witness_proxy():
account_witness_proxy: account_witness_proxy_pb2.account_witness_proxy = (
account_witness_proxy_pb2.account_witness_proxy(
account_witness_proxy_proto: account_witness_proxy = (
account_witness_proxy(
account="bunkermining", proxy="datasecuritynode"
)
)
account_witness_proxy_operation: operation_pb2.operation = (
operation_pb2.operation(account_witness_proxy=account_witness_proxy)
account_witness_proxy_operation: operation = (
operation(account_witness_proxy=account_witness_proxy_proto)
)
check_operations(account_witness_proxy_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[account_witness_proxy_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
......@@ -7,29 +7,29 @@
# }
# }
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
account_witness_vote_pb2,
operation_pb2,
transaction_pb2
from wax.proto.operations import (
account_witness_vote,
operation,
)
from wax.proto.transaction import transaction
def test_account_witness_vote():
account_witness_vote: account_witness_vote_pb2.account_witness_vote = (
account_witness_vote_pb2.account_witness_vote(
account_witness_vote_proto: account_witness_vote = (
account_witness_vote(
account="donalddrumpf", witness="berniesanders", approve=True
)
)
account_witness_vote_operation: operation_pb2.operation = (
operation_pb2.operation(account_witness_vote=account_witness_vote)
account_witness_vote_operation: operation = (
operation(account_witness_vote=account_witness_vote_proto)
)
check_operations(account_witness_vote_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[account_witness_vote_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
operation_pb2,
transaction_pb2,
cancel_transfer_from_savings_pb2
from wax.proto.operations import (
operation,
cancel_transfer_from_savings,
)
from wax.proto.transaction import transaction
def test_cancel_transfer_from_savings():
cancel_transfer_from_savings: cancel_transfer_from_savings_pb2.cancel_transfer_from_savings = cancel_transfer_from_savings_pb2.cancel_transfer_from_savings(
cancel_transfer_from_savings_proto: cancel_transfer_from_savings = cancel_transfer_from_savings(
from_account="faddy",
request_id=3
)
cancel_transfer_from_savings_operation: operation_pb2.operation = (
operation_pb2.operation(cancel_transfer_from_savings=cancel_transfer_from_savings)
cancel_transfer_from_savings_operation: operation = (
operation(cancel_transfer_from_savings=cancel_transfer_from_savings_proto)
)
check_operations(cancel_transfer_from_savings_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
transaction_proto: transaction = transaction(
operations=[cancel_transfer_from_savings_operation]
)
check_transaction(transaction)
check_transaction(transaction_proto)
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
change_recovery_account_pb2,
operation_pb2,
transaction_pb2,
future_extensions_pb2
from wax.proto.operations import (
change_recovery_account,
operation,
)
from wax.proto.transaction import transaction
from wax._private.proto.future_extensions_pb2 import future_extensions
def test_change_recovery_account():
extension: future_extensions_pb2.future_extensions = future_extensions_pb2.future_extensions()
change_recovery_account: change_recovery_account_pb2.change_recovery_account = change_recovery_account_pb2.change_recovery_account(
extension: future_extensions = future_extensions()
change_recovery_account_proto: change_recovery_account = change_recovery_account(
account_to_recover="account",
new_recovery_account="account1",
extensions=[]
)
change_recovery_account_operation: operation_pb2.operation = operation_pb2.operation(
change_recovery_account=change_recovery_account
change_recovery_account_operation: operation = operation(
change_recovery_account=change_recovery_account_proto
)
check_operations(change_recovery_account_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[change_recovery_account_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
claim_account_pb2,
operation_pb2,
transaction_pb2,
future_extensions_pb2,
asset_pb2
)
from wax.proto.operations import claim_account, operation
from wax.proto.transaction import transaction
from wax.proto.asset import asset
from wax._private.proto.future_extensions_pb2 import future_extensions, void_t
def test_claim_account():
extension: future_extensions_pb2.future_extensions = future_extensions_pb2.future_extensions(void_t=future_extensions_pb2.void_t())
fee: asset_pb2.asset = asset_pb2.asset(
extension: future_extensions = future_extensions(void_t=void_t())
fee: asset = asset(
nai="@@000000021", precision=3, amount="10"
)
claim_account: claim_account_pb2.claim_account = claim_account_pb2.claim_account(
claim_account_proto: claim_account = claim_account(
creator="rosylisboa",
fee=fee,
extensions=[]
)
claim_account_operation: operation_pb2.operation = operation_pb2.operation(
claim_account=claim_account
claim_account_operation: operation = operation(
claim_account=claim_account_proto
)
check_operations(claim_account_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
transaction_proto: transaction = transaction(
operations=[claim_account_operation]
)
check_transaction(transaction)
check_transaction(transaction_proto)
......@@ -20,28 +20,28 @@
# }
# }
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
asset_pb2,
claim_reward_balance_pb2,
operation_pb2,
transaction_pb2
from wax.proto.operations import (
claim_reward_balance,
operation,
)
from wax.proto.transaction import transaction
from wax.proto.asset import asset
def test_claim_reward_balance():
reward_hive: asset_pb2.asset = asset_pb2.asset(
reward_hive: asset = asset(
amount="0", precision=3, nai="@@000000021"
)
reward_hbd: asset_pb2.asset = asset_pb2.asset(
reward_hbd: asset = asset(
amount="104", precision=3, nai="@@000000013"
)
reward_vests: asset_pb2.asset = asset_pb2.asset(
reward_vests: asset = asset(
amount="531747227", precision=6, nai="@@000000037"
)
claim_reward_balance: claim_reward_balance_pb2.claim_reward_balance = (
claim_reward_balance_pb2.claim_reward_balance(
claim_reward_balance_proto: claim_reward_balance = (
claim_reward_balance(
account="bradleyarrow",
reward_hive=reward_hive,
reward_hbd=reward_hbd,
......@@ -49,14 +49,14 @@ def test_claim_reward_balance():
)
)
claim_reward_balance_operation: operation_pb2.operation = (
operation_pb2.operation(claim_reward_balance=claim_reward_balance)
claim_reward_balance_operation: operation = (
operation(claim_reward_balance=claim_reward_balance_proto)
)
check_operations(claim_reward_balance_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
proto_transaction: transaction = transaction(
operations=[claim_reward_balance_operation]
)
check_transaction(transaction)
check_transaction(proto_transaction)
from utils.checkers import check_operations, check_transaction
from tests.utils.checkers import check_operations, check_transaction
from wax.proto import (
comment_pb2,
operation_pb2,
transaction_pb2
from wax.proto.operations import (
comment,
operation,
)
from wax.proto.transaction import transaction
def test_comment():
comment: comment_pb2.comment = comment_pb2.comment(
comment_proto: comment = comment(
parent_permlink="/",
parent_author="",
author="alice",
......@@ -18,14 +18,14 @@ def test_comment():
json_metadata="{}",
)
comment_operation: operation_pb2.operation = operation_pb2.operation(
comment=comment
comment_operation: operation = operation(
comment=comment_proto
)
check_operations(comment_operation)
transaction: transaction_pb2.transaction = transaction_pb2.transaction(
transaction_proto: transaction = transaction(
operations=[comment_operation]
)
check_transaction(transaction)
check_transaction(transaction_proto)