Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 1156fff

Browse files
committed
README changes to make it look nicer in pypi
1 parent 267a534 commit 1156fff

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -175,30 +175,30 @@ Most compilers for HLLs (solidity, serpent, viper, etc) on top of Ethereum have
175175

176176
You can initialize an `abi.ContractTranslator` object to encode and decode data for contracts as follows:
177177

178-
true, false = True, False
179-
ct = abi.ContractTranslator(<json here>)
180-
txdata = ct.encode('function_name', [arg1, arg2, arg3])
178+
true, false = True, False
179+
ct = abi.ContractTranslator(<json here>)
180+
txdata = ct.encode('function_name', [arg1, arg2, arg3])
181181

182182
You can also call `ct.decode_event([topic1, topic2...], logdata)` to decode a log.
183183

184184
### RLP encoding and decoding
185185

186186
For any transaction or block, you can simply do:
187187

188-
import rlp
189-
bindata = rlp.encode(<tx or block>)
188+
import rlp
189+
bindata = rlp.encode(<tx or block>)
190190

191191
To decode:
192192

193-
import rlp
194-
from ethereum.transactions import Transaction
195-
rlp.decode(blob, Transaction)
193+
import rlp
194+
from ethereum.transactions import Transaction
195+
rlp.decode(blob, Transaction)
196196

197197
Or:
198198

199-
import rlp
200-
from ethereum.blocks import Block
201-
rlp.decode(blob, Block)
199+
import rlp
200+
from ethereum.blocks import Block
201+
rlp.decode(blob, Block)
202202

203203
### Consensus abstraction
204204

@@ -223,15 +223,15 @@ Run `python3.6 -m pytest ethereum/tests/<filename>` for any .py file in that dir
223223

224224
To make your own state tests, use the tester module as follows:
225225

226-
```python
227-
from ethereum.tools import tester as t
228-
import json
229-
c = t.Chain()
230-
x = c.contract(<code>, language=<language>)
231-
pre = t.mk_state_test_prefill(c)
232-
x.foo(<args>)
233-
post = t.mk_state_test_postfill(c, pre)
234-
open('output.json', 'w').write(json.dumps(post, indent=4))
226+
```
227+
from ethereum.tools import tester as t
228+
import json
229+
c = t.Chain()
230+
x = c.contract(<code>, language=<language>)
231+
pre = t.mk_state_test_prefill(c)
232+
x.foo(<args>)
233+
post = t.mk_state_test_postfill(c, pre)
234+
open('output.json', 'w').write(json.dumps(post, indent=4))
235235
```
236236

237237
To make a test filler file instead, do `post = t.mk_state_test_postfill(c, pre, True)`.

0 commit comments

Comments
 (0)