You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remaining usecases for macros (when reusable functions, and in-lined global constants exist)
Re-usable functions with OP_DEFINE/OP_INVOKE change the context for checksig and this.activeBytecode so a function block using this could be a macro and still re-used across contract spending functions without changing context
because this does not work with resuable functions, because Input or Output is not a real type, introspection opcodes immediate operate on the field, so really only this.activeInputIndex is a real item in script tx.inputs[] itself is an incomplete statement
function getActiveInput() returns (Input) {
return tx.inputs[this.activeInputIndex]
}
so macros I assume would just be naive string replacement
remaining usecases for macros (when reusable functions, and in-lined global constants exist)
Re-usable functions with
OP_DEFINE/OP_INVOKEchange the context forchecksigandthis.activeBytecodeso a function block using this could be a macro and still re-used across contract spending functions without changing contextreplaces the need for "syntactic suger for the activeInput and to potentially do something similar for the corresponding output"
consider sytactic suger for the activeInput #234
because this does not work with resuable functions, because
InputorOutputis not a real type, introspection opcodes immediate operate on the field, so really onlythis.activeInputIndexis a real item in scripttx.inputs[]itself is an incomplete statementso macros I assume would just be naive string replacement