-
Notifications
You must be signed in to change notification settings - Fork 272
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(utxo-coredao): initialize utxo-coredao #5062
Conversation
e84b02a
to
721828c
Compare
80eb1f9
to
4cd57fc
Compare
9066f6f
to
f317b97
Compare
f317b97
to
2b713f7
Compare
assert.throws(() => | ||
createCoreDaoOpReturnBuffer({ | ||
version: validVersion, | ||
chainId: validChainId, | ||
delegator: validDelegator, | ||
validator: validValidator, | ||
fee: validFee, | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm why tho?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to have either a redeem script or a timelock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deserves a comment, however let's make it a type error instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see other comment
2b713f7
to
2411f6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update codeowners
48a911b
to
f130367
Compare
export function createCoreDaoOpReturnOutputScript({ | ||
version, | ||
chainId, | ||
delegator, | ||
validator, | ||
fee, | ||
redeemScript, | ||
timelock, | ||
}: { | ||
version: number; | ||
chainId: Buffer; | ||
delegator: Buffer; | ||
validator: Buffer; | ||
fee: number; | ||
redeemScript?: Buffer; | ||
timelock?: number; | ||
}): Buffer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make illegal states unrepresentable!
export function createCoreDaoOpReturnOutputScript({ | |
version, | |
chainId, | |
delegator, | |
validator, | |
fee, | |
redeemScript, | |
timelock, | |
}: { | |
version: number; | |
chainId: Buffer; | |
delegator: Buffer; | |
validator: Buffer; | |
fee: number; | |
redeemScript?: Buffer; | |
timelock?: number; | |
}): Buffer { | |
type BaseParams = { | |
version: number; | |
chainId: Buffer; | |
delegator: Buffer; | |
validator: Buffer; | |
fee: number; | |
}; | |
export function createCoreDaoOpReturnOutputScript({ | |
version, | |
chainId, | |
delegator, | |
validator, | |
fee, | |
...rest, | |
}: BaseParams & ({ redeemScript: Buffer; } | { timelock: number })): Buffer { |
You will have to use 'redeemScript' in rest
. Let's move this change to a follow-up PR.
This is dependent on wasm-miniscript with OP_DROP, which is not merged in yet. I will add tests for this once we can import it.
This contains code for the
OP_RETURN
as well as the descriptor for CoreDaoTICKET: BTC-1578