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

Add CircularBuffer data structure #4913

Merged
merged 16 commits into from
Apr 26, 2024

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Feb 20, 2024

This is a push-only structure that keeps track of last N values. If the structure is already full, old values are dropped to make room for the new ones.

Fixes #4911

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

Copy link

changeset-bot bot commented Feb 20, 2024

🦋 Changeset detected

Latest commit: 64351ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Amxx Amxx force-pushed the structure/circular-buffer branch from 9ecdee5 to 0067ec7 Compare February 20, 2024 14:23
.changeset/cold-cheetahs-check.md Outdated Show resolved Hide resolved
contracts/mocks/Stateless.sol Show resolved Hide resolved
contracts/utils/Arrays.sol Show resolved Hide resolved
contracts/utils/Arrays.sol Show resolved Hide resolved
contracts/utils/Arrays.sol Show resolved Hide resolved
contracts/utils/structs/CircularBuffer.sol Outdated Show resolved Hide resolved
contracts/utils/structs/CircularBuffer.sol Outdated Show resolved Hide resolved
contracts/utils/structs/CircularBuffer.sol Outdated Show resolved Hide resolved
contracts/utils/structs/CircularBuffer.sol Show resolved Hide resolved
contracts/utils/structs/CircularBuffer.sol Show resolved Hide resolved
ernestognw
ernestognw previously approved these changes Apr 22, 2024
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

LGTM

@ernestognw ernestognw changed the title Datastructure: CircularBuffer Add CircularBuffer data structure Apr 22, 2024
@ernestognw ernestognw merged commit c80b675 into OpenZeppelin:master Apr 26, 2024
20 checks passed
Copy link

@1468907543 1468907543 left a comment

Choose a reason for hiding this comment

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

@_ _

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.

Implement a CircularBuffer
3 participants