Skip to content

Commit

Permalink
✨ Add height usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
NotJeremyLiu committed Feb 14, 2023
1 parent 1f00bf5 commit 08396e9
Showing 1 changed file with 37 additions and 12 deletions.
49 changes: 37 additions & 12 deletions playground.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -17,11 +17,11 @@
" 'key': None,\n",
" 'value': None,\n",
" 'proofOps': None,\n",
" 'height': '6661795',\n",
" 'height': '6987682',\n",
" 'codespace': 'sdk'}}}"
]
},
"execution_count": 8,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -46,7 +46,39 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'jsonrpc': '2.0',\n",
" 'id': 1,\n",
" 'method': 'abci_query',\n",
" 'params': {'path': '/cosmwasm.wasm.v1.Query/SmartContractState',\n",
" 'data': '0A3F6A756E6F313775763032617A7435343561673233787137776877367A337233636877376A777A746E72396C7970756779363264727133636171657964327233120C7B2270616972223A207B7D7D',\n",
" 'prove': False,\n",
" 'height': '6987682'}}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# if response is not an error, then you can turn decoded to True to see the return\n",
"payload = querier.create_payload(\n",
" contract_address=\"juno17uv02azt545ag23xq7whw6z3r3chw7jwztnr9lypugy62drq3caqeyd2r3\",\n",
" query={\"pair\":{}},\n",
" height=\"6987682\"\n",
" )\n",
"payload"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -61,23 +93,16 @@
" 'fee_config': {'total_fee_bps': 30, 'protocol_fee_bps': 3333}}"
]
},
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# if response is not an error, then you can turn decoded to True to see the return\n",
"payload = querier.create_payload(\n",
" contract_address=\"juno17uv02azt545ag23xq7whw6z3r3chw7jwztnr9lypugy62drq3caqeyd2r3\",\n",
" query={\"pair\":{}}\n",
" )\n",
"\n",
"response = await querier.query_node_and_return_response(\n",
" payload=payload,\n",
" decoded=True\n",
" )\n",
"\n",
"response"
]
},
Expand Down

0 comments on commit 08396e9

Please sign in to comment.