Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[Staking] Attribute adjustment #343

Merged
merged 2 commits into from
Aug 30, 2023
Merged

Conversation

DidacSF
Copy link
Contributor

@DidacSF DidacSF commented Aug 29, 2023

Description

This PR replaces the previously generic NFT Attribute in the nft-staking pallet, with a fixed type, AttributeValue. This type has the following signature:

pub const MAX_BYTES_PER_ATTRIBUTE: u32 = 32;

pub type AttributeValue = BoundedVec<u8, ConstU32<MAX_BYTES_PER_ATTRIBUTE>>;

This allows flexiblity, since we can have attributes only use on byte of the vec while others may use the full 32 bytes. This also makes it easier to verify the contents and make comparisons between values.

Type of changes

  • build: Changes that affect the build system or external dependencies (eg, Cargo, Docker)
  • ci: Changes to CI configuration
  • docs: Changes to documentation only
  • feat: Changes to add a new feature
  • fix: Changes to fix a bug
  • refactor: Changes that do not alter functionality
  • style: Changes to format the code
  • test: Changes to add missing tests or correct existing tests

Checklist

  • Tests for the changes have been added
  • Necessary documentation is added (if appropriate)
  • Formatted with cargo fmt --all
  • Linted with cargo clippy --all-features --all-targets
  • Tested with cargo test --workspace --all-features --all-targets

@DidacSF DidacSF requested a review from darkfriend77 August 29, 2023 14:12
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Patch coverage: 20.00% and no project coverage change.

Comparison is base (7230c4b) 75.81% compared to head (fdcf183) 75.81%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #343   +/-   ##
========================================
  Coverage    75.81%   75.81%           
========================================
  Files           33       33           
  Lines         3444     3444           
========================================
  Hits          2611     2611           
  Misses         833      833           
Files Changed Coverage Δ
pallets/ajuna-nft-staking/benchmarking/src/lib.rs 0.00% <0.00%> (ø)
pallets/ajuna-nft-staking/src/lib.rs 80.00% <0.00%> (ø)
pallets/ajuna-nft-staking/src/contracts.rs 93.54% <100.00%> (ø)

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

@DidacSF DidacSF force-pushed the ds/staking-attribute-adjustment branch from 608b073 to fdcf183 Compare August 29, 2023 15:12
Copy link
Contributor

@darkfriend77 darkfriend77 left a comment

Choose a reason for hiding this comment

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

approve

@darkfriend77 darkfriend77 merged commit ff3d855 into develop Aug 30, 2023
@darkfriend77 darkfriend77 deleted the ds/staking-attribute-adjustment branch August 30, 2023 08:23
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