Skip to content

Commit

Permalink
Merge pull request #104 from OffchainLabs/export-infallible-methods
Browse files Browse the repository at this point in the history
Export infallible methods
  • Loading branch information
rachel-bousfield authored Feb 16, 2024
2 parents db5052f + 7524fb7 commit 4c479c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Please provide a summary of the changes and any backward incompatibilities.
- [ ] I have read the [DCO][DCO] and ensured that these changes comply.
- [ ] I assign this work under its [open source licensing][terms].

[DCO]: licenses/DCO.txt
[terms]: licenses/COPYRIGHT.md
[DCO]: https://github.com/OffchainLabs/stylus-sdk-rs/blob/stylus/licenses/DCO.txt
[terms]: https://github.com/OffchainLabs/stylus-sdk-rs/blob/stylus/licenses/COPYRIGHT.md
2 changes: 1 addition & 1 deletion stylus-proc/src/methods/external.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023, Offchain Labs, Inc.
// Copyright 2022-2024, Offchain Labs, Inc.
// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/stylus/licenses/COPYRIGHT.md

use crate::types::{self, Purity};
Expand Down
8 changes: 5 additions & 3 deletions stylus-sdk/src/abi/internal.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023, Offchain Labs, Inc.
// Copyright 2023-2024, Offchain Labs, Inc.
// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/stylus/licenses/COPYRIGHT.md

//! This module provides functions for code generated by `stylus-sdk-proc`.
Expand Down Expand Up @@ -58,12 +58,14 @@ pub fn failed_to_decode_arguments(err: alloy_sol_types::Error) {

pub trait AbiResult {
type OkType;
type ErrType;
}

impl<O, E> AbiResult for Result<O, E> {
type OkType = O;
type ErrType = E;
}

impl<T: AbiType> AbiResult for T {
type OkType = T;
}

pub fn write_solidity_returns<T: AbiResult>(f: &mut fmt::Formatter) -> fmt::Result
Expand Down
2 changes: 1 addition & 1 deletion stylus-sdk/src/storage/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl StorageKey for String {

impl StorageKey for Address {
fn to_slot(&self, root: B256) -> U256 {
let int: U160 = self.0.try_into().unwrap();
let int: U160 = self.0.into();
int.to_slot(root)
}
}
Expand Down

0 comments on commit 4c479c2

Please sign in to comment.