Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Refactor: Cleanup program-runtime dyn Traits#21395

Merged
Lichtso merged 6 commits intosolana-labs:masterfrom
Lichtso:refactor/cleanup_program_runtime_dyn_traits
Nov 23, 2021
Merged

Refactor: Cleanup program-runtime dyn Traits#21395
Lichtso merged 6 commits intosolana-labs:masterfrom
Lichtso:refactor/cleanup_program_runtime_dyn_traits

Conversation

@Lichtso
Copy link
Copy Markdown
Contributor

@Lichtso Lichtso commented Nov 22, 2021

Problem

There are dyn Traits with only one implementation in the program-runtime crate.

Summary of Changes

  • Unifies trait ComputeMeter, ThisComputeMeter and TransactionComputeMeter.
  • Unifies trait Logger, ThisLogger and LogCollector.
  • Removes inner RefCell from LogCollector.

Fixes #

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 23, 2021

Codecov Report

Merging #21395 (81e3c2d) into master (c3e5927) will increase coverage by 0.0%.
The diff coverage is 87.4%.

@@           Coverage Diff            @@
##           master   #21395    +/-   ##
========================================
  Coverage    81.5%    81.5%            
========================================
  Files         500      504     +4     
  Lines      140604   141468   +864     
========================================
+ Hits       114704   115432   +728     
- Misses      25900    26036   +136     

@Lichtso Lichtso merged commit 22a2537 into solana-labs:master Nov 23, 2021
@Lichtso Lichtso deleted the refactor/cleanup_program_runtime_dyn_traits branch November 23, 2021 12:23
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
* Unifies dyn Trait ComputeMeter, ThisComputeMeter and TransactionComputeMeter.

* Unifies dyn Trait Logger and ThisLogger.

* Moves Logger to log_collector.rs

* Unifies Logger and LogCollector.

* Removes inner RefCell from LogCollector.

* Adds the log::debug!() message to ic_logger_msg!() again.
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
Comment thread program-test/src/lib.rs
if logger.log_enabled() {
logger.log(&format!("Program log: {}", message));
}
ic_msg!(invoke_context, "Program log: {}", message);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much better!

@Lichtso Lichtso mentioned this pull request Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants