How do we decode logs in unit tests?

From this documentation, it is still experimenting --decode hence how can we decode the output manually?

Update:
Do update the documentation, it’s not exactly the same as shown below. I ran forc test --logs

#[test]
 fn foo() {
     let current_timestamp = timestamp();
     log(current_timestamp);
 }

What does the log rb means?
Output:

Decoded log value: 4611686018427387924, log rb: 1515152261580153489

Hey @eesheng, from the documentation, the rb value represents a unique ID for the log instance. The unique ID is not meaningful on its own but allows the Rust and the TS SDKs to know the type of the data being logged, by looking up the log ID in the JSON ABI file.

Let me know if you need more help on the same.

1 Like

Do update the documentation. It is outdated.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.