diff --git a/Cargo.toml b/Cargo.toml index 0767966af2..6cc9af4927 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,4 +30,4 @@ std = [ "frame-system/std", "pallet-evm/std", "evm/std", -] \ No newline at end of file +] diff --git a/src/lib.rs b/src/lib.rs index f76c2f6878..a82108db39 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -120,6 +120,16 @@ impl OutputBuilder { self.data.extend_from_slice(&buffer); self } + + /// Push a U256 to the output. + pub fn write_bool>(mut self, value: T) -> Self { + let mut buffer = [0u8; 32]; + if value.into() { + buffer[31] = 1; + } + self.data.extend_from_slice(&buffer); + self + } } impl Default for OutputBuilder {