Skip to content

Commit 6ff17cb

Browse files
committed
Merge remote-tracking branch 'origin/v8/develop' into publish_tests
2 parents 1f0216a + 3843501 commit 6ff17cb

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

dkg/modules/asset/asset.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -386,24 +386,16 @@ def create(
386386
if token_amount:
387387
estimated_publishing_cost = token_amount
388388
else:
389-
time_until_next_epoch = self.blockchain_service.time_until_next_epoch()
390-
epoch_length = self.blockchain_service.epoch_length()
391389
stake_weighted_average_ask = (
392390
self.blockchain_service.get_stake_weighted_average_ask()
393391
)
394392

395393
# Convert to integers and perform calculation
396394
estimated_publishing_cost = (
397-
(
398-
int(stake_weighted_average_ask)
399-
* (
400-
int(epochs_num) * int(1e18)
401-
+ (int(time_until_next_epoch) * int(1e18)) // int(epoch_length)
402-
)
403-
* int(dataset_size)
404-
)
395+
int(stake_weighted_average_ask)
396+
* int(epochs_num)
397+
* int(dataset_size)
405398
// 1024
406-
// int(1e18)
407399
)
408400

409401
knowledge_collection_id = None

dkg/modules/asset/async_asset.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -398,26 +398,16 @@ async def create(
398398
if token_amount:
399399
estimated_publishing_cost = token_amount
400400
else:
401-
time_until_next_epoch = (
402-
await self.blockchain_service.time_until_next_epoch()
403-
)
404-
epoch_length = await self.blockchain_service.epoch_length()
405401
stake_weighted_average_ask = (
406402
await self.blockchain_service.get_stake_weighted_average_ask()
407403
)
408404

409405
# Convert to integers and perform calculation
410406
estimated_publishing_cost = (
411-
(
412-
int(stake_weighted_average_ask)
413-
* (
414-
int(epochs_num) * int(1e18)
415-
+ (int(time_until_next_epoch) * int(1e18)) // int(epoch_length)
416-
)
417-
* int(dataset_size)
418-
)
407+
int(stake_weighted_average_ask)
408+
* int(epochs_num)
409+
* int(dataset_size)
419410
// 1024
420-
// int(1e18)
421411
)
422412

423413
knowledge_collection_id = None

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dkg"
3-
version = "8.0.14"
3+
version = "8.1.0"
44
description = "Python library for interacting with the OriginTrail Decentralized Knowledge Graph"
55
authors = ["Uladzislau Hubar <hubar.uladzislau@gmail.com>, Zvonimir Sculac <zvonimir.sculac@origin-trail.com>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)