pub fn new(seed: Option<[u8; 32]>) -> Self {
        let instructions: Vec<(StackEffect, BytecodeType)> = vec![
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Pop)),
            (StackEffect::Add, BytecodeType::U64(Bytecode::LdConst)),
            (
                StackEffect::Add,
                BytecodeType::StringPoolIndex(Bytecode::LdStr),
            ),
            (
                StackEffect::Add,
                BytecodeType::AddressPoolIndex(Bytecode::LdAddr),
            ),
            (StackEffect::Add, BytecodeType::NoArg(Bytecode::LdTrue)),
            (StackEffect::Add, BytecodeType::NoArg(Bytecode::LdFalse)),
            (
                StackEffect::Add,
                BytecodeType::ByteArrayPoolIndex(Bytecode::LdByteArray),
            ),
            (StackEffect::Add, BytecodeType::U8(Bytecode::CopyLoc)),
            (StackEffect::Add, BytecodeType::U8(Bytecode::MoveLoc)),
            (StackEffect::Sub, BytecodeType::U8(Bytecode::StLoc)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Add)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Sub)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Mul)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Div)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Mod)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::BitAnd)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::BitOr)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Xor)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Or)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::And)),
            (StackEffect::Nop, BytecodeType::NoArg(Bytecode::Not)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Eq)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Neq)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Lt)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Gt)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Le)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Ge)),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetTxnGasUnitPrice),
            ),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetTxnMaxGasUnits),
            ),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetGasRemaining),
            ),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetTxnSequenceNumber),
            ),
        ];
        let generator = match seed {
            Some(seed) => StdRng::from_seed(seed),
            None => StdRng::from_entropy(),
        };
        Self {
            instructions,
            rng: generator,
        }
    }
/// The `BytecodeGenerator` is instantiated with a seed to use with
/// its random number generator.
The `BytecodeGenerator` is instantiated with a seed to use with
its random number generator.
The ` BytecodeGenerator ` is instantiated with a seed to use with its random number generator .
pub fn new(seed: Option<[u8; 32]>) -> Self {
        let instructions: Vec<(StackEffect, BytecodeType)> = vec![
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Pop)),
            (StackEffect::Add, BytecodeType::U64(Bytecode::LdConst)),
            (
                StackEffect::Add,
                BytecodeType::StringPoolIndex(Bytecode::LdStr),
            ),
            (
                StackEffect::Add,
                BytecodeType::AddressPoolIndex(Bytecode::LdAddr),
            ),
            (StackEffect::Add, BytecodeType::NoArg(Bytecode::LdTrue)),
            (StackEffect::Add, BytecodeType::NoArg(Bytecode::LdFalse)),
            (
                StackEffect::Add,
                BytecodeType::ByteArrayPoolIndex(Bytecode::LdByteArray),
            ),
            (StackEffect::Add, BytecodeType::U8(Bytecode::CopyLoc)),
            (StackEffect::Add, BytecodeType::U8(Bytecode::MoveLoc)),
            (StackEffect::Sub, BytecodeType::U8(Bytecode::StLoc)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Add)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Sub)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Mul)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Div)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Mod)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::BitAnd)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::BitOr)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Xor)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Or)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::And)),
            (StackEffect::Nop, BytecodeType::NoArg(Bytecode::Not)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Eq)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Neq)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Lt)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Gt)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Le)),
            (StackEffect::Sub, BytecodeType::NoArg(Bytecode::Ge)),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetTxnGasUnitPrice),
            ),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetTxnMaxGasUnits),
            ),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetGasRemaining),
            ),
            (
                StackEffect::Add,
                BytecodeType::NoArg(Bytecode::GetTxnSequenceNumber),
            ),
        ];
        let generator = match seed {
            Some(seed) => StdRng::from_seed(seed),
            None => StdRng::from_entropy(),
        };
        Self {
            instructions,
            rng: generator,
        }
    }
pub fn new ( seed : Option < [ u8 ; 32 ] > ) -> Self { let instructions : Vec < ( StackEffect , BytecodeType ) > = vec ! [ ( StackEffect Sub BytecodeType NoArg ( Bytecode Pop ) ) ( StackEffect Add BytecodeType U64 ( Bytecode LdConst ) ) ( StackEffect Add BytecodeType StringPoolIndex ( Bytecode LdStr ) ) ( StackEffect Add BytecodeType AddressPoolIndex ( Bytecode LdAddr ) ) ( StackEffect Add BytecodeType NoArg ( Bytecode LdTrue ) ) ( StackEffect Add BytecodeType NoArg ( Bytecode LdFalse ) ) ( StackEffect Add BytecodeType ByteArrayPoolIndex ( Bytecode LdByteArray ) ) ( StackEffect Add BytecodeType U8 ( Bytecode CopyLoc ) ) ( StackEffect Add BytecodeType U8 ( Bytecode MoveLoc ) ) ( StackEffect Sub BytecodeType U8 ( Bytecode StLoc ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Add ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Sub ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Mul ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Div ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Mod ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode BitAnd ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode BitOr ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Xor ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Or ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode And ) ) ( StackEffect Nop BytecodeType NoArg ( Bytecode Not ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Eq ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Neq ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Lt ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Gt ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Le ) ) ( StackEffect Sub BytecodeType NoArg ( Bytecode Ge ) ) ( StackEffect Add BytecodeType NoArg ( Bytecode GetTxnGasUnitPrice ) ) ( StackEffect Add BytecodeType NoArg ( Bytecode GetTxnMaxGasUnits ) ) ( StackEffect Add BytecodeType NoArg ( Bytecode GetGasRemaining ) ) ( StackEffect Add BytecodeType NoArg ( Bytecode GetTxnSequenceNumber ) ) ] ; let generator = match seed { Some ( seed ) => StdRng :: from_seed ( seed ) , None => StdRng :: from_entropy ( ) , } ; Self { instructions , rng : generator , } }
The `BytecodeGenerator` is instantiated with a seed to use with
its random number generator.
The ` BytecodeGenerator ` is instantiated with a seed to use with its random number generator .
seed
Option<[u8; 32]>
seed
Option<[u8; 32]>