Skip to content

Commit 32ad8dc

Browse files
committed
main logic refined async
1 parent 5ba6a04 commit 32ad8dc

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

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

0 commit comments

Comments
 (0)