From 8d56ef852f2256263826181005d5c44730614d60 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 25 Sep 2019 03:30:07 +0200 Subject: [PATCH] fix e2e fix database transferred flag --- e2e/e2e.sh | 2 +- manager/ytsync.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/e2e.sh b/e2e/e2e.sh index 54fe6a2..6208818 100755 --- a/e2e/e2e.sh +++ b/e2e/e2e.sh @@ -67,7 +67,7 @@ curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"generate","params # 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 -curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://localhost:15400/yt/transfer?auth_token=youtubertoken&address=n1Ygra2pyD6cpESv9GtPM9kDkr4bPeu1Dc&public_key=xpub69mdgvyDG2wc9YgFkpBUuArjeqLkmMTzhHuMTzTDuYAtQevUh4h8EVQv7frusFheUrFkW5xCbpWMShBj67Q2o4Zx45PWtPE1572eQ5z5ift' +curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://localhost:15400/yt/transfer?auth_token=youtubertoken&address=n4eYeXAYmHo4YRUDEfsEhucy8y5LKRMcHg&public_key=tpubDA9GDAntyJu4hD3wU7175p7CuV6DWbYXfyb2HedBA3yuBp9HZ4n3QE4Ex6RHCSiEuVp2nKAL1Lzf2ZLo9ApaFgNaJjG6Xo1wB3iEeVbrDZp' # Execute the transfer test! ./../bin/ytsync --channelID UCCyr5j8akeu9j4Q7urV0Lqw #Force channel intended...just in case. This channel lines up with the api container # Check that the channel and the video are marked as transferred and that all supports are spent diff --git a/manager/ytsync.go b/manager/ytsync.go index f4147cb..723d02c 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -564,6 +564,7 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim) (total, fixed, removed int ClaimName: c.Name, Size: util.PtrToInt64(int64(claimSize)), MetaDataVersion: claimMetadataVersion, + IsTransferred: util.PtrToBool(s.publishAddress == c.Address), }) if err != nil { return count, fixed, 0, err @@ -1070,7 +1071,7 @@ func (s *Sync) importPublicKey() error { return nil } } - log.Infof("Could not find public key %s in the wallet. Importing it...") + log.Infof("Could not find public key %s in the wallet. Importing it...", s.publicKey) _, err = s.daemon.AccountAdd(s.LbryChannelName, nil, nil, &s.publicKey, util.PtrToBool(true), nil) return errors.Err(err) }