pub struct Builder<T>(/* private fields */);Expand description
Implementations§
Source§impl<T> Builder<T>
impl<T> Builder<T>
Sourcepub fn push_slice<D: AsRef<PushBytes>>(self, data: D) -> Self
pub fn push_slice<D: AsRef<PushBytes>>(self, data: D) -> Self
Adds instructions to push some arbitrary data onto the stack.
If the data can be exactly produced by a numeric opcode, that opcode
will be used, since its behavior is equivalent but will not violate minimality
rules. To avoid this, use Builder::push_slice_non_minimal which will always
use a push opcode.
However, this method does not enforce any numeric minimality rules. If your pushes should be interpreted as numbers, ensure your input does not have any leading zeros. In particular, the number 0 should be encoded as an empty string rather than as a single 0 byte.
Sourcepub fn push_slice_non_minimal<D: AsRef<PushBytes>>(self, data: D) -> Self
pub fn push_slice_non_minimal<D: AsRef<PushBytes>>(self, data: D) -> Self
Adds instructions to push some arbitrary data onto the stack without minimality.
Standardness rules require push minimality according to CheckMinimalPush of core.
Sourcepub fn push_opcode(self, data: Opcode) -> Self
pub fn push_opcode(self, data: Opcode) -> Self
Adds a single opcode to the script.
Sourcepub fn into_script(self) -> ScriptBuf<T>
pub fn into_script(self) -> ScriptBuf<T>
Converts the Builder into ScriptBuf.