Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Adds new execution strategy nativeElseWasm #1546

Merged
merged 35 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3011a63
fix: adds new execution strategy nativeElseWasm and replace nativeWhe…
seerscode Jan 24, 2019
ea55550
feat: adds cmd line params for execution strategies
seerscode Jan 25, 2019
926a4fa
fix: uses of cmd line execution strategies
seerscode Jan 26, 2019
cf11123
chore: remove white spaces
seerscode Jan 26, 2019
bb38b5b
chore: remove println
seerscode Jan 26, 2019
4f5b71a
chore: remove whitespace
seerscode Jan 26, 2019
523ba5a
fix: generating functions with context
seerscode Jan 30, 2019
67a6d6a
feat: add function to generate with_context declarations
seerscode Jan 30, 2019
3e9ae65
fix: add implementation for with_context function calls
seerscode Jan 31, 2019
3a926ba
fix: add execution context to call_api_at function
seerscode Jan 31, 2019
da9aab8
fix: making use of context to select strategy for block_builder
seerscode Jan 31, 2019
ad58815
chore: cleaning up
seerscode Jan 31, 2019
4e38359
fix: merging issues
seerscode Jan 31, 2019
760ea1e
fix tests
seerscode Jan 31, 2019
ceb8e82
add wasm files
seerscode Jan 31, 2019
24fc9f5
chore: small doc for context fields
seerscode Feb 1, 2019
9e82e27
chore: delete redundant docs
seerscode Feb 1, 2019
0055e78
fix: use full path for ExecutionContext
seerscode Feb 4, 2019
0190ba6
fix: add context functions from inside fold_item_impl
seerscode Feb 5, 2019
eb838ea
chore: remove clone
seerscode Feb 5, 2019
ac293f8
fix: moving generative function to utils, remove unused imports
seerscode Feb 5, 2019
7861ad5
fix: add missing full path for ExecutionContext
seerscode Feb 5, 2019
7b47bd3
fix: merge issues
seerscode Feb 5, 2019
316ed97
update wasm files
seerscode Feb 6, 2019
b98b0e9
fix: update to keep up with changes in master
seerscode Feb 7, 2019
065b40c
chore: remove unused functions, clean up
seerscode Feb 7, 2019
74a43c1
fix test
seerscode Feb 7, 2019
8240541
fix grumbles
seerscode Feb 8, 2019
2d8baf8
fix: add more tests
seerscode Feb 8, 2019
5a6b489
fix: some refactorings
seerscode Feb 8, 2019
2bd981f
feat: add execution strategy to call
seerscode Feb 10, 2019
68589b6
chore: small improvements
seerscode Feb 11, 2019
809391b
fix: add message to panic
seerscode Feb 11, 2019
6407f81
fix tests
seerscode Feb 11, 2019
90d9d19
fix merge conflicts
seerscode Feb 11, 2019
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
Prev Previous commit
Next Next commit
fix: add missing full path for ExecutionContext
  • Loading branch information
seerscode committed Feb 10, 2019
commit 7861ad55b6cc706b28225ca927a7d23623c0628f
2 changes: 1 addition & 1 deletion core/sr-api-macros/src/impl_runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ impl<'a> Fold for ApiRuntimeImplToApiRuntimeApiImpl<'a> {

for item in &input.items {
if let ImplItem::Method(method) = item {
let ctx_method = generate_method_with_context(method);
let ctx_method = generate_method_with_context(method, &crate_);
methods_with_context.push(ImplItem::Method(ctx_method));
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/sr-api-macros/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ pub fn generate_native_call_generator_fn_name(name: &String) -> Ident {
Ident::new(&format!("{}_native_call_generator", name), Span::call_site())
}

/// Gnerates a method with a context argument from the input `method`.
pub fn generate_method_with_context(method: &ImplItemMethod) -> ImplItemMethod {
let context_arg: syn::FnArg = parse_quote!( context: ExecutionContext );
/// Generates a method with a context argument from the input `method`.
pub fn generate_method_with_context(method: &ImplItemMethod, crate_: &TokenStream) -> ImplItemMethod {
let context_arg: syn::FnArg = parse_quote!( context: #crate_::runtime_api::ExecutionContext );
let mut ctx_method = method.clone();
let mut stmt = ctx_method.block.stmts.pop().unwrap();
if let syn::Stmt::Expr(ref mut method_call) = stmt {
Expand Down