Created
June 8, 2020 17:04
-
-
Save sanket1729/a53fcdc6bbcc4bf71c257b69c5931d87 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| trait ScriptContext<Pk: MiniscriptKey>{ | |
| fn is_valid(&self, node: decode::Terminal<Pk>) -> Result<(), Error>{ | |
| } | |
| } | |
| struct Legacy{ | |
| } | |
| impl<Pk: MiniscriptKey> ScriptContext<Pk> for Legacy{ | |
| } | |
| struct Segwitv0{ | |
| } | |
| impl<Pk: MiniscriptKey> ScriptContext<Pk> for Segwitv0{ | |
| } | |
| /// Top-level script AST type | |
| #[derive(Clone, Hash)] | |
| pub struct Miniscript<Pk: MiniscriptKey, Ctx: ScriptContext<Pk>> { | |
| ///A node in the Abstract Syntax Tree( | |
| pub node: decode::Terminal<Pk>, | |
| ///The correctness and malleability type information for the AST node | |
| pub ty: types::Type, | |
| ///Additional information helpful for extra analysis. | |
| pub ext: types::extra_props::ExtData, | |
| /// Script Context(Legacy, Segwit ..) under which the miniscript is bieng used | |
| pub ctx: ScriptContext<Pk>, | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment