dkg 0.1.0b2__py3-none-any.whl → 0.1.0b4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dkg/asset.py +93 -37
- dkg/constants.py +41 -13
- dkg/data/interfaces/Assertion.json +26 -0
- dkg/data/interfaces/CommitManagerV1.json +26 -11
- dkg/data/interfaces/CommitManagerV1U1.json +26 -11
- dkg/data/interfaces/ContentAssetStorage.json +76 -0
- dkg/data/interfaces/HashingProxy.json +26 -0
- dkg/data/interfaces/Hub.json +2 -2
- dkg/data/interfaces/Identity.json +26 -0
- dkg/data/interfaces/ParametersStorage.json +19 -0
- dkg/data/interfaces/Profile.json +26 -0
- dkg/data/interfaces/ProfileStorage.json +3 -3
- dkg/data/interfaces/ProofManagerV1.json +28 -13
- dkg/data/interfaces/ProofManagerV1U1.json +28 -13
- dkg/data/interfaces/ScoringProxy.json +26 -0
- dkg/data/interfaces/ServiceAgreementStorageProxy.json +27 -12
- dkg/data/interfaces/ServiceAgreementStorageV1.json +5 -5
- dkg/data/interfaces/ServiceAgreementStorageV1U1.json +5 -5
- dkg/data/interfaces/ServiceAgreementV1.json +28 -24
- dkg/data/interfaces/ShardingTable.json +26 -0
- dkg/data/interfaces/Staking.json +26 -0
- dkg/data/interfaces/Token.json +60 -16
- dkg/exceptions.py +16 -0
- dkg/network.py +2 -4
- dkg/providers/blockchain.py +140 -35
- dkg/providers/node_http.py +23 -23
- dkg/types/__init__.py +1 -1
- dkg/types/blockchain.py +5 -2
- dkg/utils/ual.py +4 -1
- {dkg-0.1.0b2.dist-info → dkg-0.1.0b4.dist-info}/METADATA +1 -1
- dkg-0.1.0b4.dist-info/RECORD +64 -0
- dkg-0.1.0b2.dist-info/RECORD +0 -64
- {dkg-0.1.0b2.dist-info → dkg-0.1.0b4.dist-info}/LICENSE +0 -0
- {dkg-0.1.0b2.dist-info → dkg-0.1.0b4.dist-info}/WHEEL +0 -0
dkg/data/interfaces/Token.json
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
{
|
3
3
|
"inputs": [
|
4
4
|
{
|
5
|
-
"internalType": "
|
6
|
-
"name": "
|
7
|
-
"type": "
|
5
|
+
"internalType": "string",
|
6
|
+
"name": "tokenName",
|
7
|
+
"type": "string"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"internalType": "string",
|
11
|
+
"name": "tokenSymbol",
|
12
|
+
"type": "string"
|
8
13
|
}
|
9
14
|
],
|
10
15
|
"stateMutability": "nonpayable",
|
@@ -35,6 +40,25 @@
|
|
35
40
|
"name": "Approval",
|
36
41
|
"type": "event"
|
37
42
|
},
|
43
|
+
{
|
44
|
+
"anonymous": false,
|
45
|
+
"inputs": [
|
46
|
+
{
|
47
|
+
"indexed": true,
|
48
|
+
"internalType": "address",
|
49
|
+
"name": "previousOwner",
|
50
|
+
"type": "address"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"indexed": true,
|
54
|
+
"internalType": "address",
|
55
|
+
"name": "newOwner",
|
56
|
+
"type": "address"
|
57
|
+
}
|
58
|
+
],
|
59
|
+
"name": "OwnershipTransferred",
|
60
|
+
"type": "event"
|
61
|
+
},
|
38
62
|
{
|
39
63
|
"anonymous": false,
|
40
64
|
"inputs": [
|
@@ -326,19 +350,6 @@
|
|
326
350
|
"stateMutability": "view",
|
327
351
|
"type": "function"
|
328
352
|
},
|
329
|
-
{
|
330
|
-
"inputs": [],
|
331
|
-
"name": "hub",
|
332
|
-
"outputs": [
|
333
|
-
{
|
334
|
-
"internalType": "contract Hub",
|
335
|
-
"name": "",
|
336
|
-
"type": "address"
|
337
|
-
}
|
338
|
-
],
|
339
|
-
"stateMutability": "view",
|
340
|
-
"type": "function"
|
341
|
-
},
|
342
353
|
{
|
343
354
|
"inputs": [
|
344
355
|
{
|
@@ -394,6 +405,26 @@
|
|
394
405
|
"stateMutability": "view",
|
395
406
|
"type": "function"
|
396
407
|
},
|
408
|
+
{
|
409
|
+
"inputs": [],
|
410
|
+
"name": "owner",
|
411
|
+
"outputs": [
|
412
|
+
{
|
413
|
+
"internalType": "address",
|
414
|
+
"name": "",
|
415
|
+
"type": "address"
|
416
|
+
}
|
417
|
+
],
|
418
|
+
"stateMutability": "view",
|
419
|
+
"type": "function"
|
420
|
+
},
|
421
|
+
{
|
422
|
+
"inputs": [],
|
423
|
+
"name": "renounceOwnership",
|
424
|
+
"outputs": [],
|
425
|
+
"stateMutability": "nonpayable",
|
426
|
+
"type": "function"
|
427
|
+
},
|
397
428
|
{
|
398
429
|
"inputs": [
|
399
430
|
{
|
@@ -540,5 +571,18 @@
|
|
540
571
|
],
|
541
572
|
"stateMutability": "nonpayable",
|
542
573
|
"type": "function"
|
574
|
+
},
|
575
|
+
{
|
576
|
+
"inputs": [
|
577
|
+
{
|
578
|
+
"internalType": "address",
|
579
|
+
"name": "newOwner",
|
580
|
+
"type": "address"
|
581
|
+
}
|
582
|
+
],
|
583
|
+
"name": "transferOwnership",
|
584
|
+
"outputs": [],
|
585
|
+
"stateMutability": "nonpayable",
|
586
|
+
"type": "function"
|
543
587
|
}
|
544
588
|
]
|
dkg/exceptions.py
CHANGED
@@ -28,6 +28,22 @@ class DKGException(Exception):
|
|
28
28
|
"""
|
29
29
|
|
30
30
|
|
31
|
+
class EnvironmentNotSupported(DKGException):
|
32
|
+
"""
|
33
|
+
Raised when blockchain provider is initialized for unsupported environment.
|
34
|
+
"""
|
35
|
+
|
36
|
+
pass
|
37
|
+
|
38
|
+
|
39
|
+
class RPCURINotDefined(DKGException):
|
40
|
+
"""
|
41
|
+
Raised when blockchain provider is initialized without RPC URI defined.
|
42
|
+
"""
|
43
|
+
|
44
|
+
pass
|
45
|
+
|
46
|
+
|
31
47
|
class NetworkNotSupported(DKGException):
|
32
48
|
"""
|
33
49
|
Raised when blockchain provider is initialized for unsupported network.
|
dkg/network.py
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# specific language governing permissions and limitations
|
16
16
|
# under the License.
|
17
17
|
|
18
|
-
from dkg.constants import
|
18
|
+
from dkg.constants import DEFAULT_HASH_FUNCTION_ID
|
19
19
|
from dkg.manager import DefaultRequestManager
|
20
20
|
from dkg.method import Method
|
21
21
|
from dkg.module import Module
|
@@ -28,7 +28,6 @@ class Network(Module):
|
|
28
28
|
def __init__(self, manager: DefaultRequestManager):
|
29
29
|
self.manager = manager
|
30
30
|
|
31
|
-
_chain_id = Method(BlockchainRequest.chain_id)
|
32
31
|
_get_asset_storage_address = Method(BlockchainRequest.get_asset_storage_address)
|
33
32
|
|
34
33
|
_get_bid_suggestion = Method(NodeRequest.bid_suggestion)
|
@@ -36,14 +35,13 @@ class Network(Module):
|
|
36
35
|
def get_bid_suggestion(
|
37
36
|
self, public_assertion_id: DataHexStr, size_in_bytes: int, epochs_number: int,
|
38
37
|
) -> int:
|
39
|
-
chain_name = BLOCKCHAINS[self._chain_id()]["name"]
|
40
38
|
content_asset_storage_address = self._get_asset_storage_address(
|
41
39
|
"ContentAssetStorage"
|
42
40
|
)
|
43
41
|
|
44
42
|
return int(
|
45
43
|
self._get_bid_suggestion(
|
46
|
-
|
44
|
+
self.manager.blockchain_provider.blockchain_id,
|
47
45
|
epochs_number,
|
48
46
|
size_in_bytes,
|
49
47
|
content_asset_storage_address,
|
dkg/providers/blockchain.py
CHANGED
@@ -16,43 +16,81 @@
|
|
16
16
|
# under the License.
|
17
17
|
|
18
18
|
import json
|
19
|
+
import os
|
19
20
|
from collections import namedtuple
|
21
|
+
from functools import wraps
|
20
22
|
from pathlib import Path
|
21
23
|
from typing import Any, Type
|
22
24
|
|
23
|
-
|
24
|
-
from dkg.
|
25
|
+
import requests
|
26
|
+
from dkg.constants import BLOCKCHAINS, DEFAULT_GAS_PRICE_GWEI
|
27
|
+
from dkg.exceptions import (AccountMissing, EnvironmentNotSupported,
|
28
|
+
NetworkNotSupported, RPCURINotDefined)
|
29
|
+
from dkg.types import URI, Address, DataHexStr, Environment, Wei
|
25
30
|
from eth_account.signers.local import LocalAccount
|
31
|
+
from requests.exceptions import ConnectionError, HTTPError, RequestException, Timeout
|
26
32
|
from web3 import Web3
|
27
33
|
from web3.contract import Contract
|
28
34
|
from web3.contract.contract import ContractFunction
|
29
35
|
from web3.logs import DISCARD
|
30
36
|
from web3.middleware import construct_sign_and_send_raw_middleware
|
31
37
|
from web3.types import ABI, ABIFunction, TxReceipt
|
32
|
-
from dkg.constants import BLOCKCHAINS
|
33
38
|
|
34
39
|
|
35
40
|
class BlockchainProvider:
|
36
41
|
CONTRACTS_METADATA_DIR = Path(__file__).parents[1] / "data/interfaces"
|
37
42
|
|
38
|
-
GAS_BUFFER = 1.2 # 20% gas buffer for estimateGas()
|
39
|
-
|
40
43
|
def __init__(
|
41
44
|
self,
|
42
|
-
|
45
|
+
environment: Environment,
|
46
|
+
blockchain_id: str,
|
47
|
+
rpc_uri: URI | None = None,
|
43
48
|
private_key: DataHexStr | None = None,
|
44
49
|
verify: bool = True,
|
45
50
|
):
|
46
|
-
|
51
|
+
if environment not in BLOCKCHAINS.keys():
|
52
|
+
raise EnvironmentNotSupported(f"Environment {environment} isn't supported!")
|
53
|
+
|
54
|
+
self.environment = environment
|
55
|
+
self.rpc_uri = rpc_uri
|
56
|
+
self.blockchain_id = (
|
57
|
+
blockchain_id
|
58
|
+
if blockchain_id in BLOCKCHAINS[self.environment].keys()
|
59
|
+
else None
|
60
|
+
)
|
61
|
+
|
62
|
+
if self.rpc_uri is None and self.blockchain_id is not None:
|
63
|
+
self.blockchain_id = blockchain_id
|
64
|
+
self.rpc_uri = self.rpc_uri or BLOCKCHAINS[self.environment][
|
65
|
+
self.blockchain_id
|
66
|
+
].get("rpc", None)
|
47
67
|
|
48
|
-
if
|
49
|
-
raise
|
50
|
-
|
68
|
+
if self.rpc_uri is None:
|
69
|
+
raise RPCURINotDefined(
|
70
|
+
"No RPC URI provided for unrecognized "
|
71
|
+
f"blockchain ID {self.blockchain_id}"
|
51
72
|
)
|
52
|
-
|
73
|
+
|
74
|
+
self.w3 = Web3(
|
75
|
+
Web3.HTTPProvider(self.rpc_uri, request_kwargs={"verify": verify})
|
76
|
+
)
|
77
|
+
|
78
|
+
if self.blockchain_id is None:
|
79
|
+
self.blockchain_id = f"{blockchain_id}:{self.w3.eth.chain_id}"
|
80
|
+
if self.blockchain_id not in BLOCKCHAINS[self.environment]:
|
81
|
+
raise NetworkNotSupported(
|
82
|
+
f"Network with blockchain ID {self.blockchain_id} isn't supported!"
|
83
|
+
)
|
84
|
+
|
85
|
+
self.gas_price_oracle = BLOCKCHAINS[self.environment][self.blockchain_id].get(
|
86
|
+
"gas_price_oracle",
|
87
|
+
None,
|
88
|
+
)
|
53
89
|
|
54
90
|
self.abi = self._load_abi()
|
55
91
|
self.output_named_tuples = self._generate_output_named_tuples()
|
92
|
+
|
93
|
+
hub_address: Address = BLOCKCHAINS[self.environment][self.blockchain_id]["hub"]
|
56
94
|
self.contracts: dict[str, Contract] = {
|
57
95
|
"Hub": self.w3.eth.contract(
|
58
96
|
address=hub_address,
|
@@ -61,8 +99,11 @@ class BlockchainProvider:
|
|
61
99
|
}
|
62
100
|
self._init_contracts()
|
63
101
|
|
64
|
-
if
|
65
|
-
|
102
|
+
if (
|
103
|
+
private_key is not None or
|
104
|
+
(private_key_env := os.environ.get("PRIVATE_KEY", None)) is not None
|
105
|
+
):
|
106
|
+
self.set_account(private_key or private_key_env)
|
66
107
|
|
67
108
|
def make_json_rpc_request(self, endpoint: str, args: dict[str, Any] = {}) -> Any:
|
68
109
|
web3_method = getattr(self.w3.eth, endpoint)
|
@@ -72,6 +113,27 @@ class BlockchainProvider:
|
|
72
113
|
else:
|
73
114
|
return web3_method
|
74
115
|
|
116
|
+
@staticmethod
|
117
|
+
def handle_updated_contract(func):
|
118
|
+
@wraps(func)
|
119
|
+
def wrapper(self, *args, **kwargs):
|
120
|
+
contract_name = kwargs.get("contract") or (args[0] if args else None)
|
121
|
+
|
122
|
+
try:
|
123
|
+
return func(self, *args, **kwargs)
|
124
|
+
except Exception as err:
|
125
|
+
if (
|
126
|
+
contract_name
|
127
|
+
and any(msg in str(err) for msg in ["revert", "VM Exception"])
|
128
|
+
and not self._check_contract_status(contract_name)
|
129
|
+
):
|
130
|
+
self._update_contract_instance(contract_name)
|
131
|
+
return func(self, *args, **kwargs)
|
132
|
+
raise
|
133
|
+
|
134
|
+
return wrapper
|
135
|
+
|
136
|
+
@handle_updated_contract
|
75
137
|
def call_function(
|
76
138
|
self,
|
77
139
|
contract: str,
|
@@ -99,15 +161,13 @@ class BlockchainProvider:
|
|
99
161
|
)
|
100
162
|
|
101
163
|
nonce = self.w3.eth.get_transaction_count(self.w3.eth.default_account)
|
102
|
-
gas_price = gas_price
|
164
|
+
gas_price = gas_price or self._get_network_gas_price()
|
103
165
|
|
104
|
-
options = {
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
else:
|
110
|
-
options["gas"] = gas_limit
|
166
|
+
options = {
|
167
|
+
"nonce": nonce,
|
168
|
+
"gasPrice": gas_price,
|
169
|
+
"gas": gas_limit or contract_function(**args).estimate_gas(),
|
170
|
+
}
|
111
171
|
|
112
172
|
tx_hash = contract_function(**args).transact(options)
|
113
173
|
tx_receipt = self.w3.eth.wait_for_transaction_receipt(tx_hash)
|
@@ -130,25 +190,70 @@ class BlockchainProvider:
|
|
130
190
|
)
|
131
191
|
self.w3.eth.default_account = self.account.address
|
132
192
|
|
193
|
+
def _get_network_gas_price(self) -> int | None:
|
194
|
+
blockchain_name, chain_id = self.blockchain_id.split(":")
|
195
|
+
|
196
|
+
default_gas_price = self.w3.to_wei(DEFAULT_GAS_PRICE_GWEI, "gwei")
|
197
|
+
|
198
|
+
match blockchain_name:
|
199
|
+
case "otp":
|
200
|
+
return self.w3.eth.gas_price
|
201
|
+
case "gnosis":
|
202
|
+
if self.gas_price_oracle is None:
|
203
|
+
return default_gas_price
|
204
|
+
|
205
|
+
try:
|
206
|
+
response = requests.get(self.gas_price_oracle)
|
207
|
+
|
208
|
+
response.raise_for_status()
|
209
|
+
|
210
|
+
try:
|
211
|
+
response_json: dict = response.json()
|
212
|
+
except ValueError:
|
213
|
+
return default_gas_price
|
214
|
+
|
215
|
+
except (HTTPError, ConnectionError, Timeout, RequestException):
|
216
|
+
return default_gas_price
|
217
|
+
|
218
|
+
gas_price = None
|
219
|
+
match chain_id:
|
220
|
+
case "100":
|
221
|
+
gas_price_hex = response_json.get("result")
|
222
|
+
if gas_price_hex:
|
223
|
+
gas_price = int(gas_price_hex, 16)
|
224
|
+
case "10200":
|
225
|
+
gas_price_avg = response_json.get("average")
|
226
|
+
if gas_price_avg:
|
227
|
+
gas_price = self.w3.to_wei(gas_price_avg, "gwei")
|
228
|
+
|
229
|
+
return gas_price if gas_price is not None else default_gas_price
|
230
|
+
case _:
|
231
|
+
return default_gas_price
|
232
|
+
|
133
233
|
def _init_contracts(self):
|
134
234
|
for contract in self.abi.keys():
|
135
235
|
if contract == "Hub":
|
136
236
|
continue
|
137
237
|
|
138
|
-
self.
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
238
|
+
self._update_contract_instance(contract)
|
239
|
+
|
240
|
+
def _update_contract_instance(self, contract: str):
|
241
|
+
self.contracts[contract] = self.w3.eth.contract(
|
242
|
+
address=(
|
243
|
+
self.contracts["Hub"]
|
244
|
+
.functions.getContractAddress(contract).call()
|
245
|
+
if not contract.endswith("AssetStorage")
|
246
|
+
else self.contracts["Hub"]
|
247
|
+
.functions.getAssetStorageAddress(contract).call()
|
248
|
+
),
|
249
|
+
abi=self.abi[contract],
|
250
|
+
)
|
251
|
+
|
252
|
+
def _check_contract_status(self, contract: str) -> bool:
|
253
|
+
try:
|
254
|
+
return self.call_function(contract, "status")
|
255
|
+
except Exception:
|
256
|
+
return False
|
152
257
|
|
153
258
|
def _generate_output_named_tuples(self) -> dict[str, dict[str, Type[tuple]]]:
|
154
259
|
def generate_output_namedtuple(function_abi: ABIFunction) -> Type[tuple] | None:
|
dkg/providers/node_http.py
CHANGED
@@ -21,12 +21,13 @@ import requests
|
|
21
21
|
from dkg.dataclasses import HTTPRequestMethod, NodeResponseDict
|
22
22
|
from dkg.exceptions import HTTPRequestMethodNotSupported, NodeRequestError
|
23
23
|
from dkg.types import URI
|
24
|
-
from requests import
|
24
|
+
from requests.exceptions import HTTPError, ConnectionError, Timeout, RequestException
|
25
25
|
|
26
26
|
|
27
27
|
class NodeHTTPProvider:
|
28
|
-
def __init__(self, endpoint_uri: URI | str):
|
28
|
+
def __init__(self, endpoint_uri: URI | str, auth_token: str | None = None):
|
29
29
|
self.endpoint_uri = URI(endpoint_uri)
|
30
|
+
self.auth_token = auth_token
|
30
31
|
|
31
32
|
def make_request(
|
32
33
|
self,
|
@@ -34,29 +35,28 @@ class NodeHTTPProvider:
|
|
34
35
|
path: str,
|
35
36
|
params: dict[str, Any] = {},
|
36
37
|
data: dict[str, Any] = {},
|
37
|
-
) ->
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
) -> NodeResponseDict:
|
39
|
+
url = f"{self.endpoint_uri}/{path}"
|
40
|
+
headers = (
|
41
|
+
{"Authorization": f"Bearer {self.auth_token}"} if self.auth_token else {}
|
42
|
+
)
|
43
|
+
|
44
|
+
try:
|
45
|
+
if method == HTTPRequestMethod.GET:
|
46
|
+
response = requests.get(url, params=params, headers=headers)
|
47
|
+
elif method == HTTPRequestMethod.POST:
|
48
|
+
response = requests.post(url, json=data, headers=headers)
|
49
|
+
else:
|
46
50
|
raise HTTPRequestMethodNotSupported(
|
47
51
|
f"{method.name} method isn't supported"
|
48
52
|
)
|
49
53
|
|
50
|
-
|
51
|
-
try:
|
52
|
-
response = requests.get(f"{self.endpoint_uri}/{path}", params=params)
|
53
|
-
return NodeResponseDict(response.json())
|
54
|
-
except requests.exceptions.HTTPError as err:
|
55
|
-
raise NodeRequestError(err)
|
54
|
+
response.raise_for_status()
|
56
55
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
56
|
+
try:
|
57
|
+
return NodeResponseDict(response.json())
|
58
|
+
except ValueError as err:
|
59
|
+
raise NodeRequestError(f"JSON decoding failed: {err}")
|
60
|
+
|
61
|
+
except (HTTPError, ConnectionError, Timeout, RequestException) as err:
|
62
|
+
raise NodeRequestError(f"Request failed: {err}")
|
dkg/types/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
from .blockchain import (ABI, ABIElement, ABIError, ABIEvent, # NOQA: F401
|
2
|
-
ABIFunction, ABIParameter, AgreementData)
|
2
|
+
ABIFunction, ABIParameter, AgreementData, Environment)
|
3
3
|
from .dkg_node import UAL # NOQA: F401
|
4
4
|
from .encoding import BytesLike, DataHexStr, HexStr # NOQA: F401
|
5
5
|
from .evm import Address, ChecksumAddress, Wei # NOQA: F401
|
dkg/types/blockchain.py
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# specific language governing permissions and limitations
|
16
16
|
# under the License.
|
17
17
|
|
18
|
-
from typing import NamedTuple, TypedDict
|
18
|
+
from typing import Literal, NamedTuple, TypedDict
|
19
19
|
|
20
20
|
|
21
21
|
class ABIParameter(TypedDict, total=False):
|
@@ -50,9 +50,12 @@ ABIElement = ABIFunction | ABIEvent | ABIError
|
|
50
50
|
ABI = list[ABIElement]
|
51
51
|
|
52
52
|
|
53
|
+
Environment = Literal["development", "devnet", "testnet", "mainnet"]
|
54
|
+
|
55
|
+
|
53
56
|
class AgreementData(NamedTuple):
|
54
57
|
startTime: int
|
55
58
|
epochsNumber: int
|
56
59
|
epochLength: int
|
57
|
-
|
60
|
+
tokens: list[int]
|
58
61
|
scoreFunctionIdAndProofWindowOffsetPerc: list[int]
|
dkg/utils/ual.py
CHANGED
@@ -27,7 +27,10 @@ def format_ual(
|
|
27
27
|
|
28
28
|
|
29
29
|
def parse_ual(ual: UAL) -> dict[str, str | Address | int]:
|
30
|
-
|
30
|
+
if not ual.startswith("did:dkg:"):
|
31
|
+
raise ValidationError("Invalid UAL!")
|
32
|
+
|
33
|
+
args = ual.replace("did:dkg:", "").split("/")
|
31
34
|
|
32
35
|
if len(args) != 3:
|
33
36
|
raise ValidationError("Invalid UAL!")
|
@@ -0,0 +1,64 @@
|
|
1
|
+
dkg/__init__.py,sha256=2pZEIrpDODunXXZmcLuKLWUrTrWLlYj10f11VzK5oLs,108
|
2
|
+
dkg/assertion.py,sha256=Sp7mqLHuR588CRZ5JpMVDS2U0yOcwg-qbBl4xYOtRH8,2490
|
3
|
+
dkg/asset.py,sha256=gkt18YzD71OVXM21JD1yv-zjfutexof3rTibIFuXqYk,32841
|
4
|
+
dkg/constants.py,sha256=QkhwG82p7oZGktrej2UJjNUMq4cbjrd2aJtKkZSiGNw,2650
|
5
|
+
dkg/data/interfaces/Assertion.json,sha256=pgzJUSQoZ0G7zpGsrv1QZSBhM5UFp0Qma1mWHQBQrMg,2917
|
6
|
+
dkg/data/interfaces/AssertionStorage.json,sha256=WNvimMROngLiDmu4t-mn9wNDPPvrvEOkMYFfF8ayui4,4346
|
7
|
+
dkg/data/interfaces/CommitManagerV1.json,sha256=5nIY2HJsVai3rd-1QW_pP1jfsXbt0PAgYarxHKIe1mU,10774
|
8
|
+
dkg/data/interfaces/CommitManagerV1U1.json,sha256=4b4FQcQ9RO9CFtuQ-tDxzqQdr2fpt0je8s6vunKYIzs,14686
|
9
|
+
dkg/data/interfaces/ContentAsset.json,sha256=0lDQ9JQ59bKzLSaeVPerdlx2_Irci3IuQXtgme8UPKI,13497
|
10
|
+
dkg/data/interfaces/ContentAssetStorage.json,sha256=08TVURiV1t_oCUIp35mvQTEtJfU6FKCUxMD3xo5tHKU,14579
|
11
|
+
dkg/data/interfaces/HashingProxy.json,sha256=ZQs5wockebJPMmw-xUusOjUgnOtXhAMcnyI-wnBGgnI,4776
|
12
|
+
dkg/data/interfaces/Hub.json,sha256=uGWm4iS32qSMWV2HPPTaeOae4DuQUlVWfVUdJve0K38,6904
|
13
|
+
dkg/data/interfaces/Identity.json,sha256=WwHc0OQcq-JtXeA-yv4mjlfkQup_Kc624dwa82n79Tk,4042
|
14
|
+
dkg/data/interfaces/IdentityStorage.json,sha256=0wa0XXiHu119KapP5hxPp_4uwDkK5DzhSrUkgHVVYLs,6429
|
15
|
+
dkg/data/interfaces/ParametersStorage.json,sha256=Iw9RJWo64C1SPlDhqemuVfe3tK-1cCuZzNRg77Sfs5E,9175
|
16
|
+
dkg/data/interfaces/Profile.json,sha256=gClvUcyebQqvzg6YcGnMHkvI18YXPDhjFYterR4iPVY,5972
|
17
|
+
dkg/data/interfaces/ProfileStorage.json,sha256=0BfRWgxVr50tmdDj0CO_qO8VYfUqq_ESXUqCdzmSnxw,11376
|
18
|
+
dkg/data/interfaces/ProofManagerV1.json,sha256=mrZB5BVrQzRPlVxvjalK9TyD7S_AvRf0pPGuNoPHBY8,10557
|
19
|
+
dkg/data/interfaces/ProofManagerV1U1.json,sha256=UKZg3jW08y9xVrtl-qSw3uTNrRPNPK-Ji8XJfVWp-bU,11019
|
20
|
+
dkg/data/interfaces/ScoringProxy.json,sha256=PjvfsXXQ59h8-czvqQiDUAAIo0JpaXuoBoVtdg8iqBA,5105
|
21
|
+
dkg/data/interfaces/ServiceAgreementStorageProxy.json,sha256=QOBRUc1mFp7I4BeJfSctsuVBygRc7dGYKqb4ApMoCL0,26028
|
22
|
+
dkg/data/interfaces/ServiceAgreementStorageV1.json,sha256=y5TmlMa1AeuNH1uVQdtUoIc2ye3fw1I7os0dk78zByo,17858
|
23
|
+
dkg/data/interfaces/ServiceAgreementStorageV1U1.json,sha256=hYwGpMTvE52A3lgglwSNSwPRK6ZMvAp43HtaQ3LPjzs,21908
|
24
|
+
dkg/data/interfaces/ServiceAgreementV1.json,sha256=UoARf9NtVhsA85ON0nfrc3JGLBsTBTXIS-2thST0itg,15165
|
25
|
+
dkg/data/interfaces/ShardingTable.json,sha256=4kATclJqW1K5nL3wSbiTO8ZZIQHSabtiuFj0N07WiQk,5700
|
26
|
+
dkg/data/interfaces/ShardingTableStorage.json,sha256=bOD24CjC1ch40ZCjfdNL4Oj1nyMjDbyK5sn2uKB33Gk,6112
|
27
|
+
dkg/data/interfaces/Staking.json,sha256=ObhNMIH6cQWdyJWAsiFPkMHDpWNBlnnlbQxkzc11NlE,9392
|
28
|
+
dkg/data/interfaces/StakingStorage.json,sha256=YAvfqQDiKtNP531Z3RrpW8kY9km1mrNoEofU-xOyqMw,7718
|
29
|
+
dkg/data/interfaces/Token.json,sha256=vvTgWTyhjMa5Q-v7fOM4zVH5m_TVdahP14JQMk9gzxw,10912
|
30
|
+
dkg/data/interfaces/UnfinalizedStateStorage.json,sha256=5muoK6W1_CyHjfHWLvl53TpEChnOPP5EBbUfhZE9QbI,3086
|
31
|
+
dkg/data/interfaces/WhitelistStorage.json,sha256=Z7ABHU1iIh6rWM0pSszbUNYTMeJShBXAzdwdwrg7ErY,2193
|
32
|
+
dkg/dataclasses.py,sha256=fwwuXfSNCFv8eIYfGIJzBd_zR75YXl55WuPALmr9iM0,1255
|
33
|
+
dkg/exceptions.py,sha256=7KUn4C8_3jQBo1xOb_2fmtFn_748jis-MKjxv-z3W_4,3754
|
34
|
+
dkg/graph.py,sha256=YVMjJ2BA7KgNxXKammRTRLQtHBsWwY_dqzs_4-seFB0,2248
|
35
|
+
dkg/main.py,sha256=DfmUi1tP-PsGFOmeeMYLIH_hWHdVEaWHiXdxm_1pkEc,2752
|
36
|
+
dkg/manager.py,sha256=cT0dgkpOVphfodzO9ncXZxNu26zet6ED5XfIXORpLog,2627
|
37
|
+
dkg/method.py,sha256=BwL0CcBubNzUPHVxmf2U1k1vsvGOz3fn2fm-xsc7fbg,5143
|
38
|
+
dkg/module.py,sha256=sYEpD_iHPYcGg791Qnk0kF4oZVFageXymfT6tXNDmMo,2565
|
39
|
+
dkg/network.py,sha256=8vp7Ma5mTDTavtFqmfuZF5Vx0K_i3WWEyVTl_8WmKxg,1939
|
40
|
+
dkg/node.py,sha256=qKPVDfB2DpGP1k5hCNAqtzghu8f1Tsr9OAl2f1a2Bqg,1212
|
41
|
+
dkg/providers/__init__.py,sha256=Z3Wp3ap4U4mnFgMQx8A-oyUdUAKrl3WKxGLYX15aj4s,99
|
42
|
+
dkg/providers/blockchain.py,sha256=xPdCBPpMNiOU0jCObqcxE5FNDFO9kCRQFYQrsjj5vGw,10599
|
43
|
+
dkg/providers/node_http.py,sha256=9pxUiIRDKlGMNHOqP0SJO178B9MkBekfMJyePVSXOFA,2393
|
44
|
+
dkg/types/__init__.py,sha256=ZZIPYZrfk2qQ33PM1-hRDddxZx4u7HnnHJER_bLzJ7g,459
|
45
|
+
dkg/types/blockchain.py,sha256=hsBpFLgpcEmgODLK0g_cUW1AB69ZZYeX4AcW6wpAMtA,1682
|
46
|
+
dkg/types/dkg_node.py,sha256=uGjaYUO4D55sHJrL_3aOL3Nul3RlAo_aL4HLoSrQxr0,838
|
47
|
+
dkg/types/encoding.py,sha256=gOtt9XLoxs6TE7rOCrAx-aCOdsDdaTVn3bxu9HPavxc,915
|
48
|
+
dkg/types/evm.py,sha256=gN2hSq4MQzobWE3YAiTZPcv5b65AVyUEQut8hWPnx68,971
|
49
|
+
dkg/types/generics.py,sha256=9ZGFGWp4eN_5bGaWF6COtFMh228ZghjU1CmUok0fuds,907
|
50
|
+
dkg/types/network.py,sha256=htNZ00Vrb-wMcR4_XI1tn_-0uVjDqcW7hhdHyjbyq1g,838
|
51
|
+
dkg/types/rdf.py,sha256=qm1l7pqTLWBlSmaoQhmBg2qKS16eF83IcOnxuYPdiv8,851
|
52
|
+
dkg/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
|
+
dkg/utils/blockchain_request.py,sha256=zj-zPxzwsH0LAheloRMAOWQ6nuu4tlzEHRWdpgACN7U,5011
|
54
|
+
dkg/utils/decorators.py,sha256=uUh0xI9wv1gE6JF44eYEfUPGSFEBLR6Ua5D9Dhc3s10,1566
|
55
|
+
dkg/utils/merkle.py,sha256=kyKawNUixQy02iQZgLDMsOpqWebTE_lI1VWiPKyhdvI,5135
|
56
|
+
dkg/utils/metadata.py,sha256=483OroYwGNfZ_cCXfH3-xUrZgiR4mjjo9iU_Ie5RYRs,1658
|
57
|
+
dkg/utils/node_request.py,sha256=bgkk5iR4abGwSmSsVFWXG06kD3sAa7a1VD3uS8_aNF4,6704
|
58
|
+
dkg/utils/rdf.py,sha256=FF4O4JOftiFVxjr6k8TmxYBcB7dVbpnDOMWk8BvTBRE,2860
|
59
|
+
dkg/utils/string_transformations.py,sha256=UtoXbuy4Y0ontbX6l9HwcrZ9tEXJEith00hW7pz4sKg,971
|
60
|
+
dkg/utils/ual.py,sha256=g7PFyS4Sbwjmwkq-eB20uRULEC2wlPGZr31BVQjs5OQ,1569
|
61
|
+
dkg-0.1.0b4.dist-info/LICENSE,sha256=Dr70w2zcW8-jrPGlpTTTlJPL8lR4j2zpDD32tdEFgjY,11375
|
62
|
+
dkg-0.1.0b4.dist-info/METADATA,sha256=jOnAWNLRTUwGKoRPK2CdeN8Sr-z1QkrubwoGai2oj18,15091
|
63
|
+
dkg-0.1.0b4.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
64
|
+
dkg-0.1.0b4.dist-info/RECORD,,
|
dkg-0.1.0b2.dist-info/RECORD
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
dkg/__init__.py,sha256=2pZEIrpDODunXXZmcLuKLWUrTrWLlYj10f11VzK5oLs,108
|
2
|
-
dkg/assertion.py,sha256=Sp7mqLHuR588CRZ5JpMVDS2U0yOcwg-qbBl4xYOtRH8,2490
|
3
|
-
dkg/asset.py,sha256=2F1dh-4WFnXeMW99SxTUXSMpd6c7BoRi3JqVXf1YiL0,30650
|
4
|
-
dkg/constants.py,sha256=KYANI8t1Xs35oC6Zf2fnSDphP4b0M5ZZddxlsvMRQ3Q,1569
|
5
|
-
dkg/data/interfaces/Assertion.json,sha256=PXouqSR-LCnj47puplhI8jpGrj_5ZrljSLs_TE4Sofs,2465
|
6
|
-
dkg/data/interfaces/AssertionStorage.json,sha256=WNvimMROngLiDmu4t-mn9wNDPPvrvEOkMYFfF8ayui4,4346
|
7
|
-
dkg/data/interfaces/CommitManagerV1.json,sha256=JHegWrQtEYmLqzv5x9qtooBD_U4Nf5KSUTHJDoB0BEg,10513
|
8
|
-
dkg/data/interfaces/CommitManagerV1U1.json,sha256=5khU3wkConV7HWbmM-qT7F4iTUkLcMMxxvv0K59KDI0,14425
|
9
|
-
dkg/data/interfaces/ContentAsset.json,sha256=0lDQ9JQ59bKzLSaeVPerdlx2_Irci3IuQXtgme8UPKI,13497
|
10
|
-
dkg/data/interfaces/ContentAssetStorage.json,sha256=RYq6KqnPheJNDLmoT5EgQi1Ekvg-qaICZGZA1jZUkrE,13189
|
11
|
-
dkg/data/interfaces/HashingProxy.json,sha256=HhM54uWv15Ol6dDT_XeNrSHHdOUNNbER50HCUtutcuE,4324
|
12
|
-
dkg/data/interfaces/Hub.json,sha256=P3PJbD5pfHDtUOrCNnHnEDGHFny6-zV1oyqbrGhzvXE,6896
|
13
|
-
dkg/data/interfaces/Identity.json,sha256=MzpsT_Id8EiG7nwGCTfja-mnD9Jq91WN_GiA9S723xw,3590
|
14
|
-
dkg/data/interfaces/IdentityStorage.json,sha256=0wa0XXiHu119KapP5hxPp_4uwDkK5DzhSrUkgHVVYLs,6429
|
15
|
-
dkg/data/interfaces/ParametersStorage.json,sha256=wR10ijxDCWyJ1nxpCg4pvHRcM0yts0PO7nzAxof4oYU,8795
|
16
|
-
dkg/data/interfaces/Profile.json,sha256=FOiMudmsml-n2ENDtXxbBJAuiRs2b43rNRZCf-wDpXQ,5520
|
17
|
-
dkg/data/interfaces/ProfileStorage.json,sha256=2R0SiPcQca0n183qGsZy-CtnV-VlknyRvaa6tEu3ML0,11334
|
18
|
-
dkg/data/interfaces/ProofManagerV1.json,sha256=1alCi4jDzPBMZnEzpA77Yk0wG1cL_Zy24dGJ-qHP6T4,10276
|
19
|
-
dkg/data/interfaces/ProofManagerV1U1.json,sha256=2rS10XoOb9fwqZutFM22Mp1inZM8d4TSS8AOyyuiaP4,10738
|
20
|
-
dkg/data/interfaces/ScoringProxy.json,sha256=Y99XB-KnmEfWOICzPueC2UYKWi9tXTJbQxgqFpWd8IY,4653
|
21
|
-
dkg/data/interfaces/ServiceAgreementStorageProxy.json,sha256=MiBvsPhyK86cGWY1lMzoHRTwP2lMEMlDwDCCCbaEwNc,25691
|
22
|
-
dkg/data/interfaces/ServiceAgreementStorageV1.json,sha256=BY5tKy22mGFtdhUvFk6XO0BX0DJ5PfO_74zS9JAIH9s,17776
|
23
|
-
dkg/data/interfaces/ServiceAgreementStorageV1U1.json,sha256=VFpdKO5mZEuXlsFfzabhSHV9YlPuZ1bHx3c7mBpnkQU,21831
|
24
|
-
dkg/data/interfaces/ServiceAgreementV1.json,sha256=Y37OII_iWbJmbIeGCpaXvwOLp9vdVGstM93e1nRQzkU,15079
|
25
|
-
dkg/data/interfaces/ShardingTable.json,sha256=ShYjoeSMu0831lBp6qVOrwrM4Sdrcp2ITtLyMriC82k,5248
|
26
|
-
dkg/data/interfaces/ShardingTableStorage.json,sha256=bOD24CjC1ch40ZCjfdNL4Oj1nyMjDbyK5sn2uKB33Gk,6112
|
27
|
-
dkg/data/interfaces/Staking.json,sha256=f92O0xFW8idQVSXkV6dChlqvJcOJqErp9xxn88R17lE,8940
|
28
|
-
dkg/data/interfaces/StakingStorage.json,sha256=YAvfqQDiKtNP531Z3RrpW8kY9km1mrNoEofU-xOyqMw,7718
|
29
|
-
dkg/data/interfaces/Token.json,sha256=w6XjiACAVhYtLTkjcCUsuahhhepp8Yauvrm5gM117p8,10045
|
30
|
-
dkg/data/interfaces/UnfinalizedStateStorage.json,sha256=5muoK6W1_CyHjfHWLvl53TpEChnOPP5EBbUfhZE9QbI,3086
|
31
|
-
dkg/data/interfaces/WhitelistStorage.json,sha256=Z7ABHU1iIh6rWM0pSszbUNYTMeJShBXAzdwdwrg7ErY,2193
|
32
|
-
dkg/dataclasses.py,sha256=fwwuXfSNCFv8eIYfGIJzBd_zR75YXl55WuPALmr9iM0,1255
|
33
|
-
dkg/exceptions.py,sha256=b4_liOjocwoZ6mpjYvgph74WylIxj1Q8OR8ypKUg26Q,3459
|
34
|
-
dkg/graph.py,sha256=YVMjJ2BA7KgNxXKammRTRLQtHBsWwY_dqzs_4-seFB0,2248
|
35
|
-
dkg/main.py,sha256=DfmUi1tP-PsGFOmeeMYLIH_hWHdVEaWHiXdxm_1pkEc,2752
|
36
|
-
dkg/manager.py,sha256=cT0dgkpOVphfodzO9ncXZxNu26zet6ED5XfIXORpLog,2627
|
37
|
-
dkg/method.py,sha256=BwL0CcBubNzUPHVxmf2U1k1vsvGOz3fn2fm-xsc7fbg,5143
|
38
|
-
dkg/module.py,sha256=sYEpD_iHPYcGg791Qnk0kF4oZVFageXymfT6tXNDmMo,2565
|
39
|
-
dkg/network.py,sha256=OItSMsxbkH-RBkLbwy5mCZOIVO61PPlr1RiK4OkqYLw,2026
|
40
|
-
dkg/node.py,sha256=qKPVDfB2DpGP1k5hCNAqtzghu8f1Tsr9OAl2f1a2Bqg,1212
|
41
|
-
dkg/providers/__init__.py,sha256=Z3Wp3ap4U4mnFgMQx8A-oyUdUAKrl3WKxGLYX15aj4s,99
|
42
|
-
dkg/providers/blockchain.py,sha256=3w0YXFYD8EkhdyNPaw_TX81xJ5TCcvuYoBHiycdiSqc,6827
|
43
|
-
dkg/providers/node_http.py,sha256=i6U7JavXpv8HLPPz7Uo9g1K4S9kauUnRT-jSmGpHHRE,2389
|
44
|
-
dkg/types/__init__.py,sha256=k5tPpE2BKfkijWly04yHFQJwbx64pOgZjsgJ3dS58BE,446
|
45
|
-
dkg/types/blockchain.py,sha256=TGPbhv5uCbRR3-jJ0tv_7YoWnj5OyPFeEou9kGEPN4g,1606
|
46
|
-
dkg/types/dkg_node.py,sha256=uGjaYUO4D55sHJrL_3aOL3Nul3RlAo_aL4HLoSrQxr0,838
|
47
|
-
dkg/types/encoding.py,sha256=gOtt9XLoxs6TE7rOCrAx-aCOdsDdaTVn3bxu9HPavxc,915
|
48
|
-
dkg/types/evm.py,sha256=gN2hSq4MQzobWE3YAiTZPcv5b65AVyUEQut8hWPnx68,971
|
49
|
-
dkg/types/generics.py,sha256=9ZGFGWp4eN_5bGaWF6COtFMh228ZghjU1CmUok0fuds,907
|
50
|
-
dkg/types/network.py,sha256=htNZ00Vrb-wMcR4_XI1tn_-0uVjDqcW7hhdHyjbyq1g,838
|
51
|
-
dkg/types/rdf.py,sha256=qm1l7pqTLWBlSmaoQhmBg2qKS16eF83IcOnxuYPdiv8,851
|
52
|
-
dkg/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
|
-
dkg/utils/blockchain_request.py,sha256=zj-zPxzwsH0LAheloRMAOWQ6nuu4tlzEHRWdpgACN7U,5011
|
54
|
-
dkg/utils/decorators.py,sha256=uUh0xI9wv1gE6JF44eYEfUPGSFEBLR6Ua5D9Dhc3s10,1566
|
55
|
-
dkg/utils/merkle.py,sha256=kyKawNUixQy02iQZgLDMsOpqWebTE_lI1VWiPKyhdvI,5135
|
56
|
-
dkg/utils/metadata.py,sha256=483OroYwGNfZ_cCXfH3-xUrZgiR4mjjo9iU_Ie5RYRs,1658
|
57
|
-
dkg/utils/node_request.py,sha256=bgkk5iR4abGwSmSsVFWXG06kD3sAa7a1VD3uS8_aNF4,6704
|
58
|
-
dkg/utils/rdf.py,sha256=FF4O4JOftiFVxjr6k8TmxYBcB7dVbpnDOMWk8BvTBRE,2860
|
59
|
-
dkg/utils/string_transformations.py,sha256=UtoXbuy4Y0ontbX6l9HwcrZ9tEXJEith00hW7pz4sKg,971
|
60
|
-
dkg/utils/ual.py,sha256=VcXesffAMDMMu4MP7y0DdR8assLG4yXFIT_d3Mopb6Q,1474
|
61
|
-
dkg-0.1.0b2.dist-info/LICENSE,sha256=Dr70w2zcW8-jrPGlpTTTlJPL8lR4j2zpDD32tdEFgjY,11375
|
62
|
-
dkg-0.1.0b2.dist-info/METADATA,sha256=gx4EDi-xG_-yudUtEXiGDAmvuVDsXO6i_RsB_yD2p3k,15091
|
63
|
-
dkg-0.1.0b2.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
64
|
-
dkg-0.1.0b2.dist-info/RECORD,,
|
File without changes
|
File without changes
|