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

feat: new instruction type AssertBucketContains #1106

Merged
merged 13 commits into from
Aug 1, 2024

Conversation

mrnaveira
Copy link
Collaborator

@mrnaveira mrnaveira commented Jul 30, 2024

Description

  • New instruction AssertBucketContains and associated utils and errors
  • New workspace action for the engine to handle the new instruction
  • Updated protobuf definitions with the new instruction type
  • Updated TypeScript bindings with the new instruction type
  • Bumped TypeScript bindings package version to trigger a npm publish
  • Made tari_dan_wallet_web_ui npm dependencies with bindings and clients use the npm registry instead of local dependencies, to avoid chicken-and-egg situations.

Motivation and Context

We want a new type of transaction instruction to execute asserts. Asserts can be useful in a variety of ways, making transactions more secure and easier to review by the user. For example, it could allow to implement a maximum slippage in a decentralized exchange.

The main use case is to ensure that the return bucket of a component call invocation contains the expected resource and amount of tokens, hence the new instruction is called AssertBucketContains. The fields of the new instruction type are:

  • key: workspace reference of the bucket that we want to assert
  • resource_address: the resource address that the bucket must contain
  • min_amount: the minimum amount of tokens that the bucket must contain

How Has This Been Tested?

New engine unit tests that cover all scenarios

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

Send a transaction with the new instruction type

Breaking Changes

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

Copy link

github-actions bot commented Jul 30, 2024

Test Results (CI)

547 tests  +5   547 ✅ +5   1h 57m 51s ⏱️ - 44m 28s
 65 suites +1     0 💤 ±0 
  2 files   ±0     0 ❌ ±0 

Results for commit 911b259. ± Comparison against base commit 5b0820e.

♻️ This comment has been updated with latest results.

@sdbondi sdbondi added this pull request to the merge queue Aug 1, 2024
Merged via the queue into tari-project:development with commit 0ff6cbf Aug 1, 2024
12 checks passed
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