Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ workflows:
matrix:
parameters:
# Run with MSRV and some modern stable Rust
rust-version: ["1.73.0", "1.76.0"]
rust-version: ["1.73.0", "1.77.0"]
- benchmarking:
requires:
- package_vm
Expand Down
5 changes: 3 additions & 2 deletions contracts/staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,14 @@ pub fn _bond_all_tokens(

// we deduct pending claims from our account balance before reinvesting.
// if there is not enough funds, we just return a no-op
match update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| {
let updated = update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| {
balance.amount = balance.amount.checked_sub(supply.claims)?;
// this just triggers the "no op" case if we don't have min_withdrawal left to reinvest
balance.amount.checked_sub(invest.min_withdrawal)?;
supply.bonded += balance.amount;
Ok(supply)
}) {
});
match updated {
Ok(_) => {}
// if it is below the minimum, we do a no-op (do not revert other state from withdrawal)
Err(StdError::Overflow { .. }) => return Ok(Response::default()),
Expand Down
1 change: 1 addition & 0 deletions packages/std/src/testing/assertions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ mod tests {
)]
fn assert_approx_with_custom_panic_msg() {
let adjective = "extra";
#[allow(dead_code)]
#[derive(Debug)]
struct Foo(u32);
assert_approx_eq!(
Expand Down
1 change: 1 addition & 0 deletions packages/vm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ fn save_wasm_to_disk(dir: impl Into<PathBuf>, wasm: &[u8]) -> VmResult<Checksum>
let mut file = OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.open(filepath)
.map_err(|e| VmError::cache_err(format!("Error opening Wasm file for writing: {e}")))?;
file.write_all(wasm)
Expand Down
5 changes: 4 additions & 1 deletion packages/vm/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ mod tests {
assert_eq!(to_u32(2147483647usize).unwrap(), 2147483647);
assert_eq!(to_u32(2147483648usize).unwrap(), 2147483648);
assert_eq!(to_u32(4294967295usize).unwrap(), 4294967295);

// Gate required for Rust 1.77.0 in Linux, possibly a Rust/clippy regression bug
#[cfg(target_pointer_width = "64")]
match to_u32(4294967296usize) {
Err(VmError::ConversionErr {
from_type,
Expand Down Expand Up @@ -130,6 +131,8 @@ mod tests {
assert_eq!(ref_to_u32(&2147483647usize).unwrap(), 2147483647);
assert_eq!(ref_to_u32(&2147483648usize).unwrap(), 2147483648);
assert_eq!(ref_to_u32(&4294967295usize).unwrap(), 4294967295);
// Gate required for Rust 1.77.0 in Linux, possibly a Rust/clippy regression bug
#[cfg(target_pointer_width = "64")]
match ref_to_u32(&4294967296usize).unwrap_err() {
VmError::ConversionErr {
from_type,
Expand Down