mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 06:45:49 +00:00
Fix CI: sender/recipient hex fixtures in Solana transaction tests were 1 hex digit short
Both SolanaTransactionTest and RealSolanaTransactionServiceTest carried a transcription error from the earlier solders cross-validation: the sender/recipient pubkey hex strings (and one of expectedMessageHex's concatenated chunks) were each missing their trailing hex digit, producing odd-length hex that BouncyCastle's decoder throws on (StringIndexOutOfBoundsException) - all 5 SolanaTransactionTest cases failed at field-init time as a result. Re-derived every fixture programmatically from the same solders-verified reference message (rather than hand-splitting the hex string again) and confirmed the full round trip (build -> compare) matches byte-for-byte.
This commit is contained in:
@@ -14,15 +14,15 @@ class SolanaTransactionTest {
|
||||
* fixed vector, not a real network value). This test asserts our hand-rolled message builder produces the
|
||||
* exact same bytes solders did for the identical inputs.
|
||||
*/
|
||||
private val senderPublicKey = "8a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5".fromHex()
|
||||
private val recipientPublicKey = "c8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b3".fromHex()
|
||||
private val senderPublicKey = "8a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c".fromHex()
|
||||
private val recipientPublicKey = "8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b394".fromHex()
|
||||
private val recentBlockhash = ByteArray(32)
|
||||
private val lamports = 123456789L
|
||||
|
||||
private val expectedMessageHex = "010001038a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5" +
|
||||
"c8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b39400000000000000000000000000000000" +
|
||||
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +
|
||||
"1020200010c0200000015cd5b0700000000"
|
||||
private val expectedMessageHex = "010001038a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c813" +
|
||||
"9770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b39400000000000000" +
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000000000" +
|
||||
"00000000000000000000000000000000000000001020200010c0200000015cd5b0700000000"
|
||||
|
||||
@Test
|
||||
fun `buildTransferMessage should match the independently-built solders reference vector`() {
|
||||
|
||||
+2
-2
@@ -72,8 +72,8 @@ class RealSolanaTransactionServiceTest {
|
||||
|
||||
private lateinit var subject: RealSolanaTransactionService
|
||||
|
||||
private val senderPublicKey = "8a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5".fromHex()
|
||||
private val recipientPublicKey = "c8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b3".fromHex()
|
||||
private val senderPublicKey = "8a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c".fromHex()
|
||||
private val recipientPublicKey = "8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b394".fromHex()
|
||||
private val recipientAddress = Base58.encode(recipientPublicKey)
|
||||
private val recentBlockhash = ByteArray(32)
|
||||
private val lamports = 123456789L
|
||||
|
||||
Reference in New Issue
Block a user