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

Token type in altered accounts #6220

Merged
merged 19 commits into from
Jul 3, 2024
Merged

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented May 30, 2024

Reasoning behind the pull request

  • Added token type in the altered accounts structure
  • Added log events for the new builtin functions

Proposed changes

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@miiu96 miiu96 self-assigned this May 30, 2024
sstanculeanu
sstanculeanu previously approved these changes Jun 19, 2024
sstanculeanu
sstanculeanu previously approved these changes Jun 19, 2024
sstanculeanu
sstanculeanu previously approved these changes Jun 20, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.79%. Comparing base (68bbfbc) to head (654852c).
Report is 25 commits behind head on rc/v1.7.next1.

Current head 654852c differs from pull request most recent head 703fe6e

Please upload reports for the commit 703fe6e to get more accurate results.

Additional details and impacted files
@@                Coverage Diff                @@
##           rc/v1.7.next1    #6220      +/-   ##
=================================================
- Coverage          78.79%   78.79%   -0.01%     
=================================================
  Files                753      753              
  Lines              98848    98848              
=================================================
- Hits               77887    77886       -1     
  Misses             15719    15719              
- Partials            5242     5243       +1     

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

@@ -223,6 +223,7 @@ func (aap *alteredAccountsProvider) addTokensDataForMarkedAccount(
Nonce: nonce,
Properties: hex.EncodeToString(esdtToken.Properties),
MetaData: aap.convertMetaData(esdtToken.TokenMetaData),
Type: getTokenType(esdtToken.Type, nonce),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have some unit tests for sft, nft, metaesdt types?

@@ -236,6 +237,16 @@ func (aap *alteredAccountsProvider) addTokensDataForMarkedAccount(
return nil
}

func getTokenType(tokenType uint32, tokenNonce uint64) string {
isNotFungible := tokenNonce != 0
tokenTypeNotSet := isNotFungible && core.ESDTType(tokenType) == core.Fungible
Copy link
Contributor

Choose a reason for hiding this comment

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

default old token here is core.NonFungible

ssd04
ssd04 previously approved these changes Jul 2, 2024
sstanculeanu
sstanculeanu previously approved these changes Jul 2, 2024
@miiu96 miiu96 dismissed stale reviews from sstanculeanu and ssd04 via 20bd374 July 3, 2024 11:21
@miiu96 miiu96 merged commit 3facece into rc/v1.7.next1 Jul 3, 2024
8 checks passed
@miiu96 miiu96 deleted the token-type-altered-accounts branch July 3, 2024 13:34
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.

4 participants