-
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
wrapped vm output api response #2287
Conversation
} | ||
|
||
// GetFirstReturnData is a helper function that returns the first ReturnData of VMOutput, interpreted as specified. | ||
func (vmOutput *VMOutputApi) GetFirstReturnData(asType vmcommon.ReturnDataKind) (interface{}, error) { |
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.
unit test?
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 unit tests for all cases (as big int, as big int string, as hex and as string)
facade/nodeFacade.go
Outdated
func (nf *nodeFacade) convertVmOutputToApiResponse(input *vmcommon.VMOutput) *vm.VMOutputApi { | ||
outputAccounts := make(map[string]*vm.OutputAccountApi) | ||
for key, acc := range input.OutputAccounts { | ||
outPutAddress, err := nf.node.EncodeAddressPubkey(acc.Address) |
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.
outputAddress*
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
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.
System tests passed.
created a wrapped structure which will be returned when calling a
vm-values
endpoint. Now it will display addresses in bech32 format when needed and added custom json tags (with lowercase)Testing procedure:
vm-values/query
for example and the output should follow json format and not having unreadable characters