Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] #2161: generate FFI functions for data_model #2211

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
103 changes: 63 additions & 40 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Expand Up @@ -16,6 +16,8 @@ members = [
"tools/kagami",
"data_model",
"data_model/primitives",
"ffi",
"ffi/derive",
"futures",
"futures/derive",
"logger",
Expand Down
14 changes: 6 additions & 8 deletions cli/src/lib.rs
Expand Up @@ -173,15 +173,13 @@ where
let network_addr = network.start().await;

let (events_sender, _) = broadcast::channel(100);
let world = W::with(
domains(&config),
config.sumeragi.trusted_peers.peers.clone(),
);
let wsv = Arc::new(
WorldStateView::from_configuration(
config.wsv,
W::with(
domains(&config),
config.sumeragi.trusted_peers.peers.clone(),
),
)
.with_events(events_sender.clone()),
WorldStateView::from_configuration(config.wsv, world)
.with_events(events_sender.clone()),
);

let query_validator = Arc::new(query_validator);
Expand Down
11 changes: 4 additions & 7 deletions cli/src/torii/tests.rs
Expand Up @@ -264,13 +264,10 @@ fn register_account(name: &str) -> Instruction {
}

fn register_asset_definition(name: &str) -> Instruction {
RegisterBox::new(
AssetDefinition::quantity(AssetDefinitionId::new(
name.parse().expect("Valid"),
DOMAIN.parse().expect("Valid"),
))
.build(),
)
RegisterBox::new(AssetDefinition::quantity(AssetDefinitionId::new(
name.parse().expect("Valid"),
DOMAIN.parse().expect("Valid"),
)))
.into()
}

Expand Down
3 changes: 1 addition & 2 deletions client/benches/torii.rs
Expand Up @@ -57,8 +57,7 @@ fn query_requests(criterion: &mut Criterion) {
.into();
let create_account = RegisterBox::new(Account::new(account_id.clone(), [public_key]));
let asset_definition_id = AssetDefinitionId::new("xor".parse().expect("Valid"), domain_id);
let create_asset =
RegisterBox::new(AssetDefinition::quantity(asset_definition_id.clone()).build());
let create_asset = RegisterBox::new(AssetDefinition::quantity(asset_definition_id.clone()));
let quantity: u32 = 200;
let mint_asset = MintBox::new(
Value::U32(quantity),
Expand Down
8 changes: 2 additions & 6 deletions client/examples/million_accounts_genesis.rs
Expand Up @@ -21,12 +21,8 @@ fn main() {
key_pair.public_key().clone(),
)
.with_asset(
AssetDefinition::quantity(
format!("xor-{}", i)
.parse::<<AssetDefinition as Identifiable>::Id>()
.expect("Valid"),
)
.build(),
format!("xor-{}", i).parse().expect("Valid"),
AssetValueType::Quantity,
)
.finish_domain();
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/config.rs
Expand Up @@ -65,7 +65,7 @@ pub struct BasicAuth {
}

/// `Configuration` provides an ability to define client parameters such as `TORII_URL`.
#[derive(Clone, Deserialize, Serialize, Debug, Configurable)]
#[derive(Debug, Clone, Deserialize, Serialize, Configurable)]
#[serde(rename_all = "UPPERCASE")]
#[serde(default)]
#[config(env_prefix = "IROHA_")]
Expand Down