Skip to main content

自动设置一个 parity-ethereum 实例,并在测试后销毁它

项目描述

关于

testing.parity自动设置一个奇偶校验实例,并在测试后销毁它。

https://travis-ci.org/tristan/testing.parity.svg?branch=master https://coveralls.io/repos/tristan/testing.parity/badge.png?branch=master https://codeclimate.com/github/tristan/testing.parity/badges/gpa.svg
文档

https://github.com/tristan/testing.parity

问题

https://github.com/tristan/testing.parity/issues

下载

https://pypi.python.org/pypi/testing.parity

安装

使用点子:

$ pip install testing.parity

并且testing.parity需要您的 PATH 中的奇偶校验服务器。

用法

使用testing.parity.ParityServer创建 Parity 实例:

import testing.parity
import json
import urllib.request

# Lanuch new Parity-Ethereum server
with testing.parity.ParityServer() as parity:
    # test that jsonrpc responds
    result = urllib.request.urlopen(
        urllib.request.Request(
            parity.url(),
            headers={'Content-Type': "application/json"},
            data=json.dumps({
               "jsonrpc": "2.0",
               "id": "1234",
               "method": "eth_blockNumber",
               "params": []
            }).encode('utf-8')
        ))
    print(json.load(result))

# Parity server is terminated here

要求

  • Python 2.7、3.4、3.5、3.6

执照

阿帕奇许可证 2.0

历史

1.0.1 (2018-08-03)

  • 首次发布

1.0.2 (2018-08-06)

  • 添加了 --min-gas-price选项

1.0.3 (2018-09-24)

  • 在版本字符串中支持 Parity-Ethereum

1.0.4 (2019-01-18)

  • 支持 Parity 版本 >= 2.2.0

1.0.5 (2019-07-17)

  • 更新 chainspec 以支持君士坦丁堡 EIP

1.0.6 (2019-08-07)

  • 允许启用 websocket 接口

1.0.7 (2019-10-19)

  • 修复 Parity 版本 >= 2.5.8 的 InstantSeal 引擎

下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

testing.parity-1.0.7.ta​​r.gz (7.8 kB 查看哈希

已上传 source

内置分布

testing.parity-1.0.7-py2.py3-none-any.whl (14.1 kB 查看哈希

已上传 py2 py3