-
Notifications
You must be signed in to change notification settings - Fork 81
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
WIP: Multi Contract and debugging support for Advanced Transaction Builder #257
Open
kiok46
wants to merge
21
commits into
CashScript:next
Choose a base branch
from
kiok46:multi-contract-tx-debug
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…y methdos from Advanced builder
…r interfaces.ts and TransactionBuilder.ts and remove selector
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…teMultiContract.test.ts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I'm excited to submit this WIP PR and hope it proves helpful to the community.
Due to a few potential breaking changes, most of the new code has been implemented under the
src/advanced/
folder. This allows for clear distinction and facilitates discussion and potential refactoring. For new methods or those responsible for the breaking changes, this folder serves as a separate isloated space.LibauthTemplate
Naming convention and structure for template follow: https://ide.bitauth.com/authentication-template-v0.schema.json
Scenarios:
Generates new scenarios for each new Input (Earlier discussions: CashScript debugger (@mainnet-pat's flipstarter) #172 & Implement debugging support for the Advanced Transaction Builder #230 )
Lock and unlock
Uses the contract's name as a prefix, followed by the function name.
Entities
P2PKH entities use Signer {index} (index increments by 1)
P2SH entities use Contract's Name i.e
artifact.contractName
Scripts
Each
lock
andunlock
script is assigned an identifier and later replaced in the scenarios where the current source output is not being tested. The source output being tested is assigned['slot']
[Assigning a name to the script's reference: JEDEX]Advanced Transaction Builder
The new implementation isn't ideal, but it was the quickest way for me to push it through. The InputOptions has been extended from only expecting
sequence
to now also includecontract
,params
, andtemplate
.template
suggests a P2PKH type input.contract
directly references the contract instance used for the input.params
are the function arguments.Later on, Reference Comparison is used to determine the index of the unlocker and generate the locking and unlocking bytecode.
Tests
Not written yet.
Example
Transactions using multiple contracts and logs are functioning correctly, but thorough testing is still required.
examples/Foo.cash
examples/Bar.cash
examples/develop.js
includes functions for runMock and runMainnetBroadcasted transactions during development and testing before creating this PR:
develop.js