Skip to content

Commit

Permalink
Merge pull request #448 from mysteriumnetwork/bugfix/Fix_saved_node_p…
Browse files Browse the repository at this point in the history
…ricing

Fix saved node pricing
  • Loading branch information
ArtemHryhorovGeniusee authored Aug 26, 2021
2 parents 95cf053 + a716464 commit ffaccfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ data class NodeEntity(
@ColumnInfo(name = "is_saved") var isSaved: Boolean,
) {

private companion object {
const val ETHER_VALUE = 1_000_000_000_000_000_000 // 1e18
}

constructor(proposalItem: ProposalItem, isFavourite: Boolean = false) : this(
id = proposalItem.providerID + proposalItem.serviceType,
providerID = proposalItem.providerID,
Expand All @@ -40,8 +44,8 @@ data class NodeEntity(
countryCode = proposal.countryCode,
nodeType = proposal.nodeType.nodeType,
currency = proposal.payment.currency,
pricePerSecond = proposal.payment.perHour / 60 / 60,
pricePerByte = proposal.payment.perGib / 1024 / 1024 / 1024,
pricePerSecond = proposal.payment.perHour / 60 / 60 * ETHER_VALUE,
pricePerByte = proposal.payment.perGib / 1024 / 1024 / 1024 * ETHER_VALUE,
qualityLevel = proposal.qualityLevel.level,
isSaved = isFavourite
)
Expand Down
2 changes: 1 addition & 1 deletion fastlane/android_version_code
Original file line number Diff line number Diff line change
@@ -1 +1 @@
107110
107111

0 comments on commit ffaccfe

Please sign in to comment.