Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFO-4: Code optimization/simplification #1021

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

alistair-singh
Copy link
Contributor

Resolves: SNO-757

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8db1e49) 81.00% compared to head (1c7b049) 81.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1021      +/-   ##
==========================================
+ Coverage   81.00%   81.06%   +0.06%     
==========================================
  Files          52       52              
  Lines        2153     2150       -3     
  Branches       72       70       -2     
==========================================
- Hits         1744     1743       -1     
+ Misses        394      392       -2     
  Partials       15       15              
Flag Coverage Δ
solidity 80.84% <100.00%> (+0.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alistair-singh alistair-singh force-pushed the alistair/audit-info-4-code-optimization branch from 584a44d to 1c7b049 Compare November 27, 2023 12:11
items[i].payloadID,
ScaleCodec.checkedEncodeCompactU32(uint32(items[i].data.length)),
items[i].data
payload, items[i].payloadID, ScaleCodec.checkedEncodeCompactU32(items[i].data.length), items[i].data
Copy link
Collaborator

Choose a reason for hiding this comment

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

It was easier to read this when each item was on its own line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forge fmt reverts to this form.

}

function encodeDigestItem(DigestItem calldata digestItem) internal pure returns (bytes memory) {
if (digestItem.kind == DIGEST_ITEM_PRERUNTIME) {
if (
digestItem.kind == DIGEST_ITEM_PRERUNTIME || digestItem.kind == DIGEST_ITEM_CONSENSUS
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets have each test on its line if the formatter allows it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forge fmt does not allow it.

Copy link
Collaborator

@vgeddes vgeddes left a comment

Choose a reason for hiding this comment

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

+1

@alistair-singh alistair-singh merged commit 9fef193 into main Nov 27, 2023
1 check passed
@alistair-singh alistair-singh deleted the alistair/audit-info-4-code-optimization branch November 27, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants