Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_send_batch(*_):
requests = [Request("foo"), Request("bar")]
response = DummyClient().send(requests)
assert response.data.ok == True
def import_raw(self, secret, passphrase):
if isinstance(secret, bytes):
secret = "0x" + binascii.hexlify(secret).decode("ascii")
payload = Request("account_importRaw", secret, passphrase)
response = self.client.send(payload)
return response.data.result
def get_genesis_accounts(self):
payload = Request("chain_getGenesisAccounts")
response = self.client.send(payload)
return response.data.result
def remove_from_blacklist(self, address: str):
payload = Request("net_removeFromBlacklist", address)
response = self.client.send(payload)
return response.data.result
def unlock(self, account, passphrase, duration):
payload = Request("account_unlock", account, passphrase, duration)
response = self.client.send(payload)
return response.data.result
def get_state_trie_value(self, key: str):
payload = Request("devel_getStateTrieValue", key)
response = self.client.send(payload)
return response.data.result
def get_peer_count(self):
payload = Request("net_getPeerCount")
response = self.client.send(payload)
return response.data.result
def get_network_id(self):
payload = Request("chain_getNetworkId")
response = self.client.send(payload)
return response.data.result
def get_possible_authors(self, block_number: Union[int, None]):
payload = Request("chain_getPossibleAuthors", block_number)
response = self.client.send(payload)
return response.data.result