Files
ark/pkg/client-sdk/client/rest/service/models/v1_round.go
Pietralberto Mazza 89df461623 Update client sdk (#207)
* Add bitcoin networks

* Refactor client

* Refactor explorer

* Refactor store

* Refactor wallet

* Refactor sdk client

* Refactor wasm & Update examples

* Move common util funcs to internal/utils

* Move to constants for service types

* Add unit tests

* Parallelize tests

* Lint

* Add job to gh action

* go mod tidy

* Fixes

* Fixes

* Fix compose file

* Fixes

* Fixes after review:
* Drop factory pattern
* Drop password from ark client methods
* Make singlekey wallet manage store and wallet store instead of defining WalletStore as extension of Store
* Move constants to arksdk module
* Drop config and expect directory store and wallet as ark client factory args

* Fix

* Add constants for bitcoin/liquid explorer

* Fix test

* Fix wasm

* Rename client.Client to client.ASPClient

* Rename store.Store to store.ConfigStore

* Rename wallet.Wallet to wallet.WalletService

* Renamings

* Lint

* Fixes

* Move everything to internal/utils & move ComputeVtxoTaprootScript to common

* Go mod tidy
2024-07-30 16:08:23 +02:00

179 lines
3.8 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// V1Round v1 round
//
// swagger:model v1Round
type V1Round struct {
// congestion tree
CongestionTree *V1Tree `json:"congestionTree,omitempty"`
// connectors
Connectors []string `json:"connectors"`
// end
End string `json:"end,omitempty"`
// forfeit txs
ForfeitTxs []string `json:"forfeitTxs"`
// id
ID string `json:"id,omitempty"`
// pool tx
PoolTx string `json:"poolTx,omitempty"`
// stage
Stage *V1RoundStage `json:"stage,omitempty"`
// start
Start string `json:"start,omitempty"`
}
// Validate validates this v1 round
func (m *V1Round) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCongestionTree(formats); err != nil {
res = append(res, err)
}
if err := m.validateStage(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V1Round) validateCongestionTree(formats strfmt.Registry) error {
if swag.IsZero(m.CongestionTree) { // not required
return nil
}
if m.CongestionTree != nil {
if err := m.CongestionTree.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("congestionTree")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("congestionTree")
}
return err
}
}
return nil
}
func (m *V1Round) validateStage(formats strfmt.Registry) error {
if swag.IsZero(m.Stage) { // not required
return nil
}
if m.Stage != nil {
if err := m.Stage.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("stage")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("stage")
}
return err
}
}
return nil
}
// ContextValidate validate this v1 round based on the context it is used
func (m *V1Round) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCongestionTree(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateStage(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V1Round) contextValidateCongestionTree(ctx context.Context, formats strfmt.Registry) error {
if m.CongestionTree != nil {
if swag.IsZero(m.CongestionTree) { // not required
return nil
}
if err := m.CongestionTree.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("congestionTree")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("congestionTree")
}
return err
}
}
return nil
}
func (m *V1Round) contextValidateStage(ctx context.Context, formats strfmt.Registry) error {
if m.Stage != nil {
if swag.IsZero(m.Stage) { // not required
return nil
}
if err := m.Stage.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("stage")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("stage")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *V1Round) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V1Round) UnmarshalBinary(b []byte) error {
var res V1Round
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}