-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Rust examples #22
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New examples look indeed more expressive with a thin higher-level layer. However, I think it is problematic that we will have to introduce readers into these examples-specific abstractions. Although it is now certainly a step towards better examples, I think it is a sign that something like this should be a part of iroha
library API. In my view, best examples would be "bare", self-contained, and would not require extra layers apart from the target library itself.
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
@0x009922 I definitely went overboard with the asset definitions, realized I can remove all that stuff. I guess the pain point that led to this is the lack of const APIs for constructing data primitives. |
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
Signed-off-by: Nurzhan Sakén <nurzhan.sakenov@gmail.com>
0ee83a7
to
87e23f9
Compare
@@ -0,0 +1,13 @@ | |||
chain = "00000000-0000-0000-0000-000000000000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we emphasize somewhere in the docs that this value must be generated as UUID (and why). This here is just a dummy value
password = "ilovetea" | ||
|
||
[account] | ||
# Domain in which Alice has an authority |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does "has an authority" mean here? I'd rephrase
register(&as_alice_in_wland, AliceInChess::id())?; | ||
|
||
// The domain owner can also grant a permission to register accounts in the domain. | ||
let can_register_accounts_in_chess = CanRegisterAccountInDomain { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let can_register_accounts_in_chess = CanRegisterAccountInDomain { | |
let can_register_accounts_in_chess = CanRegisterAccount { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you run cargo check
this should fail
iroha = { git = "https://github.com/hyperledger/iroha.git" } | ||
iroha_executor_data_model = { git = "https://github.com/hyperledger/iroha.git" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iroha = { git = "https://github.com/hyperledger/iroha.git" } | |
iroha_executor_data_model = { git = "https://github.com/hyperledger/iroha.git" } | |
iroha = { version = "=2.0.0-rc.1.0", git = "https://github.com/hyperledger/iroha.git" } | |
iroha_executor_data_model = { version = "=2.0.0-rc.1.0", git = "https://github.com/hyperledger/iroha.git" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
until we publish on crates.io
.filter_with(|acc| acc.id.eq(account.clone())) | ||
.execute_single() | ||
.expect_err("account should not be found"); | ||
println!("Account: {}\nUnregistered by: {}", account, as_who.account); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println!("Account: {}\nUnregistered by: {}", account, as_who.account); | |
println!("Account: {account}\nUnregistered by: {}", as_who.account); |
This is a draft PR on new Rust SDK examples.