Skip to content

Commit

Permalink
change interface of get timelock
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro committed Aug 21, 2019
1 parent 29e8379 commit 613515e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 4 additions & 14 deletions client/rpc/dex_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type DexClient interface {
GetDepth(tradePair string, level int) (*types.OrderBook, error)
GetProposals(status types.ProposalStatus, numLatest int64) ([]types.Proposal, error)
GetProposal(proposalId int64) (types.Proposal, error)
GetTimelocks(address string) ([]types.TimeLockRecord, error)
GetTimelock(address string, recordID int64) (types.TimeLockRecord, error)
GetTimelocks(addr types.AccAddress) ([]types.TimeLockRecord, error)
GetTimelock(addr types.AccAddress, recordID int64) (types.TimeLockRecord, error)
}

func (c *HTTP) TxInfoSearch(query string, prove bool, page, perPage int) ([]tx.Info, error) {
Expand Down Expand Up @@ -246,12 +246,7 @@ func (c *HTTP) GetDepth(tradePair string, level int) (*types.OrderBook, error) {
return &ob, nil
}

func (c *HTTP) GetTimelocks(address string) ([]types.TimeLockRecord, error) {

addr, err := types.AccAddressFromBech32(address)
if err != nil {
return nil, err
}
func (c *HTTP) GetTimelocks(addr types.AccAddress) ([]types.TimeLockRecord, error) {

params := types.QueryTimeLocksParams{
Account: addr,
Expand Down Expand Up @@ -281,12 +276,7 @@ func (c *HTTP) GetTimelocks(address string) ([]types.TimeLockRecord, error) {

}

func (c *HTTP) GetTimelock(address string, recordID int64) (types.TimeLockRecord, error) {

addr, err := types.AccAddressFromBech32(address)
if err != nil {
return types.TimeLockRecord{}, err
}
func (c *HTTP) GetTimelock(addr types.AccAddress, recordID int64) (types.TimeLockRecord, error) {

params := types.QueryTimeLockParams{
Account: addr,
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down

0 comments on commit 613515e

Please sign in to comment.