this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

testing: additional (failing) signature test

+57 -2
testing/divy.repo testing/test_files/divy.repo
testing/repo_slice.car testing/test_files/repo_slice.car
+1 -1
testing/repo_slice_test.go
··· 17 17 18 18 func TestRepoSliceParse(t *testing.T) { 19 19 ctx := context.TODO() 20 - fi, err := os.Open("repo_slice.car") 20 + fi, err := os.Open("test_files/repo_slice.car") 21 21 if err != nil { 22 22 t.Fatal(err) 23 23 }
+56 -1
testing/sig_test.go
··· 22 22 func TestVerification(t *testing.T) { 23 23 assert := assert.New(t) 24 24 25 - fi, err := os.Open("divy.repo") 25 + fi, err := os.Open("test_files/divy.repo") 26 26 if err != nil { 27 27 t.Fatal(err) 28 28 } ··· 44 44 "type": "EcdsaSecp256k1VerificationKey2019", 45 45 "controller": "did:plc:wj5jny4sq4sohwoaxjkjgug6", 46 46 "publicKeyMultibase": "zQYEBzXeuTM9UR3rfvNag6L3RNAs5pQZyYPsomTsgQhsxLdEgCrPTLgFna8yqCnxPpNT7DBk6Ym3dgPKNu86vt9GR" 47 + }` 48 + var vm did.VerificationMethod 49 + 50 + if err := json.Unmarshal([]byte(vmstr), &vm); err != nil { 51 + t.Fatal(err) 52 + } 53 + 54 + pk, err := did.KeyFromMultibase(vm) 55 + if err != nil { 56 + t.Fatal(err) 57 + } 58 + 59 + assert.Equal(pk.Type, "EcdsaSecp256k1VerificationKey2019") 60 + 61 + scom := r.SignedCommit() 62 + 63 + msg, err := scom.Unsigned().BytesForSigning() 64 + if err != nil { 65 + t.Fatal(err) 66 + } 67 + 68 + if err := pk.Verify(msg, scom.Sig); err != nil { 69 + t.Fatal(err) 70 + } 71 + } 72 + 73 + func TestVerificationTwo(t *testing.T) { 74 + t.Skip("XXX: this test is failing!") 75 + assert := assert.New(t) 76 + 77 + // http get http://localhost:2583/xrpc/com.atproto.sync.getCheckout did==did:plc:z5vnbioquyhivxirw3bbljmu commit==bafyreieovfuizojpw3zresz7sx3nk4trm2by23pt5rxbey3jme4uo5ogiu > bafyreieovfuizojpw3zresz7sx3nk4trm2by23pt5rxbey3jme4uo5ogiu.car 78 + // http get http://localhost:2582/did:plc:z5vnbioquyhivxirw3bbljmu > code/indigo/testing/test_files/did_plc_z5vnbioquyhivxirw3bbljmu.didDoc.json 79 + 80 + fi, err := os.Open("test_files/bafyreieovfuizojpw3zresz7sx3nk4trm2by23pt5rxbey3jme4uo5ogiu.car") 81 + if err != nil { 82 + t.Fatal(err) 83 + } 84 + 85 + bs := blockstore.NewBlockstore(datastore.NewMapDatastore()) 86 + ctx := context.TODO() 87 + c, err := repo.IngestRepo(ctx, bs, fi) 88 + if err != nil { 89 + t.Fatal(err) 90 + } 91 + 92 + r, err := repo.OpenRepo(ctx, bs, c, true) 93 + if err != nil { 94 + t.Fatal(err) 95 + } 96 + 97 + vmstr := `{ 98 + "controller": "did:plc:z5vnbioquyhivxirw3bbljmu", 99 + "id": "#atproto", 100 + "publicKeyMultibase": "zPgFC4hKo2MFLkBRQuHewXRDp94MSrd3yuiJ1En87qTeF68T92DPWvWSjxjMuMiB4qz8UzE8wWTNvZq7mgr7BsjW9", 101 + "type": "EcdsaSecp256k1VerificationKey2019" 47 102 }` 48 103 var vm did.VerificationMethod 49 104
testing/test_files/bafyreieovfuizojpw3zresz7sx3nk4trm2by23pt5rxbey3jme4uo5ogiu.car

This is a binary file and will not be displayed.