Add service provider auctions #59
@ -168,9 +168,12 @@ type Auction {
|
||||
commitFee: Coin! # Fee required to bid/participate in the auction.
|
||||
revealFee: Coin! # Reveal fee (paid back to bidders only if they unseal/reveal the bid).
|
||||
minimumBid: Coin! # Minimum bid amount.
|
||||
winnerAddress: String! # Winner address.
|
||||
winnerBid: Coin! # The winning bid amount.
|
||||
winnerAddresses: [String]! # Winner address.
|
||||
winnerBids: [Coin]! # The winning bid amount.
|
||||
winnerPrice: Coin! # The price that the winner actually pays (2nd highest bid).
|
||||
maxPrice: Coin! # Max bid amount for service provider auction.
|
||||
kind: String! # Auction kind.
|
||||
numProviders: Int # Number of service providers
|
||||
bids: [AuctionBid] # Bids make in the auction.
|
||||
}
|
||||
|
||||
|
324
gql/generated.go
324
gql/generated.go
@ -66,13 +66,16 @@ type ComplexityRoot struct {
|
||||
CommitsEndTime func(childComplexity int) int
|
||||
CreateTime func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
Kind func(childComplexity int) int
|
||||
MaxPrice func(childComplexity int) int
|
||||
MinimumBid func(childComplexity int) int
|
||||
NumProviders func(childComplexity int) int
|
||||
OwnerAddress func(childComplexity int) int
|
||||
RevealFee func(childComplexity int) int
|
||||
RevealsEndTime func(childComplexity int) int
|
||||
Status func(childComplexity int) int
|
||||
WinnerAddress func(childComplexity int) int
|
||||
WinnerBid func(childComplexity int) int
|
||||
WinnerAddresses func(childComplexity int) int
|
||||
WinnerBids func(childComplexity int) int
|
||||
WinnerPrice func(childComplexity int) int
|
||||
}
|
||||
|
||||
@ -353,6 +356,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Auction.ID(childComplexity), true
|
||||
|
||||
case "Auction.kind":
|
||||
if e.complexity.Auction.Kind == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Auction.Kind(childComplexity), true
|
||||
|
||||
case "Auction.maxPrice":
|
||||
if e.complexity.Auction.MaxPrice == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Auction.MaxPrice(childComplexity), true
|
||||
|
||||
case "Auction.minimumBid":
|
||||
if e.complexity.Auction.MinimumBid == nil {
|
||||
break
|
||||
@ -360,6 +377,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Auction.MinimumBid(childComplexity), true
|
||||
|
||||
case "Auction.numProviders":
|
||||
if e.complexity.Auction.NumProviders == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Auction.NumProviders(childComplexity), true
|
||||
|
||||
case "Auction.ownerAddress":
|
||||
if e.complexity.Auction.OwnerAddress == nil {
|
||||
break
|
||||
@ -388,19 +412,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Auction.Status(childComplexity), true
|
||||
|
||||
case "Auction.winnerAddress":
|
||||
if e.complexity.Auction.WinnerAddress == nil {
|
||||
case "Auction.winnerAddresses":
|
||||
if e.complexity.Auction.WinnerAddresses == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Auction.WinnerAddress(childComplexity), true
|
||||
return e.complexity.Auction.WinnerAddresses(childComplexity), true
|
||||
|
||||
case "Auction.winnerBid":
|
||||
if e.complexity.Auction.WinnerBid == nil {
|
||||
case "Auction.winnerBids":
|
||||
if e.complexity.Auction.WinnerBids == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Auction.WinnerBid(childComplexity), true
|
||||
return e.complexity.Auction.WinnerBids(childComplexity), true
|
||||
|
||||
case "Auction.winnerPrice":
|
||||
if e.complexity.Auction.WinnerPrice == nil {
|
||||
@ -2147,8 +2171,8 @@ func (ec *executionContext) fieldContext_Auction_minimumBid(ctx context.Context,
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_winnerAddress(ctx, field)
|
||||
func (ec *executionContext) _Auction_winnerAddresses(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_winnerAddresses(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
@ -2161,7 +2185,7 @@ func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field gr
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.WinnerAddress, nil
|
||||
return obj.WinnerAddresses, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
@ -2173,12 +2197,12 @@ func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field gr
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
res := resTmp.([]*string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
return ec.marshalNString2ᚕᚖstring(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Auction_winnerAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
func (ec *executionContext) fieldContext_Auction_winnerAddresses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Auction",
|
||||
Field: field,
|
||||
@ -2191,8 +2215,8 @@ func (ec *executionContext) fieldContext_Auction_winnerAddress(ctx context.Conte
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_winnerBid(ctx, field)
|
||||
func (ec *executionContext) _Auction_winnerBids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_winnerBids(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
@ -2205,7 +2229,7 @@ func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphq
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.WinnerBid, nil
|
||||
return obj.WinnerBids, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
@ -2217,12 +2241,12 @@ func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphq
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*Coin)
|
||||
res := resTmp.([]*Coin)
|
||||
fc.Result = res
|
||||
return ec.marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res)
|
||||
return ec.marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Auction_winnerBid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
func (ec *executionContext) fieldContext_Auction_winnerBids(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Auction",
|
||||
Field: field,
|
||||
@ -2291,6 +2315,141 @@ func (ec *executionContext) fieldContext_Auction_winnerPrice(ctx context.Context
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Auction_maxPrice(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_maxPrice(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.MaxPrice, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*Coin)
|
||||
fc.Result = res
|
||||
return ec.marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Auction_maxPrice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Auction",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "type":
|
||||
return ec.fieldContext_Coin_type(ctx, field)
|
||||
case "quantity":
|
||||
return ec.fieldContext_Coin_quantity(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name)
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Auction_kind(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_kind(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Kind, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Auction_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Auction",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type String does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Auction_numProviders(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_numProviders(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.NumProviders, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*int)
|
||||
fc.Result = res
|
||||
return ec.marshalOInt2ᚖint(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Auction_numProviders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Auction",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type Int does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Auction_bids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Auction_bids(ctx, field)
|
||||
if err != nil {
|
||||
@ -3142,12 +3301,18 @@ func (ec *executionContext) fieldContext_AuthorityRecord_auction(ctx context.Con
|
||||
return ec.fieldContext_Auction_revealFee(ctx, field)
|
||||
case "minimumBid":
|
||||
return ec.fieldContext_Auction_minimumBid(ctx, field)
|
||||
case "winnerAddress":
|
||||
return ec.fieldContext_Auction_winnerAddress(ctx, field)
|
||||
case "winnerBid":
|
||||
return ec.fieldContext_Auction_winnerBid(ctx, field)
|
||||
case "winnerAddresses":
|
||||
return ec.fieldContext_Auction_winnerAddresses(ctx, field)
|
||||
case "winnerBids":
|
||||
return ec.fieldContext_Auction_winnerBids(ctx, field)
|
||||
case "winnerPrice":
|
||||
return ec.fieldContext_Auction_winnerPrice(ctx, field)
|
||||
case "maxPrice":
|
||||
return ec.fieldContext_Auction_maxPrice(ctx, field)
|
||||
case "kind":
|
||||
return ec.fieldContext_Auction_kind(ctx, field)
|
||||
case "numProviders":
|
||||
return ec.fieldContext_Auction_numProviders(ctx, field)
|
||||
case "bids":
|
||||
return ec.fieldContext_Auction_bids(ctx, field)
|
||||
}
|
||||
@ -5129,12 +5294,18 @@ func (ec *executionContext) fieldContext_Query_getAuctionsByIds(ctx context.Cont
|
||||
return ec.fieldContext_Auction_revealFee(ctx, field)
|
||||
case "minimumBid":
|
||||
return ec.fieldContext_Auction_minimumBid(ctx, field)
|
||||
case "winnerAddress":
|
||||
return ec.fieldContext_Auction_winnerAddress(ctx, field)
|
||||
case "winnerBid":
|
||||
return ec.fieldContext_Auction_winnerBid(ctx, field)
|
||||
case "winnerAddresses":
|
||||
return ec.fieldContext_Auction_winnerAddresses(ctx, field)
|
||||
case "winnerBids":
|
||||
return ec.fieldContext_Auction_winnerBids(ctx, field)
|
||||
case "winnerPrice":
|
||||
return ec.fieldContext_Auction_winnerPrice(ctx, field)
|
||||
case "maxPrice":
|
||||
return ec.fieldContext_Auction_maxPrice(ctx, field)
|
||||
case "kind":
|
||||
return ec.fieldContext_Auction_kind(ctx, field)
|
||||
case "numProviders":
|
||||
return ec.fieldContext_Auction_numProviders(ctx, field)
|
||||
case "bids":
|
||||
return ec.fieldContext_Auction_bids(ctx, field)
|
||||
}
|
||||
@ -8710,16 +8881,16 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet,
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "winnerAddress":
|
||||
case "winnerAddresses":
|
||||
|
||||
out.Values[i] = ec._Auction_winnerAddress(ctx, field, obj)
|
||||
out.Values[i] = ec._Auction_winnerAddresses(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "winnerBid":
|
||||
case "winnerBids":
|
||||
|
||||
out.Values[i] = ec._Auction_winnerBid(ctx, field, obj)
|
||||
out.Values[i] = ec._Auction_winnerBids(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
@ -8731,6 +8902,24 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet,
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "maxPrice":
|
||||
|
||||
out.Values[i] = ec._Auction_maxPrice(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "kind":
|
||||
|
||||
out.Values[i] = ec._Auction_kind(ctx, field, obj)
|
||||
|
||||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "numProviders":
|
||||
|
||||
out.Values[i] = ec._Auction_numProviders(ctx, field, obj)
|
||||
|
||||
case "bids":
|
||||
|
||||
out.Values[i] = ec._Auction_bids(ctx, field, obj)
|
||||
@ -10500,6 +10689,44 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se
|
||||
return res
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v []*Coin) graphql.Marshaler {
|
||||
ret := make(graphql.Array, len(v))
|
||||
var wg sync.WaitGroup
|
||||
isLen1 := len(v) == 1
|
||||
if !isLen1 {
|
||||
wg.Add(len(v))
|
||||
}
|
||||
for i := range v {
|
||||
i := i
|
||||
fc := &graphql.FieldContext{
|
||||
Index: &i,
|
||||
Result: &v[i],
|
||||
}
|
||||
ctx := graphql.WithFieldContext(ctx, fc)
|
||||
f := func(i int) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = nil
|
||||
}
|
||||
}()
|
||||
if !isLen1 {
|
||||
defer wg.Done()
|
||||
}
|
||||
ret[i] = ec.marshalOCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, sel, v[i])
|
||||
}
|
||||
if isLen1 {
|
||||
f(i)
|
||||
} else {
|
||||
go f(i)
|
||||
}
|
||||
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
@ -10732,6 +10959,32 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S
|
||||
return res
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) {
|
||||
var vSlice []interface{}
|
||||
if v != nil {
|
||||
vSlice = graphql.CoerceList(v)
|
||||
}
|
||||
var err error
|
||||
res := make([]*string, len(vSlice))
|
||||
for i := range vSlice {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
||||
res[i], err = ec.unmarshalOString2ᚖstring(ctx, vSlice[i])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel ast.SelectionSet, v []*string) graphql.Marshaler {
|
||||
ret := make(graphql.Array, len(v))
|
||||
for i := range v {
|
||||
ret[i] = ec.marshalOString2ᚖstring(ctx, sel, v[i])
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNSyncInfo2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐSyncInfo(ctx context.Context, sel ast.SelectionSet, v *SyncInfo) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
@ -11444,6 +11697,13 @@ func (ec *executionContext) marshalOCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaco
|
||||
return ret
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalOCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._Coin(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalOFloat2ᚖfloat64(ctx context.Context, v interface{}) (*float64, error) {
|
||||
if v == nil {
|
||||
return nil, nil
|
||||
|
@ -35,9 +35,12 @@ type Auction struct {
|
||||
CommitFee *Coin `json:"commitFee"`
|
||||
RevealFee *Coin `json:"revealFee"`
|
||||
MinimumBid *Coin `json:"minimumBid"`
|
||||
WinnerAddress string `json:"winnerAddress"`
|
||||
WinnerBid *Coin `json:"winnerBid"`
|
||||
WinnerAddresses []*string `json:"winnerAddresses"`
|
||||
WinnerBids []*Coin `json:"winnerBids"`
|
||||
WinnerPrice *Coin `json:"winnerPrice"`
|
||||
MaxPrice *Coin `json:"maxPrice"`
|
||||
Kind string `json:"kind"`
|
||||
NumProviders *int `json:"numProviders"`
|
||||
Bids []*AuctionBid `json:"bids"`
|
||||
}
|
||||
|
||||
|
14
gql/util.go
14
gql/util.go
@ -232,6 +232,13 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
winnerAddresses := make([]*string, len(auction.WinnerAddresses))
|
||||
for i, addr := range auction.WinnerAddresses {
|
||||
winnerAddresses[i] = &addr
|
||||
}
|
||||
|
||||
numProviders := int(auction.NumProviders)
|
||||
|
||||
gqlAuction := Auction{
|
||||
ID: auction.Id,
|
||||
Status: auction.Status,
|
||||
@ -242,9 +249,12 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au
|
||||
CommitFee: getGQLCoin(auction.CommitFee),
|
||||
RevealFee: getGQLCoin(auction.RevealFee),
|
||||
MinimumBid: getGQLCoin(auction.MinimumBid),
|
||||
WinnerAddress: auction.WinnerAddress,
|
||||
WinnerBid: getGQLCoin(auction.WinningBid),
|
||||
WinnerAddresses: winnerAddresses,
|
||||
WinnerBids: getGQLCoins(auction.WinningBids),
|
||||
WinnerPrice: getGQLCoin(auction.WinningPrice),
|
||||
MaxPrice: getGQLCoin(auction.MaxPrice),
|
||||
Kind: auction.Kind,
|
||||
NumProviders: &numProviders,
|
||||
}
|
||||
|
||||
auctionBids := make([]*AuctionBid, len(bids))
|
||||
|
Loading…
Reference in New Issue
Block a user