reinstate claim type

fix bug

adjust types

add temporary video_duration until the SDK patches it
This commit is contained in:
Niko Storni 2019-04-18 13:07:47 -04:00
parent 3d2986a85c
commit f827da4c61
No known key found for this signature in database
GPG key ID: F37FE63398800368
3 changed files with 33 additions and 36 deletions

View file

@ -238,8 +238,8 @@ type ChannelCreateOptions struct {
CoverURL *string `json:"cover_url,omitempty"` CoverURL *string `json:"cover_url,omitempty"`
} }
func (d *Client) ChannelCreate(name string, bid float64, options ChannelCreateOptions) (*PublishResponse, error) { func (d *Client) ChannelCreate(name string, bid float64, options ChannelCreateOptions) (*TransactionSummary, error) {
response := new(PublishResponse) response := new(TransactionSummary)
args := struct { args := struct {
Name string `json:"name"` Name string `json:"name"`
Bid string `json:"bid"` Bid string `json:"bid"`
@ -261,12 +261,13 @@ type StreamCreateOptions struct {
License *string `json:"license,omitempty"` License *string `json:"license,omitempty"`
LicenseURL *string `json:"license_url,omitempty"` LicenseURL *string `json:"license_url,omitempty"`
StreamType *streamType `json:"stream_type,omitempty"` StreamType *streamType `json:"stream_type,omitempty"`
ReleaseTime *int `json:"release_time,omitempty"` ReleaseTime *int64 `json:"release_time,omitempty"`
Duration *int `json:"duration,omitempty"` Duration *uint64 `json:"duration,omitempty"`
ImageWidth *int `json:"image_width,omitempty"` VideoDuration *uint64 `json:"video_duration,omitempty"` //TODO: this shouldn't exist
ImageHeight *int `json:"image_height,omitempty"` ImageWidth *uint `json:"image_width,omitempty"`
VideoWidth *int `json:"video_width,omitempty"` ImageHeight *uint `json:"image_height,omitempty"`
VideoHeight *int `json:"video_height,omitempty"` VideoWidth *uint `json:"video_width,omitempty"`
VideoHeight *uint `json:"video_height,omitempty"`
Preview *string `json:"preview,omitempty"` Preview *string `json:"preview,omitempty"`
AllowDuplicateName *bool `json:"allow_duplicate_name,omitempty"` AllowDuplicateName *bool `json:"allow_duplicate_name,omitempty"`
ChannelName *string `json:"channel_name,omitempty"` ChannelName *string `json:"channel_name,omitempty"`

View file

@ -150,8 +150,8 @@ func TestClient_ChannelAbandon(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
txID := channelResponse.Output.Txid txID := channelResponse.Outputs[0].Txid
nout := channelResponse.Output.Nout nout := channelResponse.Outputs[0].Nout
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
got, err := d.ChannelAbandon(txID, nout, nil, false) got, err := d.ChannelAbandon(txID, nout, nil, false)
if err != nil { if err != nil {

View file

@ -262,34 +262,30 @@ type Support struct {
} }
type Claim struct { type Claim struct {
Address string `json:"address"` Address string `json:"address"`
Amount string `json:"amount"` Amount string `json:"amount"`
ChannelName *string `json:"channel_name,omitempty"` ChannelName *string `json:"channel_name,omitempty"`
ClaimID string `json:"claim_id"` ClaimID string `json:"claim_id"`
ClaimSequence int64 `json:"claim_sequence"` ClaimSequence int64 `json:"claim_sequence"`
DecodedClaim bool `json:"decoded_claim"` DecodedClaim bool `json:"decoded_claim"`
Depth int64 `json:"depth"` Depth int64 `json:"depth"`
EffectiveAmount string `json:"effective_amount"` EffectiveAmount string `json:"effective_amount"`
HasSignature *bool `json:"has_signature,omitempty"` HasSignature *bool `json:"has_signature,omitempty"`
Height int `json:"height"` Height int `json:"height"`
Hex string `json:"hex"` Hex string `json:"hex"`
Name string `json:"name"` Name string `json:"name"`
NormalizedName string `json:"normalized_name"` NormalizedName string `json:"normalized_name"`
Nout uint64 `json:"nout"` Nout uint64 `json:"nout"`
PermanentUrl string `json:"permanent_url"` PermanentUrl string `json:"permanent_url"`
SignatureIsValid *bool `json:"signature_is_valid,omitempty"` SignatureIsValid *bool `json:"signature_is_valid,omitempty"`
Supports []Support `json:"supports"` Supports []Support `json:"supports"`
Txid string `json:"txid"` Txid string `json:"txid"`
//Type string `json:"type"` Type string `json:"type"`
ValidAtHeight int `json:"valid_at_height"` ValidAtHeight int `json:"valid_at_height"`
Value lbryschema.Claim `json:"value"` Value lbryschema.Claim `json:"value"`
} }
type ClaimListResponse []Claim /* { type ClaimListResponse []Claim
Claims []Claim `json:"claims"`
LastTakeoverHeight int `json:"last_takeover_height"`
SupportsWithoutClaims []Support `json:"supports_without_claims"`
}*/
type ClaimListMineResponse struct { type ClaimListMineResponse struct {
Claims []Claim `json:"items"` Claims []Claim `json:"items"`