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

IOS-7805 Add High fee for Kaspa #835

Closed
wants to merge 11 commits into from

Conversation

amuraveinik
Copy link
Contributor

@amuraveinik amuraveinik commented Sep 10, 2024

@amuraveinik amuraveinik force-pushed the feature/IOS-7805_kaspa_fee_estimate branch from 986e7e0 to df32053 Compare September 10, 2024 22:02
@amuraveinik amuraveinik marked this pull request as ready for review September 12, 2024 18:57
@@ -95,6 +96,23 @@ class KaspaTransactionBuilder {
return KaspaTransactionData(inputs: inputs, outputs: builtTransaction.outputs)
}

func buildForMassCalculation(transaction: Transaction) throws -> KaspaTransactionData {
let builtTransaction = try buildForSign(transaction).0
let dummySignature = Data(repeating: 1, count: 65)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все-таки нужно было отправлять dummy подпись, отправка пустой строки пораждала ошибки

.map { mass, feeEstimate in
let buckets = [feeEstimate.priorityBucket] + feeEstimate.normalBuckets + feeEstimate.lowBuckets

let fees = buckets.prefix(3).reversed().map { bucket in
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это по мотивам сообщения
https://tangem.slack.com/archives/GMXC6PP71/p1725961364420259?thread_ts=1725606658.050429&cid=GMXC6PP71

Стараемся low не использовать вообще

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему сразу не составить массив buckets как нужно? Наполнять его, пока там не станет 3 значения, можно в отдельный билдер вынести, плохо читается префикс, реверс

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поддерживаю, тоже не особо понял зачем такие танцы с бубном

BlockchainSdkTests/Common/AddressTests.swift Outdated Show resolved Hide resolved
BlockchainSdk/Common/Blockchain.swift Show resolved Hide resolved
BlockchainSdkTests/Common/AddressTests.swift Outdated Show resolved Hide resolved
.map { mass, feeEstimate in
let buckets = [feeEstimate.priorityBucket] + feeEstimate.normalBuckets + feeEstimate.lowBuckets

let fees = buckets.prefix(3).reversed().map { bucket in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему сразу не составить массив buckets как нужно? Наполнять его, пока там не станет 3 значения, можно в отдельный билдер вынести, плохо читается префикс, реверс

init(isTestnet: Bool) {
self.isTestnet = isTestnet
self.prefix = isTestnet ? "kaspatest" : "kaspa"
self.version = isTestnet ? .P2PK_Schnorr : .P2PK_ECDSA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это точно правильно? Это вообще для Schnorr - это для другой кривой по идее

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут что-то странное, я пока этот код удалю, даже если тестнет работает с другим адресом, то надо сюда передавать другую кривую вообще

let address = CashAddrBech32.encode(version.rawValue.data + compressedKey, prefix: prefix)

let payloadData = isTestnet
? compressedKey.dropFirst()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это не из-за неправильной кривой такой фикс? Тестнет то работает?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У шнора как раз адрес короче на первый байт

@tureck1y
Copy link
Collaborator

Сделано через релизную ветку здесь #843

@tureck1y tureck1y closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants