[FIX] Formatting and code-style (#118)

* [FIX] Formatting and code-style

- gofmt
- import resort
- prealloc slices
- simplify code

* fix vet
This commit is contained in:
Evgeniy Kulikov 2019-01-25 14:20:35 +03:00 committed by fabwa
parent df2e9f68ef
commit f000b76879
37 changed files with 145 additions and 124 deletions

View file

@ -14,7 +14,7 @@ type InvokeResult struct {
State string `json:"state"`
GasConsumed string `json:"gas_consumed"`
Script string `json:"script"`
Stack []*StackParam
Stack []StackParam
}
// AccountStateResponse holds the getaccountstate response.
@ -80,37 +80,37 @@ type SendToAddressResponse struct {
type GetRawTxResponse struct {
responseHeader
Error *Error `json:"error"`
Result *RawTxResponse `json: "result"`
Result *RawTxResponse `json:"result"`
}
type RawTxResponse struct {
TxResponse
BlockHash string `json: "blockhash"`
Confirmations uint `json: "confirmations"`
BlockTime uint `json: "blocktime"`
BlockHash string `json:"blockhash"`
Confirmations uint `json:"confirmations"`
BlockTime uint `json:"blocktime"`
}
type TxResponse struct {
TxID string `json: "txid"`
Size int `json: "size"`
Type string `json: "type"` // todo: convert to TransactionType
Version int `json: "version"`
Attributes []transaction.Attribute `json: "attributes"`
Vins []Vin `json: "vin"`
Vouts []Vout `json: "vout"`
SysFee int `json: "sys_fee"`
NetFee int `json: "net_fee"`
Scripts []transaction.Witness `json: "scripts"`
TxID string `json:"txid"`
Size int `json:"size"`
Type string `json:"type"` // todo: convert to TransactionType
Version int `json:"version"`
Attributes []transaction.Attribute `json:"attributes"`
Vins []Vin `json:"vin"`
Vouts []Vout `json:"vout"`
SysFee int `json:"sys_fee"`
NetFee int `json:"net_fee"`
Scripts []transaction.Witness `json:"scripts"`
}
type Vin struct {
TxId string `json: "txid"`
Vout int `json: "vout"`
TxId string `json:"txid"`
Vout int `json:"vout"`
}
type Vout struct {
N int `json: "n"`
Asset string `json: "asset"`
Value int `json: "value"`
Address string `json: "address"`
N int `json:"n"`
Asset string `json:"asset"`
Value int `json:"value"`
Address string `json:"address"`
}