Skip to content

Commit 8bec6d6

Browse files
committed
Removed Update related functions
1 parent 18fcaaf commit 8bec6d6

File tree

6 files changed

+0
-321
lines changed

6 files changed

+0
-321
lines changed

dkg/data/interfaces/UnfinalizedStateStorage.json

Lines changed: 0 additions & 171 deletions
This file was deleted.

dkg/paranet.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -424,37 +424,6 @@ def claim_voter_reward(
424424
_get_updating_knowledge_asset_states = Method(
425425
BlockchainRequest.get_updating_knowledge_asset_states
426426
)
427-
_process_updated_knowledge_asset_states_metadata = Method(
428-
BlockchainRequest.process_updated_knowledge_asset_states_metadata
429-
)
430-
431-
def update_claimable_rewards(self, ual: UAL) -> dict[str, str | HexStr | TxReceipt]:
432-
parsed_ual = parse_ual(ual)
433-
knowledge_asset_storage, knowledge_asset_token_id = (
434-
parsed_ual["contract_address"],
435-
parsed_ual["token_id"],
436-
)
437-
438-
paranet_id = Web3.solidity_keccak(
439-
["address", "uint256"], [knowledge_asset_storage, knowledge_asset_token_id]
440-
)
441-
442-
updating_states = self._get_updating_knowledge_asset_states(
443-
self.manager.blockchain_provider.account.address,
444-
paranet_id,
445-
)
446-
receipt: TxReceipt = self._process_updated_knowledge_asset_states_metadata(
447-
knowledge_asset_storage,
448-
knowledge_asset_token_id,
449-
0,
450-
len(updating_states),
451-
)
452-
453-
return {
454-
"paranetUAL": ual,
455-
"paranetId": paranet_id,
456-
"operation": json.loads(Web3.to_json(receipt)),
457-
}
458427

459428
def _get_incentives_pool_contract(
460429
self,

dkg/utils/blockchain_request.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,6 @@ class BlockchainRequest:
9393
function="burnAsset",
9494
args={"tokenId": int},
9595
)
96-
update_asset_state = ContractTransaction(
97-
contract="ContentAsset",
98-
function="updateAssetState",
99-
args={
100-
"tokenId": int,
101-
"assertionId": bytes | HexStr,
102-
"size": int,
103-
"triplesNumber": int,
104-
"chunksNumber": int,
105-
"updateTokenAmount": int,
106-
},
107-
)
108-
cancel_asset_state_update = ContractTransaction(
109-
contract="ContentAsset",
110-
function="cancelAssetStateUpdate",
111-
args={"tokenId": int},
112-
)
11396
extend_asset_storing_period = ContractTransaction(
11497
contract="ContentAsset",
11598
function="extendAssetStoringPeriod",
@@ -120,11 +103,6 @@ class BlockchainRequest:
120103
function="increaseAssetTokenAmount",
121104
args={"tokenId": int, "tokenAmount": int},
122105
)
123-
increase_asset_update_token_amount = ContractTransaction(
124-
contract="ContentAsset",
125-
function="increaseAssetUpdateTokenAmount",
126-
args={"tokenId": int, "tokenAmount": int},
127-
)
128106

129107
transfer_asset = ContractTransaction(
130108
contract="ContentAssetStorage",
@@ -249,16 +227,6 @@ class BlockchainRequest:
249227
"paranetId": HexStr,
250228
},
251229
)
252-
process_updated_knowledge_asset_states_metadata = ContractTransaction(
253-
contract="Paranet",
254-
function="processUpdatedKnowledgeAssetStatesMetadata",
255-
args={
256-
"paranetKAStorageContract": Address,
257-
"paranetKATokenId": int,
258-
"start": int,
259-
"end": int,
260-
},
261-
)
262230

