-
Notifications
You must be signed in to change notification settings - Fork 198
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
Formatted NFT identifier in api response #2949
Formatted NFT identifier in api response #2949
Conversation
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.
Good. Even a unit test :)
@@ -49,10 +49,7 @@ | |||
{ Name = "/:address/esdt/:tokenIdentifier", Open = true }, | |||
|
|||
# /address/:address/nft/:tokenIdentifier/nonce/:nonce will return data of an nft esdt token for a given account, tokenID and nonce |
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.
data of a nft
instead data of an nft
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.
actually, using an
is correct
node/node.go
Outdated
@@ -60,6 +60,8 @@ import ( | |||
// SendTransactionsPipe is the pipe used for sending new transactions | |||
const SendTransactionsPipe = "send transactions pipe" | |||
|
|||
const esdtTickerNumChars = 6 |
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.
group these constants
const(
..
..
)
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
@@ -390,6 +390,73 @@ func TestNode_GetAllESDTTokens(t *testing.T) { | |||
assert.Equal(t, esdtData, value[esdtToken]) | |||
} | |||
|
|||
func TestNode_GetAllESDTTokensShouldReturnEsdtAndFormattedNft(t *testing.T) { | |||
acc, _ := state.NewUserAccount([]byte("newaddress")) |
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.
t.Parallel ?
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.
no test in this file contains t.Parallel()
so I would leave it as it is
# Conflicts: # node/node_test.go
Formatted the NFT identifier in
/address/:address/esdt
endpoint.Now, if a token is regular esdt, the key for it would follow the syntax
TICKER-3e3e3e
and if it the token is a NFT, then it would follow the syntaxTICKER-3e3e3e-02
where02
is the hex encoded nonce.Before this PR, the token identifier for NFTs would have resulted in non readable characters