Skip to content

Commit

Permalink
add field TransactionResult.Tags.TxSellAmount string json:"tx.sell_am…
Browse files Browse the repository at this point in the history
…ount,omitempty" and add omitempty for some fields
  • Loading branch information
klim0v committed Nov 24, 2019
1 parent 43def5b commit 821fe35
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion api/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type AddressResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *AddressResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type BlockResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *BlockResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type CandidateResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *CandidateResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/candidates.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type CandidatesResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result []*CandidateResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/coin_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type CoinInfoResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *CoinInfoResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/estimate_coin_buy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type EstimateCoinBuyResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *EstimateCoinBuyResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/estimate_coin_sell.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type EstimateCoinSellResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *EstimateCoinSellResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/estimate_tx_commission.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type EstimateTxCommissionResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *EstimateTxCommissionResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type EventsResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *EventsResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/max_gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

type MaxGasResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result string `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/min_gas_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

type MinGasPriceResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result string `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/missed_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type MissedBlocksResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *MissedBlocksResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
12 changes: 6 additions & 6 deletions api/send_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type SendTransactionResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *SendTransactionResult `json:"result,omitempty"`
Error *TxError `json:"error,omitempty"`
}
Expand All @@ -22,12 +22,12 @@ type SendTransactionResult struct {

type TxError struct {
Code int `json:"code,omitempty"`
Message string `json:"message"`
Data string `json:"data"`
Message string `json:"message,omitempty"`
Data string `json:"data,omitempty"`
TxResult struct {
Code int `json:"code"`
Log string `json:"log"`
} `json:"tx_result"`
Code int `json:"code,omitempty"`
Log string `json:"log,omitempty"`
} `json:"tx_result,omitempty"`
}

func (e *TxError) Error() string {
Expand Down
4 changes: 2 additions & 2 deletions api/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type StatusResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *StatusResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand All @@ -26,7 +26,7 @@ type StatusResult struct {
Block string `json:"block"`
App string `json:"app"`
} `json:"protocol_version"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
ListenAddr string `json:"listen_addr"`
Network string `json:"network"`
Version string `json:"version"`
Expand Down
5 changes: 3 additions & 2 deletions api/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type TransactionResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *TransactionResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand All @@ -32,7 +32,8 @@ type TransactionResult struct {
TxType string `json:"tx.type,omitempty"`
TxFrom string `json:"tx.from,omitempty"`
TxTo string `json:"tx.to,omitempty"`
TxCoin string `json:"tx.coin"`
TxCoin string `json:"tx.coin,omitempty"`
TxSellAmount string `json:"tx.sell_amount,omitempty"`
} `json:"tags,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion api/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type TransactionsResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result []*TransactionResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/unconfirmed_txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type UnconfirmedTxsResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result *UnconfirmedTxsResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type ValidatorsResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID string `json:"id"`
ID string `json:"id,omitempty"`
Result []*ValidatorResult `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Expand Down

0 comments on commit 821fe35

Please sign in to comment.