- 
                Notifications
    
You must be signed in to change notification settings  - Fork 27
 
Introduce Cookbook #424
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
base: main
Are you sure you want to change the base?
Introduce Cookbook #424
Conversation
| 
           The latest updates on your projects. Learn more about Vercel for Git ↗︎ 
  | 
    
dcc9a56    to
    ff6de2a      
    Compare
  
    | 
           I'm using a temp branch with restructured docs as the base for this change in order for us to see the whole picture  | 
    
ff6de2a    to
    a218531      
    Compare
  
    bb83a04    to
    69322de      
    Compare
  
    69322de    to
    1b2cca8      
    Compare
  
    1b2cca8    to
    68a62ae      
    Compare
  
            
          
                .vitepress/config.mts
              
                Outdated
          
        
      | text: 'Events and Filters', | ||
| collapsed: true, | ||
| items: [ | ||
| { | ||
| text: 'Pipeline Events', | ||
| collapsed: true, | ||
| items: [], | ||
| }, | ||
| { | ||
| text: 'Data Events', | ||
| collapsed: true, | ||
| items: [], | ||
| }, | ||
| { | ||
| text: 'Trigger Events', | ||
| collapsed: true, | ||
| items: [], | ||
| }, | ||
| { | ||
| text: 'Advanced Filtering', | ||
| collapsed: true, | ||
| items: [], | ||
| }, | 
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.
this also needs more details, what kind of example can we include here? just "work with {event type}"? or something else?
| AssetDefinition::new( | ||
| magical_keys.clone(), | ||
| AssetValueType::Numeric(NumericSpec::integer()), | ||
| ).mintable_once() | 
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.
This snippet registers an asset with mintable_once, which is different from a non-mintable asset.
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.
I took the example from the integration tests: https://github.com/hyperledger/iroha/blob/v2.0.0-pre-rc.21.1/client/tests/integration/non_mintable.rs#L12
| ``` | ||
| 
               | 
          ||
| ```rust | ||
| fn mint_non_mintable_asset( | 
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 it's non-mintable, how could we mint it 🤔
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.
Good question, I think the mintability naming is unfortunate, and we should rethink it. But that's an issue for the main repo
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.
Same as #424 (comment)
| RegisterExpr::new(AssetDefinition::quantity(asset_definition_id.clone())); | ||
| 
               | 
          ||
| let _hash = admin_client.submit_all_blocking({ | ||
| let isi: [InstructionExpr; 3] = [ | 
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 isi: [InstructionExpr; 3] = [ | |
| let isi: [InstructionBox; _] = [ | 
| ]; | ||
| isi | ||
| })?; | ||
| ``` | 
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.
this example needs to be reworked, it doesn't work like this
| ```rust [Rust] | ||
| let error = mad_hatter_client | ||
| .request(client::asset::by_id(asset_id.clone())) | ||
| .expect_err("Asset should not be found"); | ||
| 
               | 
          ||
| assert!(matches!( | ||
| error, | ||
| ClientQueryError::Validation(ValidationFail::QueryFailed(QueryExecutionFail::Find( | ||
| FindError::Asset(_) | ||
| ))) | ||
| )); | ||
| ``` | 
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 if this account has already that asset? Is there any reliable way to check? Is there any way to store partially signed transaction?
Signed-off-by: Nurzhan Sakén <[email protected]>
(ideally) Closes #423
As of now, a very raw structure of examples that might be useful for users. Will need to add some real content with: