-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
986e7e0
to
df32053
Compare
@@ -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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 не использовать вообще
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему сразу не составить массив buckets как нужно? Наполнять его, пока там не станет 3 значения, можно в отдельный билдер вынести, плохо читается префикс, реверс
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поддерживаю, тоже не особо понял зачем такие танцы с бубном
.map { mass, feeEstimate in | ||
let buckets = [feeEstimate.priorityBucket] + feeEstimate.normalBuckets + feeEstimate.lowBuckets | ||
|
||
let fees = buckets.prefix(3).reversed().map { bucket in |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А это точно правильно? Это вообще для Schnorr - это для другой кривой по идее
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А это не из-за неправильной кривой такой фикс? Тестнет то работает?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У шнора как раз адрес короче на первый байт
Сделано через релизную ветку здесь #843 |
IOS-7805
Соответствующий PR в приложение