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

[BUG] Incorrect instruction for register and mint asset. #2923

Closed
AlexStroke opened this issue Oct 28, 2022 · 0 comments
Closed

[BUG] Incorrect instruction for register and mint asset. #2923

AlexStroke opened this issue Oct 28, 2022 · 0 comments
Assignees
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@AlexStroke
Copy link
Contributor

AlexStroke commented Oct 28, 2022

OS and Environment

MacOS, Docker

GIT commit hash

e3cd89b

Minimum working example / Steps to reproduce

#[test]
fn register_asset() -> Result<()> {
    prepare_test_for_nextest!();
    let (_rt, _peer, test_client) = <PeerBuilder>::new().start_with_runtime();

    let asset_id: AssetId = "xor##alice@wonderland".parse()?;
    let register_asset = RegisterBox::new(Asset::new(asset_id, AssetValue::Quantity(10)));
    test_client.submit_blocking(register_asset)?;

    Ok(())
}

Actual result

{
  "v": 0,
  "name": "bunyan_layer",
  "msg": "[RUN - EVENT] Transaction validation failed",
  "level": 40,
  "hostname": "5b66daf4709c",
  "pid": 7,
  "time": "2022-10-28T10:52:21.075476969Z",
  "target": "iroha_core::block",
  "line": 318,
  "file": "core/src/block.rs",
  "caused_by": "Some(NotPermittedFail { reason: \"Validator ```Allow to mint only the assets created by the signer` || `Allow if the signer has the corresponding `can_mint_user_asset_definitions` permission token`` with nested checking` denied the operation `REGISTER `+27817393618-+27817393618#contribution#alice@wonderland: Metadata`` by `alice@wonderland`: Neither the first validator `Allow to mint only the assets created by the signer` succeeded: Can't register assets with definitions registered by other accounts., nor the second validator `Allow if the signer has the corresponding `can_mint_user_asset_definitions` permission token`: Account does not have the needed permission token: can_mint_user_asset_definitions: {`asset_definition_id` : `+27817393618-+27817393618#contribution`}\" })",
  "reason": "Action not permitted: Validator ```Allow to mint only the assets created by the signer` || `Allow if the signer has the corresponding `can_mint_user_asset_definitions` permission token`` with nested checking` denied the operation `REGISTER `+27817393618-+27817393618#contribution#alice@wonderland: Metadata`` by `alice@wonderland`: Neither the first validator `Allow to mint only the assets created by the signer` succeeded: Can't register assets with definitions registered by other accounts., nor the second validator `Allow if the signer has the corresponding `can_mint_user_asset_definitions` permission token`: Account does not have the needed permission token: can_mint_user_asset_definitions: {`asset_definition_id` : `+27817393618-+27817393618#contribution`}",
  "shutdown_receiver": "Receiver { inner: Some(Inner { state: State { is_complete: false, is_closed: false, is_rx_task_set: false, is_tx_task_set: false } }) }"
}

Expected result

In progress

Logs in JSON format

Log contents
Replace this text with a JSON log,
so it doesn't grow too large and has highlighting.

Who can help to reproduce?

No response

Notes

No response

@AlexStroke AlexStroke added Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST LTS labels Oct 28, 2022
@Erigara Erigara self-assigned this Oct 28, 2022
@Erigara Erigara removed the LTS label Oct 28, 2022
Erigara added a commit to Erigara/iroha that referenced this issue Oct 28, 2022
…n` does not exist

Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Oct 28, 2022
…n` does not exist

Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
appetrosyan pushed a commit that referenced this issue Oct 28, 2022
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Arjentix pushed a commit to Arjentix/iroha that referenced this issue Dec 14, 2022
…n` does not exist

Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

3 participants