-
Notifications
You must be signed in to change notification settings - Fork 199
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
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a34b25e
token type
miiu96 92d3b52
Merge branch 'rc/v1.7.next1' into token-type-altered-accounts
miiu96 0929ba9
Merge branch 'rc/v1.7.next1' into token-type-altered-accounts
miiu96 fa37dae
fixes
miiu96 9982efd
new vm common
miiu96 f665511
new vm common
miiu96 934bdda
new vm common with fixes
miiu96 a4bcca1
extra fix
miiu96 01e1fe3
Merge branch 'rc/v1.7.next1' into token-type-altered-accounts
miiu96 784dce5
fix unit tests
miiu96 b6cb7be
new version es indexer
miiu96 8443b80
fix integration test
miiu96 fda1bfa
latest vm common and indexer
miiu96 6548765
Merge branch 'rc/v1.7.next1' into token-type-altered-accounts
miiu96 9526bb8
extra checks
miiu96 654852c
Merge branch 'rc/v1.7.next1' into token-type-altered-accounts
miiu96 647e230
Merge branch 'rc/v1.7.next1' into token-type-altered-accounts
miiu96 703fe6e
small fix
miiu96 20bd374
Merge branch 'refs/heads/rc/v1.7.next1' into token-type-altered-accounts
miiu96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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), | ||
} | ||
if options.WithAdditionalOutportData { | ||
accountTokenData.AdditionalData = &alteredAccount.AdditionalAccountTokenData{ | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default old token here is |
||
if tokenTypeNotSet { | ||
return "" | ||
} | ||
|
||
return core.ESDTType(tokenType).String() | ||
} | ||
|
||
func (aap *alteredAccountsProvider) convertMetaData(metaData *esdt.MetaData) *alteredAccount.TokenMetaData { | ||
if metaData == nil { | ||
return nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?