polyswarmclient.ethereum.transaction

Submodules

Package Contents

class polyswarmclient.ethereum.transaction.EthereumTransaction(client, verifiers)[source]

Used to verify and post groups of transactions that make up a specific action.

For instance, when approving some funds to move, and calling a contract function that will consumer them.

__sign_transactions(self, transactions)

Sign a set of transactions

Parameters

transactions (List[Transaction]) – The transactions to sign

Returns

The signed transactions

Return type

List[Transaction]

has_required_event(self, transaction_events)

Checks for existence of events in transaction logs, ensuring successful completion

Returns

True if the required event was in the list, false otherwise

get_path(self)

Get the path of the route to build this transaction

Returns

Polyswarmd path to get the transaction data

Return type

str

get_body(self)

Build the payload to send to polyswarmd :returns: Dict payload

verify(self, transactions)

Check the given transactions against known expectations

Parameters

transactions (list) –

Returns

True if transactions match expectations. False otherwise

Return type

(bool)

class polyswarmclient.ethereum.transaction.NonceManager(client, chain)[source]

Manages the nonce for some Ethereum chain

static find_gaps(nonces)

Finds any gaps between base nonce and the last nonce in the given nonces list.

Parameters

nonces (list[int]) – list of nonces being checked

Returns

(list[int]): Any missing nonces between base_nonce and the last given nonce