Do not access ScriptBuf inner from builder
The `Builder` is staying in `bitcoin` while the `ScriptBuf` is moving to `primitives`, so we cannot access the inner field of `ScriptBuf`. Use the new `as_byte_vec` hack to mutate the inner `ScriptBuf` field.
This commit is contained in:
parent
900af453ff
commit
95f2a8dab6
|
@ -7,7 +7,7 @@ use crate::locktime::absolute;
|
|||
use crate::opcodes::all::*;
|
||||
use crate::opcodes::{self, Opcode};
|
||||
use crate::prelude::Vec;
|
||||
use crate::script::{ScriptBufExt as _, ScriptExtPriv as _};
|
||||
use crate::script::{ScriptBufExt as _, ScriptBufExtPriv as _, ScriptExtPriv as _};
|
||||
use crate::Sequence;
|
||||
|
||||
/// An Object which can be used to construct a script piece by piece.
|
||||
|
@ -82,7 +82,7 @@ impl Builder {
|
|||
// "duplicated code" because we need to update `1` field
|
||||
match opcode_to_verify(self.1) {
|
||||
Some(opcode) => {
|
||||
(self.0).0.pop();
|
||||
(self.0).as_byte_vec().pop();
|
||||
self.push_opcode(opcode)
|
||||
}
|
||||
None => self.push_opcode(OP_VERIFY),
|
||||
|
|
Loading…
Reference in New Issue