webapi: Use types 2.0.0 (#376)

* webapi: Use types 2.0.0

* v3tool: Use types 2.0.0
This commit is contained in:
Jamie Holdstock 2023-04-12 14:12:53 +01:00 committed by GitHub
parent b5ac64891e
commit 6b99c5d2b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 19 additions and 19 deletions

View File

@ -9,8 +9,8 @@ import (
"time" "time"
"github.com/decred/slog" "github.com/decred/slog"
"github.com/decred/vspd/client" "github.com/decred/vspd/client/v2"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
) )
const ( const (

4
go.mod
View File

@ -15,8 +15,8 @@ require (
github.com/decred/dcrd/txscript/v4 v4.0.0 github.com/decred/dcrd/txscript/v4 v4.0.0
github.com/decred/dcrd/wire v1.5.0 github.com/decred/dcrd/wire v1.5.0
github.com/decred/slog v1.2.0 github.com/decred/slog v1.2.0
github.com/decred/vspd/client v1.1.0 github.com/decred/vspd/client/v2 v2.0.0
github.com/decred/vspd/types v1.1.0 github.com/decred/vspd/types/v2 v2.0.0
github.com/dustin/go-humanize v1.0.1 github.com/dustin/go-humanize v1.0.1
github.com/gin-gonic/gin v1.8.2 github.com/gin-gonic/gin v1.8.2
github.com/gorilla/sessions v1.2.1 github.com/gorilla/sessions v1.2.1

8
go.sum
View File

@ -69,10 +69,10 @@ github.com/decred/dcrd/wire v1.5.0/go.mod h1:fzAjVqw32LkbAZIt5mnrvBR751GTa3e0rRQ
github.com/decred/go-socks v1.1.0/go.mod h1:sDhHqkZH0X4JjSa02oYOGhcGHYp12FsY1jQ/meV8md0= github.com/decred/go-socks v1.1.0/go.mod h1:sDhHqkZH0X4JjSa02oYOGhcGHYp12FsY1jQ/meV8md0=
github.com/decred/slog v1.2.0 h1:soHAxV52B54Di3WtKLfPum9OFfWqwtf/ygf9njdfnPM= github.com/decred/slog v1.2.0 h1:soHAxV52B54Di3WtKLfPum9OFfWqwtf/ygf9njdfnPM=
github.com/decred/slog v1.2.0/go.mod h1:kVXlGnt6DHy2fV5OjSeuvCJ0OmlmTF6LFpEPMu/fOY0= github.com/decred/slog v1.2.0/go.mod h1:kVXlGnt6DHy2fV5OjSeuvCJ0OmlmTF6LFpEPMu/fOY0=
github.com/decred/vspd/client v1.1.0 h1:vyMjbT9jGuH96yNsv2msx5E/DP7xk3ePIU7XWhu1Des= github.com/decred/vspd/client/v2 v2.0.0 h1:gaSF1Bm2/EvoAiSLxNR5fgStrObAO66xmanhedidYIM=
github.com/decred/vspd/client v1.1.0/go.mod h1:+gn860mKciikYxQrPm+hSVMEG8CQ7EWf/vN9pZa3Baw= github.com/decred/vspd/client/v2 v2.0.0/go.mod h1:IDDviEe/6CuxxrW0PLOcg448enU3YmeElFHledYHw78=
github.com/decred/vspd/types v1.1.0 h1:hTeqQwgRUN2FGIbuCIdyzBejKV+jxKrmEIcLKxpsB1g= github.com/decred/vspd/types/v2 v2.0.0 h1:FaPA+W4OOMRWK+Vk4fyyYdXoVLRMMRQsxzsnSjJjOnI=
github.com/decred/vspd/types v1.1.0/go.mod h1:THsO8aBSwWBq6ZsIG25cNqbkNb+EEASXzLhFvODVc0s= github.com/decred/vspd/types/v2 v2.0.0/go.mod h1:2xnNqedkt9GuL+pK8uIzDxqYxFlwLRflYFJH64b76n0=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=

View File

@ -12,7 +12,7 @@ import (
"github.com/decred/dcrd/dcrutil/v4" "github.com/decred/dcrd/dcrutil/v4"
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/rpc" "github.com/decred/vspd/rpc"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )

View File

@ -15,7 +15,7 @@ import (
"github.com/decred/dcrd/blockchain/stake/v4" "github.com/decred/dcrd/blockchain/stake/v4"
"github.com/decred/vspd/rpc" "github.com/decred/vspd/rpc"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
"github.com/gorilla/sessions" "github.com/gorilla/sessions"

View File

@ -15,7 +15,7 @@ import (
"github.com/decred/dcrd/txscript/v4/stdaddr" "github.com/decred/dcrd/txscript/v4/stdaddr"
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/rpc" "github.com/decred/vspd/rpc"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )

View File

@ -11,7 +11,7 @@ import (
"github.com/decred/dcrd/txscript/v4/stdaddr" "github.com/decred/dcrd/txscript/v4/stdaddr"
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/rpc" "github.com/decred/vspd/rpc"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )

View File

@ -22,7 +22,7 @@ import (
dcrdtypes "github.com/decred/dcrd/rpc/jsonrpc/types/v3" dcrdtypes "github.com/decred/dcrd/rpc/jsonrpc/types/v3"
"github.com/decred/slog" "github.com/decred/slog"
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -294,7 +294,7 @@ func TestSetAltSignAddress(t *testing.T) {
t.Fatalf("could not unmarshal error response: %v", err) t.Fatalf("could not unmarshal error response: %v", err)
} }
if int64(test.wantErrCode) != apiError.Code { if test.wantErrCode != apiError.Code {
t.Fatalf("incorrect error code, expected %d, actual %d", t.Fatalf("incorrect error code, expected %d, actual %d",
test.wantErrCode, apiError.Code) test.wantErrCode, apiError.Code)
} }

View File

@ -11,7 +11,7 @@ import (
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/rpc" "github.com/decred/vspd/rpc"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )

View File

@ -8,7 +8,7 @@ import (
"time" "time"
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )

View File

@ -7,7 +7,7 @@ package webapi
import ( import (
"time" "time"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/decred/vspd/version" "github.com/decred/vspd/version"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View File

@ -21,7 +21,7 @@ import (
"github.com/decred/slog" "github.com/decred/slog"
"github.com/decred/vspd/database" "github.com/decred/vspd/database"
"github.com/decred/vspd/rpc" "github.com/decred/vspd/rpc"
"github.com/decred/vspd/types" "github.com/decred/vspd/types/v2"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gorilla/sessions" "github.com/gorilla/sessions"
@ -313,7 +313,7 @@ func (s *Server) sendErrorWithMsg(msg string, e types.ErrorCode, c *gin.Context)
status := e.HTTPStatus() status := e.HTTPStatus()
resp := types.ErrorResponse{ resp := types.ErrorResponse{
Code: int64(e), Code: e,
Message: msg, Message: msg,
} }