Skip to content

Commit

Permalink
Support new log data field (#55)
Browse files Browse the repository at this point in the history
* support new log data field

* fix copy vs clone
  • Loading branch information
Voxelot authored Dec 9, 2021
1 parent 0aa6786 commit 82e6da3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl MemoryClient {
let receipts = txs.into_iter().try_fold(vec![], |mut receipts, tx| {
match interpreter.transact(tx) {
Ok(state) => {
receipts.extend(state.receipts());
receipts.extend(state.receipts().into_iter().cloned());

if !state.receipts().iter().any(|r| matches!(r, Receipt::Revert { .. })) {
interpreter.as_mut().commit();
Expand Down
1 change: 1 addition & 0 deletions src/interpreter/flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ where
a,
b,
digest,
self.memory[a as usize..ab].to_vec(),
self.registers[REG_PC],
self.registers[REG_IS],
);
Expand Down
1 change: 1 addition & 0 deletions src/interpreter/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl<S> Interpreter<S> {
c,
d,
digest,
self.memory[c as usize..cd].to_vec(),
self.registers[REG_PC],
self.registers[REG_IS],
);
Expand Down
2 changes: 1 addition & 1 deletion tests/flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fn call() {
}

let state = Interpreter::transition(&mut storage, tx).expect("Failed to execute script");
let receipt = state.receipts()[1];
let receipt = state.receipts()[1].clone();

assert_eq!(receipt.ra().expect("Receipt value failed"), 0x11);
assert_eq!(receipt.rb().expect("Receipt value failed"), 0x2a);
Expand Down

0 comments on commit 82e6da3

Please sign in to comment.