diff --git a/stylus-sdk/src/abi/bytes.rs b/stylus-sdk/src/abi/bytes.rs index 8fdf3f2..09b99ec 100644 --- a/stylus-sdk/src/abi/bytes.rs +++ b/stylus-sdk/src/abi/bytes.rs @@ -144,7 +144,9 @@ mod tests { fn bytes_abi() { assert_eq!(Bytes::SOL_NAME, "bytes"); assert_eq!(Bytes::ENCODED_SIZE, None); - assert!(Bytes::DYNAMIC); + if !Bytes::DYNAMIC { + panic!(); + } assert_eq!( ::abi_encoded_size(&Bytes(vec![1, 2, 3, 4])), 64 diff --git a/stylus-sdk/src/storage/bytes.rs b/stylus-sdk/src/storage/bytes.rs index d341bc6..7ac7fa4 100644 --- a/stylus-sdk/src/storage/bytes.rs +++ b/stylus-sdk/src/storage/bytes.rs @@ -626,7 +626,7 @@ mod tests { storage.set_len(4); } - let mut want = value.clone(); + let mut want = value; want[31] = 4 * 2; assert_eq!(test_vm.get_storage(U256::ZERO), want); } @@ -1000,7 +1000,7 @@ mod tests { fn test_storage_bytes_base() { let test_vm = TestVM::new(); let storage = StorageBytes::from(&test_vm); - let want: U256 = crypto::keccak(&[0; 32]).into(); + let want: U256 = crypto::keccak([0; 32]).into(); assert_eq!(*storage.base(), want); } diff --git a/stylus-sdk/src/storage/vec.rs b/stylus-sdk/src/storage/vec.rs index 7ad0f43..1457f0f 100644 --- a/stylus-sdk/src/storage/vec.rs +++ b/stylus-sdk/src/storage/vec.rs @@ -308,8 +308,8 @@ mod test { vec.push(true); vec.push(false); vec.push(true); - assert_eq!(true, vec.get(0).unwrap()); - assert_eq!(false, vec.get(1).unwrap()); - assert_eq!(true, vec.get(2).unwrap()); + assert!(vec.get(0).unwrap()); + assert!(!vec.get(1).unwrap()); + assert!(vec.get(2).unwrap()); } }