Skip to content

Commit

Permalink
Use transaction version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Dec 17, 2023
1 parent 0434ff3 commit a101389
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/runestone_decipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fuzz_target!(|input: Vec<Vec<u8>>| {
script_pubkey: builder.into_script(),
value: 0,
}],
version: 0,
version: 1,
};

Runestone::from_transaction(&tx);
Expand Down
2 changes: 1 addition & 1 deletion src/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ mod tests {

fn parse(witnesses: &[Witness]) -> Vec<ParsedEnvelope> {
ParsedEnvelope::from_transaction(&Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input: witnesses
.iter()
Expand Down
32 changes: 16 additions & 16 deletions src/runes/runestone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
})
.unwrap()
.unwrap()
Expand All @@ -273,7 +273,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
None
);
Expand All @@ -286,7 +286,7 @@ mod tests {
input: Vec::new(),
output: Vec::new(),
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(None)
);
Expand All @@ -302,7 +302,7 @@ mod tests {
value: 0
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(None)
);
Expand All @@ -320,7 +320,7 @@ mod tests {
value: 0
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(None)
);
Expand All @@ -339,7 +339,7 @@ mod tests {
value: 0
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(None)
);
Expand All @@ -354,7 +354,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
})
.unwrap_err();
}
Expand All @@ -376,7 +376,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
})
.unwrap_err();
}
Expand All @@ -394,7 +394,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
})
.unwrap();
}
Expand All @@ -415,7 +415,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
})
.unwrap()
.unwrap(),
Expand Down Expand Up @@ -443,7 +443,7 @@ mod tests {
value: 0
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(Some(Runestone::default()))
);
Expand Down Expand Up @@ -478,7 +478,7 @@ mod tests {
},
],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
})
.unwrap_err();
}
Expand Down Expand Up @@ -986,7 +986,7 @@ mod tests {
value: 0
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(Some(Runestone {
edicts: vec![Edict {
Expand Down Expand Up @@ -1027,7 +1027,7 @@ mod tests {
}
],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(Some(Runestone {
edicts: vec![Edict {
Expand Down Expand Up @@ -1067,7 +1067,7 @@ mod tests {
}
],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
}),
Ok(Some(Runestone {
edicts: vec![Edict {
Expand Down Expand Up @@ -1372,7 +1372,7 @@ mod tests {
value: 0,
}],
lock_time: LockTime::ZERO,
version: 0,
version: 1,
};

let payload = Runestone::payload(&transaction).unwrap().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/templates/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mod tests {
#[test]
fn html() {
let transaction = Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input: vec![TxIn {
sequence: Default::default(),
Expand Down Expand Up @@ -105,7 +105,7 @@ mod tests {
#[test]
fn with_blockhash() {
let transaction = Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input: Vec::new(),
output: vec![
Expand Down
4 changes: 2 additions & 2 deletions test-bitcoincore-rpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl Api for Server {
assert_eq!(replaceable, None, "replaceable param not supported");

let tx = Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input: utxos
.iter()
Expand Down Expand Up @@ -492,7 +492,7 @@ impl Api for Server {
hash: Wtxid::all_zeros(),
size: 0,
vsize: 0,
version: 0,
version: 1,
locktime: 0,
vin: Vec::new(),
vout: Vec::new(),
Expand Down
4 changes: 2 additions & 2 deletions test-bitcoincore-rpc/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl State {

pub(crate) fn push_block(&mut self, subsidy: u64) -> Block {
let coinbase = Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input: vec![TxIn {
previous_output: OutPoint::null(),
Expand Down Expand Up @@ -160,7 +160,7 @@ impl State {
}

let mut tx = Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input,
output: (0..template.outputs)
Expand Down
2 changes: 1 addition & 1 deletion tests/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn transaction() -> Vec<u8> {
witness.push([]);

let transaction = Transaction {
version: 0,
version: 1,
lock_time: LockTime::ZERO,
input: vec![TxIn {
previous_output: OutPoint::null(),
Expand Down

0 comments on commit a101389

Please sign in to comment.