diff --git a/docs/web3.eth.account.rst b/docs/web3.eth.account.rst index 1670b5d161..84834d904a 100644 --- a/docs/web3.eth.account.rst +++ b/docs/web3.eth.account.rst @@ -83,15 +83,13 @@ account you can just generate a random number that acts as a private key. To create a private key using web3.py and command line you can do: -```shell -python -c "from web3 import Web3; w3 = Web3(); acc = w3.eth.account.create(); print(f'private key={w3.toHex(acc.privateKey)}, account={acc.address}')" -``` +.. code-block:: shell + + python -c "from web3 import Web3; w3 = Web3(); acc = w3.eth.account.create(); print(f'private key={w3.to_hex(acc.key)}, account={acc.address}')" -Which outputs a new private key and an account pair: +Which outputs a new private key and an account pair:: -``` -private key=0x480c4aec9fa..., account=0x9202a9d5D2d129CB400a40e00aC822a53ED81167 -``` + private key=0x480c4aec9fa..., account=0x9202a9d5D2d129CB400a40e00aC822a53ED81167 - *Never store private key with your source*. Use environment variables to store the key. Read more below. diff --git a/newsfragments/3128.docs.rst b/newsfragments/3128.docs.rst new file mode 100644 index 0000000000..78d00b792f --- /dev/null +++ b/newsfragments/3128.docs.rst @@ -0,0 +1 @@ +Fix formatting in documentation for creating an account. \ No newline at end of file