Skip to content

Commit

Permalink
Fix staking response in API encoding unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
daria305 committed Aug 7, 2023
1 parent be646ab commit ef962bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nodeclient/apimodels/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,14 @@ func Test_AccountStakingListResponse(t *testing.T) {
LatestSupportedProtocolVersion: 9,
},
},
Coursor: 0,
PageSize: 50,
RequestedAt: 1,
}

jsonResponse, err := api.JSONEncode(response)
require.NoError(t, err)

expected := "{\"stakers\":[{\"accountId\":\"0xff00000000000000000000000000000000000000000000000000000000000000\",\"stakingEpochEnd\":\"0\",\"poolStake\":\"123\",\"validatorStake\":\"456\",\"fixedCost\":\"69\",\"active\":true,\"latestSupportedProtocolVersion\":9}]}"
expected := "{\"stakers\":[{\"accountId\":\"0xff00000000000000000000000000000000000000000000000000000000000000\",\"stakingEpochEnd\":\"0\",\"poolStake\":\"123\",\"validatorStake\":\"456\",\"fixedCost\":\"69\",\"active\":true,\"latestSupportedProtocolVersion\":9}],\"pageSize\":50,\"coursor\":0,\"requestedAt\":\"1\"}"
require.Equal(t, expected, string(jsonResponse))

decoded := new(apimodels.AccountStakingListResponse)
Expand Down

0 comments on commit ef962bf

Please sign in to comment.