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(core)!: add contract index to blockchain database #4184

Merged
merged 10 commits into from
Jun 13, 2022

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Jun 13, 2022

Description

feat: add contract index to blockchain database
feat: add fetch_contract_outputs_by_contract_id_and_type
feat: impl Display for FixedHash
feat: impl Display for OutputType
feat: add is_sidechain_contract fn to OutputFeatures
test: improvements to blockchain test helpers
test: add contract index tests

Motivation and Context

The contract index keeps track of contract UTXOs in the current UTXO set.
This index allows UTXOs related to contracts to be efficiently fetched and enforces data integrity rules (e.g. only one contract definition is allowed, contract constitution cannot be created without a definition etc.)

How Has This Been Tested?

A number of new blockchain database unit tests.
Manually, adding definition and constitution UTXOs to blockchain

@sdbondi sdbondi force-pushed the core-contract-id-index branch from ed15e45 to 8d13935 Compare June 13, 2022 10:57
@sdbondi sdbondi force-pushed the core-contract-id-index branch from 8d13935 to ef0fb4a Compare June 13, 2022 11:06
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

untested, but looks good

@sdbondi sdbondi removed the mq-failed label Jun 13, 2022
@aviator-app aviator-app bot merged commit b7e97f4 into tari-project:development Jun 13, 2022
@sdbondi sdbondi deleted the core-contract-id-index branch June 13, 2022 14:32
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

Successfully merging this pull request may close these issues.

2 participants