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
1 change: 1 addition & 0 deletions .ci/build-contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ docker run --rm --tty \
-v "$ARTIFACTS":/code/artifacts \
-v "$REGISTRY_CACHE":/usr/local/cargo/registry \
-v "$CARGO_GIT_CACHE":/usr/local/cargo/git \
-e "RUSTUP_TOOLCHAIN=1.86.0" \
docker.io/cosmwasm/optimizer:0.17.0

# Our own custom build if different rust version is required
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
tool: just@1.40.0,nextest@0.9.99,sqlx-cli
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.86.0
toolchain: 1.93.1
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
Expand Down
16 changes: 0 additions & 16 deletions packages/examples/kademlia-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,6 @@ impl KolmeApp for KademliaTestApp {
}
}

#[derive(PartialEq, serde::Serialize, serde::Deserialize)]
struct RandomU32;

impl<App> KolmeDataRequest<App> for RandomU32 {
type Response = u32;

async fn load(self, _: &App) -> Result<Self::Response> {
Ok(rand::random())
}

async fn validate(self, _: &App, _: &Self::Response) -> Result<()> {
// No validation possible
Ok(())
}
}

pub async fn observer_node(validator_addr: &str, api_server_port: u16) -> Result<()> {
let kolme = Kolme::new(
KademliaTestApp::new(my_listener_key().clone(), my_approver_key().clone()),
Expand Down
5 changes: 2 additions & 3 deletions packages/kolme-store/src/fjall/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ fn render_children(children: &[Sha256Hash]) -> Vec<u8> {
}

fn parse_children(children: &[u8]) -> Result<SmallVec<[Sha256Hash; 16]>, MerkleSerialError> {
if children.len() % 32 != 0 {
return Err(MerkleSerialError::custom(std::io::Error::new(
std::io::ErrorKind::Other,
if !children.len().is_multiple_of(32) {
return Err(MerkleSerialError::custom(std::io::Error::other(
"Children in fjall store not a multiple of 32 bytes",
)));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kolme-test/src/multiple_processors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async fn client(
guard.insert(txhash);
let count = guard.len();
std::mem::drop(guard);
if count % 50 == 0 {
if count.is_multiple_of(50) {
println!("In client, total transactions logged: {count}");
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/merkle-map/src/impls/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'a, K, V> IntoIterator for &'a Node<K, V> {
}

impl<K, V> Node<K, V> {
pub(crate) fn iter(&self) -> Iter<K, V> {
pub(crate) fn iter(&self) -> Iter<'_, K, V> {
self.into_iter()
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/merkle-map/src/impls/merkle_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where
}

impl<K, V> MerkleMap<K, V> {
pub fn iter(&self) -> crate::impls::iter::Iter<K, V> {
pub fn iter(&self) -> crate::impls::iter::Iter<'_, K, V> {
self.sanity_checks();
self.into_iter()
}
Expand All @@ -143,7 +143,7 @@ impl<K, V> MerkleMap<K, V> {
}

impl<K: ToMerkleKey, V> MerkleMap<K, V> {
pub fn range<T, R>(&self, range: R) -> impls::iter::Iter<K, V>
pub fn range<T, R>(&self, range: R) -> impls::iter::Iter<'_, K, V>
where
T: ToMerkleKey + ?Sized,
K: Borrow<T>,
Expand Down
2 changes: 1 addition & 1 deletion packages/merkle-map/src/impls/tree_contents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<K: Clone, V: Clone> TreeContents<K, V> {
pub(crate) fn insert(&mut self, depth: u16, entry: LeafEntry<K, V>) -> Option<(K, V)> {
let Some(index) = entry.key_bytes.get_index_for_depth(depth) else {
debug_assert!(depth == 0 || entry.key_bytes.get_index_for_depth(depth - 1).is_some());
let v = std::mem::replace(&mut self.leaf, Some(entry));
let v = self.leaf.replace(entry);
if v.is_none() {
self.len += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/merkle-map/src/types/key_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl MerkleKey {
// First get the byte in question...
let byte = *self.0.get(usize::from(depth / 2))?;
// Then get either the high or low bits, depending on whether our depth is even or odd
Some(if depth % 2 == 0 {
Some(if depth.is_multiple_of(2) {
byte >> 4
} else {
byte & 0x0F
Expand Down
12 changes: 6 additions & 6 deletions packages/shared/src/cryptography/real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ impl borsh::ser::BorshSerialize for PublicKey {
impl borsh::de::BorshDeserialize for PublicKey {
#[inline]
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> borsh::io::Result<Self> {
use borsh::io::{Error, ErrorKind};
use borsh::io::Error;

// We are forced to use the internal API because using the [T; N] array impl returns
// a "Not all bytes read" error even though the binary representation is correct...
let bytes: [u8; 33] = u8::array_from_reader(reader)?.unwrap(); // This always returns Some
match Self::from_bytes(bytes) {
Ok(sig) => Ok(sig),
Err(e) => Err(Error::new(ErrorKind::Other, e)),
Err(e) => Err(Error::other(e)),
}
}
}
Expand Down Expand Up @@ -310,14 +310,14 @@ impl borsh::ser::BorshSerialize for Signature {
impl borsh::de::BorshDeserialize for Signature {
#[inline]
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> borsh::io::Result<Self> {
use borsh::io::{Error, ErrorKind};
use borsh::io::Error;

// We are forced to use the internal API because using the [T; N] array impl returns
// a "Not all bytes read" error even though the binary representation is correct...
let bytes: [u8; 64] = u8::array_from_reader(reader)?.unwrap(); // This always returns Some
match Self::from_slice(&bytes) {
Ok(sig) => Ok(sig),
Err(e) => Err(Error::new(ErrorKind::Other, e)),
Err(e) => Err(Error::other(e)),
}
}
}
Expand Down Expand Up @@ -394,13 +394,13 @@ impl borsh::ser::BorshSerialize for RecoveryId {
impl borsh::de::BorshDeserialize for RecoveryId {
#[inline]
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> borsh::io::Result<Self> {
use borsh::io::{Error, ErrorKind};
use borsh::io::Error;

let byte = u8::deserialize_reader(reader)?;

match Self::from_byte(byte) {
Ok(id) => Ok(id),
Err(e) => Err(Error::new(ErrorKind::Other, e)),
Err(e) => Err(Error::other(e)),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ mod cw_impls {
type Suffix = Self;
type SuperSuffix = Self;

fn key(&self) -> Vec<cw_storage_plus::Key> {
fn key(&self) -> Vec<cw_storage_plus::Key<'_>> {
self.0.key()
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.86.0"
channel = "1.93.1"