Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 5.2.1 dev #385

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,23 @@ class RavencoinNetworkProvider(
}

override suspend fun getFee(): Result<BitcoinFee> {
val feeResponse = api.getFee(numberOfBlocks = FEE_NUMBER_OF_BLOCKS)
val feePerKb = feeResponse["$FEE_NUMBER_OF_BLOCKS"] ?: return Result.Failure(BlockchainSdkError.FailedToLoadFee)
val minimalRate = feePerKb * BigDecimal.valueOf(1.1)
val normalRate = feePerKb * BigDecimal.valueOf(1.3)
val priorityRate = feePerKb * BigDecimal.valueOf(1.5)
return Result.Success(
BitcoinFee(
minimalPerKb = minimalRate,
normalPerKb = normalRate,
priorityPerKb = priorityRate,
try {
val feeResponse = api.getFee(numberOfBlocks = FEE_NUMBER_OF_BLOCKS)
val feePerKb =
feeResponse["$FEE_NUMBER_OF_BLOCKS"] ?: return Result.Failure(BlockchainSdkError.FailedToLoadFee)
val minimalRate = feePerKb * BigDecimal.valueOf(1.1)
val normalRate = feePerKb * BigDecimal.valueOf(1.3)
val priorityRate = feePerKb * BigDecimal.valueOf(1.5)
return Result.Success(
BitcoinFee(
minimalPerKb = minimalRate,
normalPerKb = normalRate,
priorityPerKb = priorityRate,
)
)
)
} catch (e: Exception) {
return Result.Failure(e.toBlockchainSdkError())
}
}

override suspend fun sendTransaction(transaction: String): SimpleResult {
Expand Down
Loading