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

DuplicateTopics error when emitting event with equal values in topics #704

Closed
usetech-llc opened this issue Feb 25, 2021 · 6 comments
Closed
Assignees

Comments

@usetech-llc
Copy link

FAQ

  • Are you using the nightly Rust channel to compile your smart contract?
    Yes, nightly-2021-01-15

  • Are you using an up-to-date cargo-contract? Check via cargo contract --version.

    • If you are unsure please tell us your version noted there.
      cargo contract 0.8.0
  • Are you using an up-to-date ink! version in your smart contract?

    • You can check this by looking into the [dependencies] section of your Cargo.toml.
    • If you are unsure please tell us your version noted there.

v3.0.0-rc2

Describe the bug
When I post this event:

            Self::env().emit_event(WithdrawNFT {
                address: user,
                collection_id,
                token_id,
            });

with collection_id = 1 and token_id = 1, I get DuplicateTopics error. But when I change token ID to 2, I don't get it, transaction runs OK.

@cmichi cmichi self-assigned this Feb 26, 2021
@cmichi
Copy link
Collaborator

cmichi commented Feb 26, 2021

@usetech-llc Thanks for the bug report! I'm having a hard time replicating it though. I used this contract as a minimal example and can't provoke the error. I'm using the flipper/Cargo.toml, the canvas-node as the Substrate instance, and the Canvas UI for deployment.

Some more questions: What version of Substrate are you using? What are the data types of collection_id and token_id?

Also we just released a new cargo-contract version 0.9.1 which you can install with cargo install --force cargo-contract. This shouldn't have an impact on the events logic, but maybe also worth a try.

@athei
Copy link
Contributor

athei commented Feb 26, 2021

Isn't that #594? Those changes are in master but unreleased.

@usetech-llc
Copy link
Author

We are using older (January ~8) version of Contracts pallet, but updating it at the moment. When we are done with update, I'll test it again and let you know, thanks!

@athei
Copy link
Contributor

athei commented Feb 26, 2021

The problem isn't the old version of the pallet. The bug was in ink!. If you are using v3.0.0-rc2 the fix is not in.

@usetech-llc
Copy link
Author

I see, thanks! Do you have any plans to release rc3 or the final release 3.0?

@cmichi
Copy link
Collaborator

cmichi commented Feb 26, 2021

@usetech-llc Yes, we want to do a rc3 asap. At the moment we are just waiting for a bug in our bitvec dependency to be fixed. This requires a nasty hotfix in every Cargo.toml and we don't want to require users to apply that hotfix in order for our rc3 to work.

@athei Good catch!

@cmichi cmichi closed this as completed Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants