Skip to content

Commit

Permalink
Renamed extension
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanz committed Jun 7, 2023
1 parent 83ae53c commit 9f3398d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 48 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/test.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Python Substrate Polkascan Extension
# Python Substrate Interface: Polkascan Extension

[![Latest Version](https://img.shields.io/pypi/v/substrate-interface-polkascan.svg)](https://pypi.org/project/substrate-interface-polkascan/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/substrate-interface-polkascan.svg)](https://pypi.org/project/substrate-interface/)
[![License](https://img.shields.io/pypi/l/substrate-interface-polkascan.svg)](https://github.com/polkascan/py-substrate-interface-extension-polkascan/blob/master/LICENSE)


## Description
This extension enables [Substrate Interface](https://github.com/polkascan/py-substrate-interface) to use indexes provided by [Polkascan Explorer API](https://github.com/polkascan/explorer#explorer-api-component)
This extension enables [Substrate Interface](https://github.com/polkascan/py-substrate-interface) to use indexes provided by the [Polkascan Explorer API](https://github.com/polkascan/explorer#explorer-api-component)

## Installation
```bash
Expand All @@ -16,12 +16,12 @@ pip install substrate-interface-polkascan
## Initialization

```python
from substrateinterface import SubstrateInterface
from substrateinterface_polkascan.extensions import PolkascanSearchExtension
from substrateinterface import SubstrateInterface
from substrateinterface_polkascan.extensions import PolkascanExtension

substrate = SubstrateInterface(url="ws://127.0.0.1:9944")

substrate.register_extension(PolkascanSearchExtension(url='http://127.0.0.1:8000/graphql/'))
substrate.register_extension(PolkascanExtension(url='http://127.0.0.1:8000/graphql/'))
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion substrateinterface_polkascan/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from gql.transport.aiohttp import AIOHTTPTransport


class PolkascanSearchExtension(SearchExtension):
class PolkascanExtension(SearchExtension):

def __init__(self, url: str):
self.url = url
Expand Down
4 changes: 2 additions & 2 deletions test/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from os import environ

from substrateinterface import SubstrateInterface
from substrateinterface_polkascan.extensions import PolkascanSearchExtension
from substrateinterface_polkascan.extensions import PolkascanExtension

POLKADOT_NODE_URL = environ.get('SUBSTRATE_NODE_URL_POLKADOT') or 'ws://127.0.0.1:9944'
POLKASCAN_API_URL = environ.get('POLKASCAN_API_URL') or 'http://127.0.0.1:8000/graphql/'
Expand All @@ -30,7 +30,7 @@ class TestExtension(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.substrate = SubstrateInterface(url=POLKADOT_NODE_URL)
cls.substrate.register_extension(PolkascanSearchExtension(url=POLKASCAN_API_URL))
cls.substrate.register_extension(PolkascanExtension(url=POLKASCAN_API_URL))

def test_filter_events(self):

Expand Down

0 comments on commit 9f3398d

Please sign in to comment.