fix e2e
add support for supports (heh)
This commit is contained in:
parent
e98061f2eb
commit
577411cf50
3 changed files with 27 additions and 8 deletions
10
e2e/e2e.sh
10
e2e/e2e.sh
|
@ -54,11 +54,13 @@ echo "successfully started..."
|
|||
./../bin/ytsync --channelID UCCyr5j8akeu9j4Q7urV0Lqw #Force channel intended...just in case. This channel lines up with the api container
|
||||
status=$(mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e 'SELECT status FROM youtube_data WHERE id=1')
|
||||
videoStatus=$(mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e 'SELECT status FROM synced_video WHERE id=1')
|
||||
videoClaimID =$(mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e 'SELECT claim_id FROM synced_video WHERE id=1')
|
||||
videoClaimID=$(mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e 'SELECT claim_id FROM synced_video WHERE id=1')
|
||||
# Create Supports for published claim
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","${videoClaimID}",1.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","${videoClaimID}",2.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","${videoClaimID}",3.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","'${videoClaimID}'",1.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","'${videoClaimID}'",2.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","'${videoClaimID}'",3.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"supportclaim","params":["@BeamerTest","'${videoClaimID}'",3.0]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"generate","params":[1]}' -H 'content-type:text/plain;' --user lbry:lbry http://localhost:15200
|
||||
# Reset status for tranfer test
|
||||
mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e "UPDATE youtube_data SET status = 'queued' WHERE id = 1"
|
||||
# Trigger transfer api
|
||||
|
|
|
@ -44,14 +44,23 @@ func abandonSupports(s *Sync) error {
|
|||
allSupports = append(allSupports, (*supports).Items...)
|
||||
totalPages = (*supports).TotalPages
|
||||
}
|
||||
alreadyAbandoned := make(map[string]bool, len(allSupports))
|
||||
for _, support := range allSupports {
|
||||
_, ok := alreadyAbandoned[support.ClaimID]
|
||||
if ok {
|
||||
continue
|
||||
}
|
||||
alreadyAbandoned[support.ClaimID] = true
|
||||
summary, err := s.daemon.SupportAbandon(&support.ClaimID, nil, nil, nil, nil)
|
||||
if err != nil {
|
||||
return errors.Err(err)
|
||||
}
|
||||
log.Infof("Abandoned support of %s (%s total output) LBC for claim %s", support.Amount, summary.Outputs[0].Amount, support.ClaimID)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func transferVideos(s *Sync) error {
|
||||
err := waitConfirmations(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cleanTransfer := true
|
||||
for _, video := range s.syncedVideos {
|
||||
if !video.Published || video.Transferred || video.MetadataVersion != LatestMetadataVersion {
|
||||
|
|
|
@ -316,6 +316,14 @@ func (s *Sync) FullCycle() (e error) {
|
|||
}
|
||||
|
||||
if s.shouldTransfer() {
|
||||
err := waitConfirmations(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = abandonSupports(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = transferVideos(s)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue