sdk: correct static keypair bytes in test sample transaction (#32930)

This commit is contained in:
Trent Nelson 2023-08-22 16:19:04 -06:00 committed by GitHub
parent 3b5e35e819
commit 14d0759af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 15 deletions

View File

@ -1264,10 +1264,10 @@ mod tests {
fn create_sample_transaction() -> Transaction {
let keypair = Keypair::from_bytes(&[
48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32, 255, 101, 36, 24, 124, 23,
167, 21, 132, 204, 155, 5, 185, 58, 121, 75, 124, 76, 154, 235, 9, 194, 237, 253, 194,
191, 157, 234, 156, 225, 50, 195, 2, 9, 247, 111, 43, 33, 218, 128, 149, 245, 216, 35,
86, 157, 94, 186,
255, 101, 36, 24, 124, 23, 167, 21, 132, 204, 155, 5, 185, 58, 121, 75, 156, 227, 116,
193, 215, 38, 142, 22, 8, 14, 229, 239, 119, 93, 5, 218, 36, 100, 158, 252, 33, 161,
97, 185, 62, 89, 99, 195, 250, 249, 187, 189, 171, 118, 241, 90, 248, 14, 68, 219, 231,
62, 157, 5, 142, 27, 210, 117,
])
.unwrap();
let to = Pubkey::from([
@ -1286,7 +1286,9 @@ mod tests {
let instruction =
Instruction::new_with_bincode(program_id, &(1u8, 2u8, 3u8), account_metas);
let message = Message::new(&[instruction], Some(&keypair.pubkey()));
Transaction::new(&[&keypair], message, Hash::default())
let tx = Transaction::new(&[&keypair], message, Hash::default());
tx.verify().expect("valid sample transaction signatures");
tx
}
#[test]
@ -1354,16 +1356,16 @@ mod tests {
assert_eq!(
serialize(&create_sample_transaction()).unwrap(),
vec![
1, 51, 31, 4, 198, 124, 166, 17, 196, 133, 226, 233, 135, 194, 189, 76, 152, 81,
42, 25, 196, 226, 163, 89, 189, 104, 151, 117, 71, 73, 70, 105, 83, 9, 27, 16, 141,
105, 150, 216, 41, 16, 37, 228, 71, 4, 39, 44, 168, 89, 182, 131, 41, 227, 47, 141,
12, 246, 100, 222, 208, 60, 105, 225, 2, 1, 0, 1, 3, 124, 76, 154, 235, 9, 194,
237, 253, 194, 191, 157, 234, 156, 225, 50, 195, 2, 9, 247, 111, 43, 33, 218, 128,
149, 245, 216, 35, 86, 157, 94, 186, 1, 1, 1, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 7, 6, 5, 4, 1, 1, 1, 2, 2, 2, 4, 5, 6, 7, 8, 9, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 8, 7, 6, 5, 4, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2,
0, 1, 3, 1, 2, 3
1, 120, 138, 162, 185, 59, 209, 241, 157, 71, 157, 74, 131, 4, 87, 54, 28, 38, 180,
222, 82, 64, 62, 61, 62, 22, 46, 17, 203, 187, 136, 62, 43, 11, 38, 235, 17, 239,
82, 240, 139, 130, 217, 227, 214, 9, 242, 141, 223, 94, 29, 184, 110, 62, 32, 87,
137, 63, 139, 100, 221, 20, 137, 4, 5, 1, 0, 1, 3, 36, 100, 158, 252, 33, 161, 97,
185, 62, 89, 99, 195, 250, 249, 187, 189, 171, 118, 241, 90, 248, 14, 68, 219, 231,
62, 157, 5, 142, 27, 210, 117, 1, 1, 1, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 8, 7, 6, 5, 4, 1, 1, 1, 2, 2, 2, 4, 5, 6, 7, 8, 9, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 8, 7, 6, 5, 4, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 1,
3, 1, 2, 3
]
);
}