This commit is contained in:
Daniel Lubarov 2022-08-02 09:08:24 -07:00
parent 8bb45203f9
commit 3b54ec3986
2 changed files with 5 additions and 0 deletions

View File

@ -137,6 +137,10 @@ impl<'a> Interpreter<'a> {
self.memory.context_memory[0].segments[Segment::TxnFields as usize].content[field as usize]
}
pub(crate) fn get_txn_data(&self) -> &[U256] {
&self.memory.context_memory[0].segments[Segment::TxnData as usize].content
}
pub(crate) fn set_rlp_memory(&mut self, rlp: Vec<u8>) {
self.memory.context_memory[0].segments[Segment::RlpRaw as usize].content =
rlp.into_iter().map(U256::from).collect();

View File

@ -46,6 +46,7 @@ fn process_type_0_txn() -> Result<()> {
assert_eq!(interpreter.get_txn_field(To), 0.into());
assert_eq!(interpreter.get_txn_field(Value), 100.into());
assert_eq!(interpreter.get_txn_field(DataLen), 2.into());
assert_eq!(interpreter.get_txn_data(), &[0x42.into(), 0x42.into()]);
assert_eq!(interpreter.get_txn_field(YParity), 1.into());
assert_eq!(
interpreter.get_txn_field(R),