-
Notifications
You must be signed in to change notification settings - Fork 6
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
esdts-improvements #270
esdts-improvements #270
Changes from 1 commit
1133dc5
fd0a900
eaf054b
7efd30c
02b8c2d
3c058f8
6296aa5
f572594
011114d
963931c
b25d8b8
460d70d
969a1a4
e88291d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,3 +177,19 @@ func ConvertToEvenHexBigInt(value *big.Int) string { | |
|
||
return str | ||
} | ||
|
||
// ConvertESDTTypeToUint32 converts the esdt type to uint32 | ||
func ConvertESDTTypeToUint32(esdtType string) (uint32, error) { | ||
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. tests? 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. Added. |
||
switch esdtType { | ||
case FungibleESDT: | ||
return uint32(Fungible), nil | ||
case NonFungibleESDT: | ||
return uint32(NonFungible), nil | ||
case NonFungibleESDTv2: | ||
return uint32(NonFungibleV2), nil | ||
case MetaESDT: | ||
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. add the more types, dynamics as well. 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. Done. 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. MetaFungibleESDT |
||
return uint32(Meta), nil | ||
default: | ||
return math.MaxUint32, fmt.Errorf("invalid esdt type: %s", esdtType) | ||
} | ||
} |
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.
We have SFT as well. Plus bring here the DynamicNFT, DynamicSFT, DynamicMeta as well.
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.
Added.
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.
change the order of semiFungible and Meta - maybe add MetaFungible - to have a complete name.
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.
+1
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.
Done.