Skip to content

Commit

Permalink
build(deps): bump insta from 1.15.0 to 1.17.1 (#4884)
Browse files Browse the repository at this point in the history
* build(deps): bump insta from 1.15.0 to 1.17.1

Bumps [insta](https://github.com/mitsuhiko/insta) from 1.15.0 to 1.17.1.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](mitsuhiko/insta@1.15.0...1.17.1)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* make zebra_test::init() return the insta drop guard

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 4, 2022
1 parent f804ff6 commit 6fd750e
Show file tree
Hide file tree
Showing 112 changed files with 611 additions and 602 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tower-batch/tests/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where
#[tokio::test(flavor = "multi_thread")]
async fn batch_flushes_on_max_items() -> Result<(), Report> {
use tokio::time::timeout;
zebra_test::init();
let _init_guard = zebra_test::init();

// Use a very long max_latency and a short timeout to check that
// flushing is happening based on hitting max_items.
Expand All @@ -73,7 +73,7 @@ async fn batch_flushes_on_max_items() -> Result<(), Report> {
#[tokio::test(flavor = "multi_thread")]
async fn batch_flushes_on_max_latency() -> Result<(), Report> {
use tokio::time::timeout;
zebra_test::init();
let _init_guard = zebra_test::init();

// Use a very high max_items and a short timeout to check that
// flushing is happening based on hitting max_latency.
Expand All @@ -95,7 +95,7 @@ async fn batch_flushes_on_max_latency() -> Result<(), Report> {

#[tokio::test(flavor = "multi_thread")]
async fn fallback_verification() -> Result<(), Report> {
zebra_test::init();
let _init_guard = zebra_test::init();

// Create our own verifier, so we don't shut down a shared verifier used by other tests.
let verifier = Fallback::new(
Expand Down
4 changes: 2 additions & 2 deletions tower-batch/tests/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tower_test::mock;

#[tokio::test]
async fn wakes_pending_waiters_on_close() {
zebra_test::init();
let _init_guard = zebra_test::init();

let (service, mut handle) = mock::pair::<_, ()>();

Expand Down Expand Up @@ -68,7 +68,7 @@ async fn wakes_pending_waiters_on_close() {

#[tokio::test]
async fn wakes_pending_waiters_on_failure() {
zebra_test::init();
let _init_guard = zebra_test::init();

let (service, mut handle) = mock::pair::<_, ()>();

Expand Down
2 changes: 1 addition & 1 deletion tower-fallback/tests/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use tower_fallback::Fallback;

#[tokio::test]
async fn fallback() {
zebra_test::init();
let _init_guard = zebra_test::init();

// we'd like to use Transcript here but it can't handle errors :(

Expand Down
4 changes: 2 additions & 2 deletions zebra-chain/src/amount/tests/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::amount::*;
proptest! {
#[test]
fn amount_serialization(amount in any::<Amount<NegativeAllowed>>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

let bytes = amount.to_bytes();
let serialized_amount = Amount::<NegativeAllowed>::from_bytes(bytes)?;
Expand All @@ -17,7 +17,7 @@ proptest! {

#[test]
fn amount_deserialization(bytes in any::<[u8; 8]>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

if let Ok(deserialized) = Amount::<NegativeAllowed>::from_bytes(bytes) {
let bytes2 = deserialized.to_bytes();
Expand Down
28 changes: 14 additions & 14 deletions zebra-chain/src/amount/tests/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use color_eyre::eyre::Result;

#[test]
fn test_add_bare() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let neg_one: Amount = (-1).try_into()?;
Expand All @@ -25,7 +25,7 @@ fn test_add_bare() -> Result<()> {

#[test]
fn test_add_opt_lhs() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let one = Ok(one);
Expand All @@ -41,7 +41,7 @@ fn test_add_opt_lhs() -> Result<()> {

#[test]
fn test_add_opt_rhs() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let neg_one: Amount = (-1).try_into()?;
Expand All @@ -57,7 +57,7 @@ fn test_add_opt_rhs() -> Result<()> {

#[test]
fn test_add_opt_both() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let one = Ok(one);
Expand All @@ -74,7 +74,7 @@ fn test_add_opt_both() -> Result<()> {

#[test]
fn test_add_assign() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let neg_one: Amount = (-1).try_into()?;
Expand All @@ -91,7 +91,7 @@ fn test_add_assign() -> Result<()> {

#[test]
fn test_sub_bare() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let zero: Amount = Amount::zero();
Expand All @@ -106,7 +106,7 @@ fn test_sub_bare() -> Result<()> {

#[test]
fn test_sub_opt_lhs() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let one = Ok(one);
Expand All @@ -122,7 +122,7 @@ fn test_sub_opt_lhs() -> Result<()> {

#[test]
fn test_sub_opt_rhs() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let zero: Amount = Amount::zero();
Expand All @@ -138,7 +138,7 @@ fn test_sub_opt_rhs() -> Result<()> {

#[test]
fn test_sub_assign() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let zero: Amount = Amount::zero();
Expand All @@ -155,7 +155,7 @@ fn test_sub_assign() -> Result<()> {

#[test]
fn add_with_diff_constraints() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one = Amount::<NonNegative>::try_from(1)?;
let zero: Amount<NegativeAllowed> = Amount::zero();
Expand All @@ -170,7 +170,7 @@ fn add_with_diff_constraints() -> Result<()> {
// The borrows are actually needed to call the correct trait impl
#[allow(clippy::needless_borrow)]
fn deserialize_checks_bounds() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let big = (MAX_MONEY * 2)
.try_into()
Expand Down Expand Up @@ -205,7 +205,7 @@ fn deserialize_checks_bounds() -> Result<()> {

#[test]
fn hash() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one = Amount::<NonNegative>::try_from(1)?;
let another_one = Amount::<NonNegative>::try_from(1)?;
Expand Down Expand Up @@ -233,7 +233,7 @@ fn hash() -> Result<()> {

#[test]
fn ordering_constraints() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

ordering::<NonNegative, NonNegative>()?;
ordering::<NonNegative, NegativeAllowed>()?;
Expand Down Expand Up @@ -281,7 +281,7 @@ where

#[test]
fn test_sum() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let one: Amount = 1.try_into()?;
let neg_one: Amount = (-1).try_into()?;
Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/src/block/height.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl ZcashDeserialize for Height {

#[test]
fn operator_tests() {
zebra_test::init();
let _init_guard = zebra_test::init();

// Elementary checks.
assert_eq!(Some(Height(2)), Height(1) + Height(1));
Expand Down
20 changes: 10 additions & 10 deletions zebra-chain/src/block/tests/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DEFAULT_BLOCK_ROUNDTRIP_PROPTEST_CASES: u32 = 16;
proptest! {
#[test]
fn block_hash_roundtrip(hash in any::<Hash>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

let bytes = hash.zcash_serialize_to_vec()?;
let other_hash: Hash = bytes.zcash_deserialize_into()?;
Expand All @@ -38,7 +38,7 @@ proptest! {

#[test]
fn block_hash_display_fromstr_roundtrip(hash in any::<Hash>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

let display = format!("{}", hash);
let parsed = display.parse::<Hash>().expect("hash should parse");
Expand All @@ -47,7 +47,7 @@ proptest! {

#[test]
fn block_hash_hex_roundtrip(hash in any::<Hash>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

let hex_hash: String = hash.encode_hex();
let new_hash = Hash::from_hex(hex_hash).expect("hex hash should parse");
Expand All @@ -56,7 +56,7 @@ proptest! {

#[test]
fn blockheader_roundtrip(header in any::<Header>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

let bytes = header.zcash_serialize_to_vec()?;
let other_header = bytes.zcash_deserialize_into()?;
Expand All @@ -75,7 +75,7 @@ proptest! {
network in any::<Network>(),
block_height in any::<Height>()
) {
zebra_test::init();
let _init_guard = zebra_test::init();

// just skip the test if the bytes don't parse, because there's nothing
// to compare with
Expand All @@ -97,7 +97,7 @@ proptest! {

#[test]
fn block_roundtrip(block in any::<Block>(), network in any::<Network>()) {
zebra_test::init();
let _init_guard = zebra_test::init();

let bytes = block.zcash_serialize_to_vec()?;

Expand Down Expand Up @@ -141,7 +141,7 @@ proptest! {
/// coinbase transactions.
#[test]
fn blocks_have_coinbase() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let strategy =
LedgerState::coinbase_strategy(None, None, false).prop_flat_map(Block::arbitrary_with);
Expand All @@ -158,7 +158,7 @@ fn blocks_have_coinbase() -> Result<()> {
/// height and previous block hash.
#[test]
fn block_genesis_strategy() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let strategy =
LedgerState::genesis_strategy(None, None, false).prop_flat_map(Block::arbitrary_with);
Expand All @@ -177,7 +177,7 @@ fn block_genesis_strategy() -> Result<()> {
/// - no transparent spends in the genesis block, because genesis transparent outputs are ignored
#[test]
fn genesis_partial_chain_strategy() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let strategy = LedgerState::genesis_strategy(None, None, false).prop_flat_map(|init| {
Block::partial_chain_strategy(
Expand Down Expand Up @@ -225,7 +225,7 @@ fn genesis_partial_chain_strategy() -> Result<()> {
/// - correct previous block hashes
#[test]
fn arbitrary_height_partial_chain_strategy() -> Result<()> {
zebra_test::init();
let _init_guard = zebra_test::init();

let strategy = any::<Height>()
.prop_flat_map(|height| LedgerState::height_strategy(height, None, None, false))
Expand Down
Loading

0 comments on commit 6fd750e

Please sign in to comment.