diff --git a/moksha-core/src/amount.rs b/moksha-core/src/amount.rs index 85dd14e0..e178a29f 100644 --- a/moksha-core/src/amount.rs +++ b/moksha-core/src/amount.rs @@ -103,6 +103,6 @@ mod tests { let amounts = vec![1, 2, 3, 4, 5, 6, 7]; let secrets = SplitAmount::from(amounts.clone()).create_secrets(); assert!(secrets.len() == amounts.len()); - assert_eq!(secrets.get(0).unwrap().len(), 24); + assert_eq!(secrets.first().unwrap().len(), 24); } } diff --git a/moksha-core/src/blind.rs b/moksha-core/src/blind.rs index 986d5595..af193e34 100644 --- a/moksha-core/src/blind.rs +++ b/moksha-core/src/blind.rs @@ -96,7 +96,7 @@ mod tests { assert!(result.is_ok()); let result = result.unwrap(); assert!(result.clone().len() == 10); - assert!(result.get(0).unwrap().0.amount == 1); + assert!(result.first().unwrap().0.amount == 1); } #[test] diff --git a/moksha-mint/src/server.rs b/moksha-mint/src/server.rs index 98b37c70..129e1075 100644 --- a/moksha-mint/src/server.rs +++ b/moksha-mint/src/server.rs @@ -1175,9 +1175,9 @@ mod tests { assert_eq!(1, keys.keysets.len()); assert_eq!( 64, - keys.keysets.get(0).expect("keyset not found").keys.len() + keys.keysets.first().expect("keyset not found").keys.len() ); - println!("{:#?}", keys.keysets.get(0).unwrap().id); + println!("{:#?}", keys.keysets.first().unwrap().id); Ok(()) } @@ -1213,11 +1213,11 @@ mod tests { assert_eq!(1, keys.keysets.len()); assert_eq!( 64, - keys.keysets.get(0).expect("keyset not found").keys.len() + keys.keysets.first().expect("keyset not found").keys.len() ); assert_eq!( "00f545318e4fad2b", - keys.keysets.get(0).expect("keyset not found").id + keys.keysets.first().expect("keyset not found").id ); Ok(()) } @@ -1233,7 +1233,7 @@ mod tests { let body = response.into_body().collect().await.unwrap().to_bytes(); let keys: V1Keysets = serde_json::from_slice(&body)?; assert_eq!(1, keys.keysets.len()); - let keyset = keys.keysets.get(0).expect("keyset not found"); + let keyset = keys.keysets.first().expect("keyset not found"); assert!(keyset.active); assert_eq!(CurrencyUnit::Sat, keyset.unit); assert_eq!("00f545318e4fad2b", keyset.id); diff --git a/moksha-wallet/src/localstore/sqlite.rs b/moksha-wallet/src/localstore/sqlite.rs index 070e20ad..ba8768b8 100644 --- a/moksha-wallet/src/localstore/sqlite.rs +++ b/moksha-wallet/src/localstore/sqlite.rs @@ -182,11 +182,11 @@ mod tests { let proofs = tokens .tokens - .get(0) + .first() .expect("Tokens is empty") .proofs .proofs(); - let proof_4 = proofs.get(0).expect("Proof is empty").to_owned(); + let proof_4 = proofs.first().expect("Proof is empty").to_owned(); print!("first {:?}", proof_4); localstore.delete_proofs(&proof_4.into()).await?;