From 7176969cc0af52d6f2614f759f774204bb6db7e2 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Wed, 7 Feb 2024 14:12:47 +0900 Subject: [PATCH] chore: unify API response form --- staker/_RPC_api_incentive.gno | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/staker/_RPC_api_incentive.gno b/staker/_RPC_api_incentive.gno index 3d4df4716..d1691e668 100644 --- a/staker/_RPC_api_incentive.gno +++ b/staker/_RPC_api_incentive.gno @@ -10,11 +10,6 @@ import ( const INTERNAL_REWARD_TOKEN_PATH = "gno.land/r/demo/gns" -// type ResponseQueryBase struct { -// Height int64 `json:"height"` -// Timestamp int64 `json:"timestamp"` -// } - type RewardToken struct { PoolPath string `json:"poolPath"` RewardsTokenList []string `json:"rewardsTokenList"` @@ -22,9 +17,7 @@ type RewardToken struct { type ResponseRewardTokens struct { Stat ResponseQueryBase `json:"stat"` - Response struct { - Data []RewardToken `json:"data"` - } `json:"response"` + Response []RewardToken `json:"response"` } func ApiGetRewardTokens() string { @@ -58,12 +51,8 @@ func ApiGetRewardTokens() string { } r := ResponseRewardTokens{ - Stat: qb, - Response: struct { - Data []RewardToken `json:"data"` - }{ - Data: rewardTokens, - }, + Stat: qb, + Response: rewardTokens, } rr, err := json.Marshal(r)