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

fix(engine): prevent creation of mismatched resource type bucket #940

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Feb 20, 2024

Description

fix(engine): add resource type check when processing mint args
fix(engine): improve error for resource type mismatch
fix(engine): erroneous dangling resource error when creating an empty vault from a resource
test(engine): add previously failing test for minting a different resource type

Motivation and Context

By specifying mismatching MintArgs you were previously able to create a bucket for a resource type that did not match the resource being operated on.

This test exposed another bug which is also tested in the new test. This occurs when you create an empty vault from a new resource, the engine fails with a dangling resource error because it does not recognise that the new empty resource is contained within the new empty vault.

How Has This Been Tested?

A new failing test, that passes after changes

What process can a PR reviewer use to test or verify this change?

Run engine tests

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

Copy link

Test Results (CI)

488 tests  +1   488 ✅ +1   2h 1m 24s ⏱️ + 1m 14s
 59 suites ±0     0 💤 ±0 
  2 files   ±0     0 ❌ ±0 

Results for commit 2b42a2d. ± Comparison against base commit 3cfbf6e.

@sdbondi sdbondi added this pull request to the merge queue Feb 27, 2024
Merged via the queue into tari-project:development with commit 2c91463 Feb 27, 2024
11 checks passed
@sdbondi sdbondi deleted the engine-check-mint-arg-correctly branch February 27, 2024 08:49
sdbondi added a commit to sdbondi/tari-dan that referenced this pull request Feb 27, 2024
* development:
  fix(engine): prevent creation of mismatched resource type bucket (tari-project#940)
  chore: update to latest feature-dan2 (tari-project#937)
  feat!: optional versions in transaction inputs (tari-project#922)
  feat: add tari-generate (tari-project#941)
sdbondi added a commit to sdbondi/tari-dan that referenced this pull request Feb 27, 2024
* development:
  feat(walletd/js/client): use abstract transport to allow for WebRTC transport (tari-project#943)
  fix(engine): prevent creation of mismatched resource type bucket (tari-project#940)
  chore: update to latest feature-dan2 (tari-project#937)
  feat!: optional versions in transaction inputs (tari-project#922)
  feat: add tari-generate (tari-project#941)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants