RPC simulateTransaction endpoint now returns program log output (#10432) (#10444)

automerge
This commit is contained in:
mergify[bot]
2020-06-06 11:57:24 -07:00
committed by GitHub
parent c021727009
commit f7aee67023
13 changed files with 295 additions and 120 deletions

View File

@@ -0,0 +1,16 @@
use std::cell::RefCell;
#[derive(Default)]
pub struct LogCollector {
messages: RefCell<Vec<String>>,
}
impl LogCollector {
pub fn log(&self, message: &str) {
self.messages.borrow_mut().push(message.to_string())
}
pub fn output(self) -> Vec<String> {
self.messages.into_inner()
}
}