this repo has no description
0
fork

Configure Feed

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

tests: more CAR-based examples, including a fail

Commented out the failing example (a feed post). Will refine that to a
smaller test case in a separate PR.

+19 -2
+17 -2
testing/car_did_repro_test.go
··· 3 3 import ( 4 4 "bytes" 5 5 "context" 6 + "encoding/hex" 6 7 "encoding/json" 7 8 "fmt" 8 9 "os" ··· 108 109 cidBuilder := cid.V1Builder{0x71, 0x12, 0} 109 110 recordCBOR := new(bytes.Buffer) 110 111 nsid := strings.SplitN(path, "/", 2)[0] 112 + 111 113 // TODO: refactor this to be short+generic 112 114 switch nsid { 113 115 case "app.bsky.feed.post": 114 116 var recordRepro appbsky.FeedPost 115 117 recordOrig, suc := rec.(*appbsky.FeedPost) 116 - 117 118 assert.Equal(true, suc) 118 119 recordJSON, err := json.Marshal(recordOrig) 119 120 assert.NoError(err) ··· 122 123 assert.NoError(recordRepro.MarshalCBOR(recordCBOR)) 123 124 reproCID, err := cidBuilder.Sum(recordCBOR.Bytes()) 124 125 assert.NoError(err) 126 + if c.String() != reproCID.String() { 127 + fmt.Println(string(recordJSON)) 128 + fmt.Println(hex.EncodeToString(recordCBOR.Bytes())) 129 + recordBytes := new(bytes.Buffer) 130 + assert.NoError(rec.MarshalCBOR(recordBytes)) 131 + fmt.Println(hex.EncodeToString(recordBytes.Bytes())) 132 + } 125 133 assert.Equal(c.String(), reproCID.String()) 126 134 case "app.bsky.actor.profile": 127 135 var recordRepro appbsky.ActorProfile ··· 187 195 // http get https://plc.directory/did:plc:wqgdnqlv2mwiio6pfchwtrff > greenground.didDoc.json 188 196 // http get https://bsky.social/xrpc/com.atproto.sync.getRepo did==did:plc:wqgdnqlv2mwiio6pfchwtrff > greenground.repo.car 189 197 190 - //deepReproduceRepo(t, "test_files/bafyreieovfuizojpw3zresz7sx3nk4trm2by23pt5rxbey3jme4uo5ogiu.car", "test_files/did_plc_z5vnbioquyhivxirw3bbljmu.didDoc.json") 198 + // to fetch from local dev: 199 + // http get localhost:2582/did:plc:dpg45vsnuir2vqqqadsn6afg > fakermaker.didDoc.json 200 + // http get localhost:2583/xrpc/com.atproto.sync.getRepo did==did:plc:dpg45vsnuir2vqqqadsn6afg > fakermaker.repo.car 201 + 191 202 deepReproduceRepo(t, "test_files/greenground.repo.car", "test_files/greenground.didDoc.json") 203 + deepReproduceRepo(t, "test_files/fakermaker.repo.car", "test_files/fakermaker.didDoc.json") 204 + 205 + // XXX: currently failing 206 + //deepReproduceRepo(t, "test_files/paul_staging.repo.car", "test_files/paul_staging.didDoc.json") 192 207 }
+1
testing/test_files/fakermaker.didDoc.json
··· 1 + {"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/ecdsa-2019/v1"],"id":"did:plc:dpg45vsnuir2vqqqadsn6afg","alsoKnownAs":["at://ebert9014-89.test"],"verificationMethod":[{"id":"#atproto","type":"EcdsaSecp256r1VerificationKey2019","controller":"did:plc:dpg45vsnuir2vqqqadsn6afg","publicKeyMultibase":"zNMqQUvfLpsD4DMAg1TzzB1SnBBe8unWUcy1DJ6qjY8hLgdriSFkfv781S68StfVxPMWoiJeEKfTJc183WsKZithS"}],"service":[{"id":"#atproto_pds","type":"AtprotoPersonalDataServer","serviceEndpoint":"http://localhost:2583"}]}
testing/test_files/fakermaker.repo.car

This is a binary file and will not be displayed.

+1
testing/test_files/paul_staging.didDoc.json
··· 1 + {"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/secp256k1-2019/v1"],"id":"did:plc:cmpvykrzb2l22kj4ojlv3ox4","alsoKnownAs":["at://paul.staging.bsky.dev"],"verificationMethod":[{"id":"#atproto","type":"EcdsaSecp256k1VerificationKey2019","controller":"did:plc:cmpvykrzb2l22kj4ojlv3ox4","publicKeyMultibase":"zRUTFuPmtaLAcwxS8GGhyTy2y9CmbNLRJtvqNuYXZ5SCU2hRvsJHpiZzDWafLhBx6YiN2NEE7QHen1pokhd7Ptsnb"}],"service":[{"id":"#atproto_pds","type":"AtprotoPersonalDataServer","serviceEndpoint":"https://pds.staging.bsky.dev"}]}
testing/test_files/paul_staging.repo.car

This is a binary file and will not be displayed.