-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiles using ExternRef and ExternMut stubs
- Loading branch information
Showing
3 changed files
with
78 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod balance; | ||
mod expiration; | ||
mod handlers; | ||
mod new_std; | ||
mod pagination; | ||
|
||
pub use crate::balance::NativeBalance; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use cosmwasm_std::{Api, Querier, Storage}; | ||
|
||
///! some features that should be in cosmwasm_std v0.12 mocked out here for ease | ||
pub struct ExternMut<'a, S: Storage, A: Api, Q: Querier> { | ||
pub storage: &'a mut S, | ||
pub api: &'a A, | ||
pub querier: &'a Q, | ||
} | ||
|
||
pub struct ExternRef<'a, S: Storage, A: Api, Q: Querier> { | ||
pub storage: &'a S, | ||
pub api: &'a A, | ||
pub querier: &'a Q, | ||
} | ||
|
||
impl<'a, S: Storage, A: Api, Q: Querier> ExternMut<'a, S, A, Q> { | ||
pub fn as_ref(self) -> ExternRef<'a, S, A, Q> { | ||
ExternRef { | ||
storage: self.storage, | ||
api: self.api, | ||
querier: self.querier, | ||
} | ||
} | ||
} | ||
|
||
// pub struct Extern<S: Storage, A: Api, Q: Querier> { | ||
// pub storage: S, | ||
// pub api: A, | ||
// pub querier: Q, | ||
// } | ||
// | ||
// impl<S: Storage, A: Api, Q: Querier> Extern<S, A, Q> { | ||
// pub fn as_ref(&'_ self) -> ExternRef<'_, S, A, Q> { | ||
// ExternRef { | ||
// storage: &self.storage, | ||
// api: &self.api, | ||
// querier: &self.querier, | ||
// } | ||
// } | ||
// | ||
// pub fn as_mut(&'_ mut self) -> ExternMut<'_, S, A, Q> { | ||
// ExternMut { | ||
// storage: &mut self.storage, | ||
// api: &self.api, | ||
// querier: &self.querier, | ||
// } | ||
// } | ||
// } |