Rename script_code to script_pubkey in zip244 test vectors.

This commit is contained in:
Kris Nuttycombe 2022-01-12 18:24:27 -07:00
parent fc82801d3d
commit 7b2f9e27ae
2 changed files with 19 additions and 15 deletions

View File

@ -216,7 +216,11 @@ fn zip_0244() {
.iter()
.map(|amount| Amount::from_nonnegative_i64(*amount).unwrap())
.collect();
let input_scriptpubkeys = tv.script_codes.iter().map(|s| Script(s.clone())).collect();
let input_scriptpubkeys = tv
.script_pubkeys
.iter()
.map(|s| Script(s.clone()))
.collect();
let test_bundle = txdata
.transparent_bundle
@ -264,12 +268,12 @@ fn zip_0244() {
if let Some(index) = tv.transparent_input {
let bundle = txdata.transparent_bundle().unwrap();
let value = bundle.authorization.input_amounts[index];
let script_code = &bundle.authorization.input_scriptpubkeys[index];
let script_pubkey = &bundle.authorization.input_scriptpubkeys[index];
let signable_input = |hash_type| SignableInput::Transparent {
hash_type,
index,
script_code,
script_pubkey: script_code,
script_code: script_pubkey,
script_pubkey,
value,
};

View File

@ -5691,7 +5691,7 @@ pub mod zip_0244 {
pub txid: [u8; 32],
pub auth_digest: [u8; 32],
pub amounts: Vec<i64>,
pub script_codes: Vec<Vec<u8>>,
pub script_pubkeys: Vec<Vec<u8>>,
pub transparent_input: Option<usize>,
pub sighash_shielded: [u8; 32],
pub sighash_all: Option<[u8; 32]>,
@ -5987,7 +5987,7 @@ pub mod zip_0244 {
0x09, 0xc0, 0x86, 0x3c, 0xda, 0x6b,
],
amounts: vec![1800841178198868],
script_codes: vec![vec![0x65, 0x00, 0x51]],
script_pubkeys: vec![vec![0x65, 0x00, 0x51]],
transparent_input: Some(0),
sighash_shielded: [
0xab, 0xbd, 0x63, 0xf1, 0xea, 0x2c, 0x3a, 0x0e, 0x96, 0xc9, 0xde, 0x99, 0x63,
@ -6170,7 +6170,7 @@ pub mod zip_0244 {
0x68, 0x98, 0x84, 0x10, 0x4e, 0xb1,
],
amounts: vec![],
script_codes: vec![],
script_pubkeys: vec![],
transparent_input: None,
sighash_shielded: [
0xf2, 0x89, 0x61, 0x8d, 0x7f, 0x61, 0x53, 0x29, 0x3c, 0x4e, 0x24, 0xc2, 0x76,
@ -6200,7 +6200,7 @@ pub mod zip_0244 {
0x72, 0xf5, 0x70, 0x97, 0xb7, 0x38,
],
amounts: vec![],
script_codes: vec![],
script_pubkeys: vec![],
transparent_input: None,
sighash_shielded: [
0xa2, 0x2f, 0x92, 0xf0, 0x43, 0x79, 0x3d, 0x10, 0x9d, 0xb7, 0x43, 0x54, 0xc7,
@ -6231,7 +6231,7 @@ pub mod zip_0244 {
0x72, 0xf5, 0x70, 0x97, 0xb7, 0x38,
],
amounts: vec![],
script_codes: vec![],
script_pubkeys: vec![],
transparent_input: None,
sighash_shielded: [
0x6a, 0x58, 0x74, 0x54, 0xbd, 0x03, 0x12, 0x4b, 0x38, 0xe8, 0x0b, 0x46, 0xe4,
@ -6275,7 +6275,7 @@ pub mod zip_0244 {
0x35, 0x55, 0x40, 0xed, 0x45, 0xf7,
],
amounts: vec![1848924248978091, 447389782351145, 620151782842275],
script_codes: vec![vec![0xac, 0x00, 0x00], vec![0x65, 0x65], vec![]],
script_pubkeys: vec![vec![0xac, 0x00, 0x00], vec![0x65, 0x65], vec![]],
transparent_input: Some(0),
sighash_shielded: [
0xc4, 0xfc, 0x9e, 0x3c, 0x5d, 0x71, 0xfe, 0x25, 0x89, 0xb9, 0x4a, 0x47, 0xed,
@ -6339,7 +6339,7 @@ pub mod zip_0244 {
0x95, 0xb0, 0xe4, 0x05, 0x3b, 0x4b,
],
amounts: vec![1561051182746413, 1535468271734483],
script_codes: vec![
script_pubkeys: vec![
vec![0x65, 0x6a, 0x51, 0x6a, 0xac, 0x51, 0x6a, 0x65, 0x52],
vec![0x52],
],
@ -6767,7 +6767,7 @@ pub mod zip_0244 {
0xa6, 0xbf, 0x82, 0x20, 0xe0, 0x23,
],
amounts: vec![],
script_codes: vec![],
script_pubkeys: vec![],
transparent_input: None,
sighash_shielded: [
0xaa, 0x65, 0x33, 0xbf, 0xd6, 0xb0, 0xa2, 0xd7, 0x17, 0x27, 0x33, 0x36, 0x38,
@ -7027,7 +7027,7 @@ pub mod zip_0244 {
0xff, 0xdd, 0x3d, 0x5f, 0x3d, 0x91,
],
amounts: vec![787459282010655, 1685382316228727, 1715663111103469],
script_codes: vec![
script_pubkeys: vec![
vec![0x65, 0x6a],
vec![0x65, 0x00, 0x51, 0x52, 0x6a],
vec![0x52, 0x6a, 0x51, 0x53, 0x00, 0x51, 0x52, 0x51, 0x6a],
@ -7088,7 +7088,7 @@ pub mod zip_0244 {
0xcc, 0x8b, 0x4c, 0x91, 0xe2, 0x78,
],
amounts: vec![1076763594431866, 316847576141144, 1780844721475339],
script_codes: vec![
script_pubkeys: vec![
vec![0x00, 0x65, 0x51, 0xac, 0x65, 0x63, 0x00, 0x53],
vec![0x63, 0x52, 0x00, 0x53],
vec![0xac, 0xac, 0x00, 0x65, 0x6a, 0x63, 0x51],
@ -7374,7 +7374,7 @@ pub mod zip_0244 {
0xab, 0xec, 0xc1, 0x64, 0x19, 0x5c,
],
amounts: vec![1399781968202734, 1999413718097392],
script_codes: vec![
script_pubkeys: vec![
vec![0x00, 0x53, 0x00],
vec![0x53, 0x51, 0x52, 0x52, 0x65, 0x52, 0x00, 0x53, 0x63],
],