-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/payout
- Loading branch information
Showing
15 changed files
with
125 additions
and
56 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
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
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
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,17 @@ | ||
use proc_macro2::Ident; | ||
use quote::quote; | ||
use syn::Generics; | ||
|
||
/// Generates a view method to retrieve the source metadata. | ||
pub(crate) fn generate_contract_metadata_method( | ||
ident: &Ident, | ||
generics: &Generics, | ||
) -> proc_macro2::TokenStream { | ||
quote! { | ||
impl #generics #ident #generics { | ||
pub fn contract_source_metadata() { | ||
near_sdk::env::value_return(CONTRACT_SOURCE_METADATA.as_bytes()) | ||
} | ||
} | ||
} | ||
} |
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,15 +1,12 @@ | ||
mod attr_sig_info; | ||
pub use attr_sig_info::*; | ||
|
||
mod impl_item_method_info; | ||
pub use impl_item_method_info::*; | ||
|
||
mod item_trait_info; | ||
pub use item_trait_info::*; | ||
|
||
mod item_impl_info; | ||
pub use item_impl_info::*; | ||
|
||
pub(crate) mod ext; | ||
pub(crate) mod metadata; | ||
|
||
pub(crate) mod serializer; |
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
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,20 @@ | ||
use near_account_id::AccountIdRef; | ||
use near_sdk::near_bindgen; | ||
|
||
#[near_bindgen] | ||
struct Contract {} | ||
|
||
#[near_bindgen] | ||
impl Contract { | ||
pub fn anything() {} | ||
} | ||
|
||
#[near_bindgen] | ||
impl Contract { | ||
pub fn anything_else() {} | ||
} | ||
|
||
fn main() { | ||
let ext = Contract::ext(AccountIdRef::new_or_panic("0000").into()); | ||
ext.contract_source_metadata(); | ||
} |
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,5 +1,11 @@ | ||
error: Impl type parameters are not supported for smart contracts. | ||
--> $DIR/impl_generic.rs:15:6 | ||
--> compilation_tests/impl_generic.rs:10:20 | ||
| | ||
15 | impl<'a, T: 'a + std::fmt::Display> Incrementer<T> { | ||
10 | struct Incrementer<T> { | ||
| ^ | ||
|
||
error: Impl type parameters are not supported for smart contracts. | ||
--> compilation_tests/impl_generic.rs:16:6 | ||
| | ||
16 | impl<'a, T: 'a + std::fmt::Display> Incrementer<T> { | ||
| ^^ |
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