263231
is_knowledge_miner_registered = ContractCall(
264232
contract="ParanetsRegistry",

dkg/utils/node_request.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,6 @@ class NodeRequest:
6969
"hashFunctionId": int,
7070
},
7171
)
72-
update = NodeCall(
73-
method=HTTPRequestMethod.POST,
74-
path="update",
75-
data={
76-
"assertionId": str,
77-
"assertion": NQuads,
78-
"blockchain": str,
79-
"contract": Address,
80-
"tokenId": int,
81-
"hashFunctionId": int,
82-
},
83-
)
8472
get = NodeCall(
8573
method=HTTPRequestMethod.POST,
8674
path="get",
@@ -115,17 +103,6 @@ class PublishOperationStatus(Enum):
115103
PUBLISH_END = auto()
116104

117105

118-
class UpdateOperationStatus(AutoStrEnumUpperCase):
119-
UPDATE_START = auto()
120-
UPDATE_INIT_START = auto()
121-
UPDATE_INIT_END = auto()
122-
UPDATE_REPLICATE_START = auto()
123-
UPDATE_REPLICATE_END = auto()
124-
VALIDATING_UPDATE_ASSERTION_REMOTE_START = auto()
125-
VALIDATING_UPDATE_ASSERTION_REMOTE_END = auto()
126-
UPDATE_END = auto()
127-
128-
129106
class StoreTypes(AutoStrEnumUpperCase):
130107
TRIPLE = auto()
131108
PENDING = auto()
@@ -171,7 +148,6 @@ class OperationStatus(AutoStrEnumUpperCase):
171148
DIAL_PROTOCOL_END = auto()
172149
LOCAL_STORE = LocalStoreOperationStatus
173150
PUBLISH = PublishOperationStatus
174-
UPDATE = UpdateOperationStatus
175151
GET = GetOperationStatus
176152
QUERY = QueryOperationStatus
177153

examples/demo.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -154,26 +154,6 @@ def print_json(json_dict: dict):
154154
print_json(get_asset_result)
155155
divider()
156156

157-
update_asset_result = dkg.asset.update(
158-
create_asset_result["UAL"],
159-
{
160-
"private": {
161-
"@context": ["https://schema.org"],
162-
"@graph": [
163-
{
164-
"@id": "uuid:user:1",
165-
"name": "Adam",
166-
"lastname": "Smith",
167-
"identifier": f"{math.floor(random.random() * 1e10)}",
168-
},
169-
],
170-
},
171-
},
172-
)
173-
print("======================== ASSET UPDATED")
174-
print_json(update_asset_result)
175-
divider()
176-
177157
get_latest_asset_result = dkg.asset.get(create_asset_result["UAL"], "latest", "all")
178158
print("======================== ASSET LATEST RESOLVED")
179159
print_json(get_latest_asset_result)
@@ -206,13 +186,6 @@ def print_json(json_dict: dict):
206186
print_json(get_first_state_by_hash)
207187
divider()
208188

209-
get_second_state_by_hash = dkg.asset.get(
210-
create_asset_result["UAL"], update_asset_result["publicAssertionId"], "all"
211-
)
212-
print("======================== ASSET SECOND STATE (GET BY STATE HASH) RESOLVED")
213-
print_json(get_second_state_by_hash)
214-
divider()
215-
216189
query_result = dkg.graph.query(
217190
"construct { ?s ?p ?o } where { ?s ?p ?o . <uuid:user:1> ?p ?o }", "privateCurrent"
218191
)

examples/paranets_demo.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -307,39 +307,3 @@ def print_reward_stats(is_voter: bool = False):
307307
divider()
308308

309309
print_reward_stats()
310-
311-
divider()
312-
313-
update_asset_result = dkg.asset.update(
314-
create_submit_ka1_result["UAL"],
315-
{
316-
"private": {
317-
"@context": ["https://schema.org"],
318-
"@graph": [
319-
{
320-
"@id": "uuid:user:1",
321-
"name": "Adam",
322-
"lastname": "Smith",
323-
},
324-
],
325-
},
326-
},
327-
100000000000000000000
328-
)
329-
330-
print("======================== KA1 UPDATED")
331-
print_json(update_asset_result)
332-
333-
print("Waiting 30 seconds for the update finalization...")
334-
time.sleep(30)
335-
336-
divider()
337-
338-
update_claimable_rewards_result = dkg.paranet.update_claimable_rewards(paranet_ual)
339-
340-
print("======================== UPDATED CLAIMABLE REWARDS")
341-
print_json(update_claimable_rewards_result)
342-
343-
divider()
344-
345-
print_reward_stats()

0 commit comments

Comments
 (0)