mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
rm code to gen example HTTP stuff for /statuses & /votes
This commit is contained in:
parent
9ef2271a5d
commit
0139e53ab4
@ -67,68 +67,6 @@ Content-Type: application/json
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
TPLS['post-tx-response'] = """\
|
|
||||||
HTTP/1.1 202 Accepted
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
%(tx)s
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-statuses-tx-request'] = """\
|
|
||||||
GET /statuses?transaction_id=%(txid)s HTTP/1.1
|
|
||||||
Host: example.com
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-statuses-tx-invalid-response'] = """\
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "invalid"
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-statuses-tx-valid-response'] = """\
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "valid"
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-statuses-block-request'] = """\
|
|
||||||
GET /api/v1/statuses?block_id=%(blockid)s HTTP/1.1
|
|
||||||
Host: example.com
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-statuses-block-invalid-response'] = """\
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "invalid"
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-statuses-block-valid-response'] = """\
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "valid"
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-block-request'] = """\
|
TPLS['get-block-request'] = """\
|
||||||
GET /api/v1/blocks/%(blockid)s HTTP/1.1
|
GET /api/v1/blocks/%(blockid)s HTTP/1.1
|
||||||
Host: example.com
|
Host: example.com
|
||||||
@ -159,21 +97,6 @@ Content-Type: application/json
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-vote-request'] = """\
|
|
||||||
GET /api/v1/votes?block_id=%(blockid)s HTTP/1.1
|
|
||||||
Host: example.com
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
TPLS['get-vote-response'] = """\
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
[%(vote)s]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
""" Main function """
|
""" Main function """
|
||||||
|
|
||||||
@ -257,18 +180,6 @@ def main():
|
|||||||
ctx['block_list'] = pretty_json(block_list)
|
ctx['block_list'] = pretty_json(block_list)
|
||||||
|
|
||||||
|
|
||||||
# block = Block(transactions=[tx], node_pubkey=node_public, voters=[node_public], signature=signature)
|
|
||||||
block_transfer = Block(transactions=[tx_transfer], node_pubkey=node_public,
|
|
||||||
voters=[node_public], signature=signature)
|
|
||||||
ctx['block_transfer'] = pretty_json(block_transfer.to_dict())
|
|
||||||
|
|
||||||
# vote
|
|
||||||
vblock = Block(transactions=[tx], node_pubkey=node_public, voters=[node_public], signature=signature)
|
|
||||||
DUMMY_SHA3 = '0123456789abcdef' * 4
|
|
||||||
b = Bigchain(public_key=node_public, private_key=node_private)
|
|
||||||
vote = b.vote(vblock.id, DUMMY_SHA3, True)
|
|
||||||
ctx['vote'] = pretty_json(vote)
|
|
||||||
|
|
||||||
base_path = os.path.join(os.path.dirname(__file__),
|
base_path = os.path.join(os.path.dirname(__file__),
|
||||||
'source/http-samples')
|
'source/http-samples')
|
||||||
if not os.path.exists(base_path):
|
if not os.path.exists(base_path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user