Skip to content

Commit 15927d6

Browse files
author
Igor
committed
add sync context manager
1 parent 2b0b423 commit 15927d6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def main():
2222
substrate = SubstrateInterface(
2323
url="wss://rpc.polkadot.io"
2424
)
25+
with substrate:
26+
result = substrate.query(
27+
module='System',
28+
storage_function='Account',
29+
params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
30+
)
2531

26-
result = substrate.query(
27-
module='System',
28-
storage_function='Account',
29-
params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
30-
)
31-
32-
print(result)
32+
print(result)
3333

3434
main()
3535
```

0 commit comments

Comments
 (0)