Skip to content

Commit 33071ff

Browse files
committed
Add test for wallet-less ChannelImport call
1 parent 30a9a39 commit 33071ff

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

extras/jsonrpc/daemon_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,40 @@ func TestClient_ChannelExport(t *testing.T) {
519519
func TestClient_ChannelImport(t *testing.T) {
520520
d := NewClient("")
521521

522+
// A channel created just for automated testing purposes
523+
channelName := "@LbryAutomatedTestChannel"
524+
channelkey := "7943FWPBHZES4dUcMXSpDYwoM5a2tsyJT1R8V54QoUhekGcqmeH3hbzDXoLLQ8" +
525+
"oKkfb99PgGK5efrZeYqaxg4X5XRJMJ6gKC8hqKcnwhYkmKDXmoBDNgd2ccZ9jhP8z" +
526+
"HG3NJorAN9Hh4XMyBc5goBLZYYvC9MYvBmT3Fcteb5saqMvmQxFURv74NqXLQZC1t" +
527+
"p6iRZKfTj77Pd5gsBsCYAbVmCqzbm5m1hHkUmfFEZVGcQNTYCDwZn543xSMYvSPnJ" +
528+
"zt8tRYCJWaPdj713uENZZMo3gxuAMb1NwSnx8tbwETp7WPkpFLL6HZ9jKpB8BURHM" +
529+
"F1RFD1PRyqbC6YezPyPQ2oninKKHdBduvXZG5KF2G2Q3ixsuE2ntifBBo1f5PotRk" +
530+
"UanXKEafWxvXAayJjpsmZ4bFt7n6Xg4438WZXBiZKCPobLJAiHfe72n618kE6PCNU" +
531+
"77cyU5Rk8J3CuY6QzZPzwuiXz2GLfkUMCYd9jGT6g53XbE6SwCsmGnd9NJkBAaJf5" +
532+
"1FAYRURrhHnp79PAoHftEWtZEuU8MCPMdSRjzxYMRS4ScUzg5viDMTAkE8frsfCVZ" +
533+
"hxsFwGUyNNno8eiqrrYmpbJGEwwK3S4437JboAUEFPdMNn8zNQWZcLLVrK9KyQeKM" +
534+
"XpKkf4zJV6sZJ7gBMpzvPL18ULEgXTy7VsNBKmsfC1rM4WVG9ri1UixEcLDS79foC" +
535+
"Jb3FnSr1T4MRKESeN3W"
536+
response, err := d.ChannelImport(channelkey, nil)
537+
if err != nil {
538+
t.Error(err)
539+
}
540+
channels, err := d.ChannelList(nil, 1, 50, nil)
541+
seen := false
542+
for _, c := range channels.Items {
543+
if c.Name == channelName {
544+
seen = true
545+
}
546+
}
547+
if !seen {
548+
t.Error("couldn't find imported channel")
549+
}
550+
t.Log("Response:", *response)
551+
}
552+
553+
func TestClient_ChannelImportWithWalletID(t *testing.T) {
554+
d := NewClient("")
555+
522556
id := "lbry#wallet#id:" + fmt.Sprintf("%d", rand.Int())
523557
wallet, err := d.WalletCreate(id, nil)
524558

0 commit comments

Comments
 (0)