From bc144ff264433d57c4246ac540504129f94ed40d Mon Sep 17 00:00:00 2001 From: Austin Abell Date: Thu, 19 May 2022 05:10:27 -0400 Subject: [PATCH] feat: expose logs and receipt metadata from VMLogic (#6833) Needed to retain functionality for unit testing within the SDK https://github.com/near/near-sdk-rs/pull/820 is the matching PR to the SDK (and other changes needed when updating for reference) --- runtime/near-vm-logic/src/logic.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/near-vm-logic/src/logic.rs b/runtime/near-vm-logic/src/logic.rs index 967d814e678..37062991763 100644 --- a/runtime/near-vm-logic/src/logic.rs +++ b/runtime/near-vm-logic/src/logic.rs @@ -147,6 +147,16 @@ impl<'a> VMLogic<'a> { } } + /// Returns reference to logs that have been created so far. + pub fn logs(&self) -> &[String] { + &self.logs + } + + /// Returns receipt metadata for created receipts + pub fn action_receipts(&self) -> &[(AccountId, ReceiptMetadata)] { + &self.receipt_manager.action_receipts + } + #[allow(dead_code)] #[cfg(test)] pub(crate) fn receipt_manager(&self) -> &ReceiptManager {