Skip to content

Conversation

@andremacedopv
Copy link
Contributor

This fix makes sure that any call to the NewKey function returns an object with the @key and @assetType properties. Currently, if only the key is sent in the map, the type is never present in the object, affecting the functionality of standard transactions, such as Update Asset.

Signed-off-by: André Macedo <andremacedo.pv@gmail.com>
@andremacedopv andremacedopv requested a review from a team as a code owner August 11, 2025 17:49
Signed-off-by: André Macedo <andremacedo.pv@gmail.com>
@andremacedopv andremacedopv force-pushed the fix/force-assettype-on-key branch from 53027b2 to 79f87d8 Compare August 11, 2025 17:50
Signed-off-by: André Macedo <andremacedo.pv@gmail.com>
@andremacedopv andremacedopv force-pushed the fix/force-assettype-on-key branch from cc5b17b to a7ae3eb Compare August 11, 2025 17:55
@andremacedopv andremacedopv changed the base branch from main to develop August 11, 2025 18:01
@samuelvenzi samuelvenzi requested a review from Copilot August 14, 2025 21:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the NewKey function where the @assetType property was not being populated when only a @key was provided in the input map. The fix ensures that both @key and @assetType properties are always present in the returned Key object by extracting the asset type from the key string when it's not explicitly provided.

  • Extracts asset type from the @key value when @assetType is not present in the input
  • Adds validation to ensure the key format is valid for type extraction
  • Includes comprehensive test coverage for both scenarios (with and without explicit asset type)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
assets/key.go Added logic to extract asset type from @key when @assetType is missing
test/assets_key_test.go Added test cases to verify key generation works with both @assetType and @key inputs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@samuelvenzi samuelvenzi merged commit fa992b5 into develop Aug 14, 2025
4 checks passed
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.

3 participants