MCPcopy Create free account
hub / github.com/canopy-network/canopy / send_reward_tx

Function send_reward_tx

plugin/python/tutorial/rpc_test.py:347–365  ·  view source on GitHub ↗

Send a reward transaction.

(
    rpc_url: str,
    admin_key: KeyGroup,
    admin_addr: str,
    recipient_addr: str,
    amount: int,
    fee: int,
    network_id: int,
    chain_id: int,
    height: int
)

Source from the content-addressed store, hash-verified

345
346
347def send_reward_tx(
348 rpc_url: str,
349 admin_key: KeyGroup,
350 admin_addr: str,
351 recipient_addr: str,
352 amount: int,
353 fee: int,
354 network_id: int,
355 chain_id: int,
356 height: int
357) -> str:
358 """Send a reward transaction."""
359 reward_msg = {
360 'adminAddress': hex_to_base64(admin_addr),
361 'recipientAddress': hex_to_base64(recipient_addr),
362 'amount': amount,
363 }
364
365 return build_sign_and_send_tx(rpc_url, admin_key, 'reward', reward_msg, fee, network_id, chain_id, height)
366
367
368def test_plugin_transactions() -> None:

Callers 1

test_plugin_transactionsFunction · 0.85

Calls 2

hex_to_base64Function · 0.85
build_sign_and_send_txFunction · 0.85

Tested by

no test coverage detected