Skip to content

Commit

Permalink
chore: Add framework dir. (nervosnetwork#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
yejiayu committed Dec 29, 2019
1 parent e709474 commit 49aabdb
Show file tree
Hide file tree
Showing 38 changed files with 214 additions and 709 deletions.
87 changes: 36 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ core-storage = { path = "./core/storage" }
core-mempool = { path = "./core/mempool" }
core-network = { path = "./core/network" }
core-consensus = { path = "./core/consensus" }
core-executor = { path = "./core/executor" }
core-binding = { path = "./core/binding" }
core-binding-macro = { path = "./core/binding-macro" }

binding-macro = { path = "./binding-macro" }
framework = { path = "./framework" }

futures = "0.3"
parking_lot = "0.10"
Expand Down Expand Up @@ -45,12 +45,12 @@ members = [

"core/api",
"core/consensus",
"core/executor",
"core/mempool",
"core/network",
"core/storage",
"core/binding",
"core/binding-macro",

"binding-macro",
"framework",

"protocol",
]
6 changes: 3 additions & 3 deletions core/binding-macro/Cargo.toml → binding-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "core-binding-macro"
name = "binding-macro"
version = "0.1.0"
authors = ["Muta Dev <[email protected]>"]
edition = "2018"
Expand All @@ -11,14 +11,14 @@ proc-macro = true
doctest = false

[dependencies]
core-binding = { path = "../binding" }
framework = { path = "../framework" }

syn = { version = "1.0", features = ["full"] }
proc-macro2 = "1.0"
quote = "1.0"

[dev-dependencies]
protocol = { path = "../../protocol" }
protocol = { path = "../protocol" }

serde_json = "1.0"
bytes = "0.4"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ pub fn gen_service_code(_: TokenStream, item: TokenStream) -> TokenStream {
match method {
#(#list_read_name => {
let payload: #list_read_payload = serde_json::from_str(ctx.get_payload())
.map_err(|e| core_binding::ServiceError::JsonParse(e))?;
.map_err(|e| framework::ServiceError::JsonParse(e))?;
self.#list_read_ident(ctx, payload)
},)*
_ => Err(core_binding::ServiceError::NotFoundMethod(method.to_owned()).into())
_ => Err(framework::ServiceError::NotFoundMethod(method.to_owned()).into())
}
}

Expand All @@ -99,10 +99,10 @@ pub fn gen_service_code(_: TokenStream, item: TokenStream) -> TokenStream {
match method {
#(#list_write_name => {
let payload: #list_write_payload = serde_json::from_str(ctx.get_payload())
.map_err(|e| core_binding::ServiceError::JsonParse(e))?;
.map_err(|e| framework::ServiceError::JsonParse(e))?;
self.#list_write_ident(ctx, payload)
},)*
_ => Err(core_binding::ServiceError::NotFoundMethod(method.to_owned()).into())
_ => Err(framework::ServiceError::NotFoundMethod(method.to_owned()).into())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#[macro_use]
extern crate core_binding_macro;
extern crate binding_macro;

use std::cell::RefCell;
use std::rc::Rc;

use bytes::Bytes;
use serde::{Deserialize, Serialize};

use core_binding_macro::{cycles, read, write};
use protocol::fixed_codec::FixedCodec;
use protocol::traits::{
RequestContext, Service, ServiceSDK, StoreArray, StoreBool, StoreMap, StoreString, StoreUint64,
Expand Down
29 changes: 0 additions & 29 deletions core/binding/src/tests/request_context.rs

This file was deleted.

5 changes: 0 additions & 5 deletions core/executor/src/adapter/mod.rs

This file was deleted.

55 changes: 0 additions & 55 deletions core/executor/src/cycles.rs

This file was deleted.

Loading

0 comments on commit 49aabdb

Please sign in to comment.