X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=api%2Fquery.go;h=2216dd908cce93a950d1d42bc1b567ba83140839;hb=55af282737c50eb50467788d499d872eb9567563;hp=c3689833a1ae9f8d1df750a988e9a6f7c898a018;hpb=1005d5aeca37334f61be9ffb3631137eb7d6088d;p=bytom%2Fvapor.git diff --git a/api/query.go b/api/query.go index c3689833..2216dd90 100644 --- a/api/query.go +++ b/api/query.go @@ -7,18 +7,18 @@ import ( log "github.com/sirupsen/logrus" - "github.com/vapor/account" - "github.com/vapor/asset" - "github.com/vapor/blockchain/query" - "github.com/vapor/blockchain/signers" - "github.com/vapor/common/arithmetic" - "github.com/vapor/consensus" - "github.com/vapor/crypto/ed25519" - "github.com/vapor/crypto/ed25519/chainkd" - chainjson "github.com/vapor/encoding/json" - "github.com/vapor/errors" - "github.com/vapor/protocol/bc" - "github.com/vapor/protocol/bc/types" + "github.com/bytom/vapor/account" + "github.com/bytom/vapor/asset" + "github.com/bytom/vapor/blockchain/query" + "github.com/bytom/vapor/blockchain/signers" + "github.com/bytom/vapor/common/arithmetic" + "github.com/bytom/vapor/consensus" + "github.com/bytom/vapor/crypto/ed25519" + "github.com/bytom/vapor/crypto/ed25519/chainkd" + chainjson "github.com/bytom/vapor/encoding/json" + "github.com/bytom/vapor/errors" + "github.com/bytom/vapor/protocol/bc" + "github.com/bytom/vapor/protocol/bc/types" ) // POST /list-accounts @@ -283,8 +283,7 @@ func (a *API) decodeRawTransaction(ctx context.Context, ins struct { return NewSuccessResponse(tx) } -// POST /list-unspent-outputs -func (a *API) listUnspentOutputs(ctx context.Context, filter struct { +type ListUtxosReq struct { AccountID string `json:"account_id"` AccountAlias string `json:"account_alias"` ID string `json:"id"` @@ -292,7 +291,10 @@ func (a *API) listUnspentOutputs(ctx context.Context, filter struct { SmartContract bool `json:"smart_contract"` From uint `json:"from"` Count uint `json:"count"` -}) Response { +} + +// POST /list-unspent-outputs +func (a *API) listUnspentOutputs(ctx context.Context, filter ListUtxosReq) Response { accountID := filter.AccountID if filter.AccountAlias != "" { acc, err := a.wallet.AccountMgr.FindByAlias(filter.AccountAlias) @@ -327,7 +329,7 @@ func (a *API) listUnspentOutputs(ctx context.Context, filter struct { // return gasRate func (a *API) gasRate() Response { - gasrate := map[string]int64{"gas_rate": consensus.VMGasRate} + gasrate := map[string]int64{"gas_rate": consensus.ActiveNetParams.VMGasRate} return NewSuccessResponse(gasrate) }