@@ -454,7 +454,7 @@ impl GrapevineDB {
454
454
"localField" : "degree_proofs" ,
455
455
"foreignField" : "_id" ,
456
456
"as" : "userDegreeProofs" ,
457
- "pipeline" : [ doc! { "$project" : { "degree" : 1 , "phrase_hash " : 1 } } ]
457
+ "pipeline" : [ doc! { "$project" : { "degree" : 1 , "phrase " : 1 } } ]
458
458
}
459
459
} ,
460
460
// look up the relationships made by this user
@@ -477,7 +477,7 @@ impl GrapevineDB {
477
477
"as" : "relationshipDegreeProofs" ,
478
478
"pipeline" : [
479
479
doc! { "$match" : { "inactive" : { "$ne" : true } } } ,
480
- doc! { "$project" : { "degree" : 1 , "phrase_hash " : 1 } }
480
+ doc! { "$project" : { "degree" : 1 , "phrase " : 1 } }
481
481
]
482
482
}
483
483
} ,
@@ -487,7 +487,7 @@ impl GrapevineDB {
487
487
// find the lowest degree proof in each chain from relationship proofs and reference user proofs in this chain if exists
488
488
doc! {
489
489
"$group" : {
490
- "_id" : "$relationshipDegreeProofs.phrase_hash " ,
490
+ "_id" : "$relationshipDegreeProofs.phrase " ,
491
491
"originalId" : { "$first" : "$relationshipDegreeProofs._id" } ,
492
492
"degree" : { "$min" : "$relationshipDegreeProofs.degree" } ,
493
493
"userProof" : {
@@ -496,7 +496,7 @@ impl GrapevineDB {
496
496
"$filter" : {
497
497
"input" : "$userDegreeProofs" ,
498
498
"as" : "userProof" ,
499
- "cond" : { "$eq" : [ "$$userProof.phrase_hash " , "$relationshipDegreeProofs.phrase_hash " ] }
499
+ "cond" : { "$eq" : [ "$$userProof.phrase " , "$relationshipDegreeProofs.phrase " ] }
500
500
}
501
501
} , 0 ]
502
502
}
@@ -1173,29 +1173,6 @@ impl GrapevineDB {
1173
1173
}
1174
1174
}
1175
1175
1176
- /**
1177
- * Get chain of degree proofs linked to a phrase
1178
- *
1179
- * @param phrase_hash - hash of the phrase linking the proof chain together
1180
- */
1181
- pub async fn get_proof_chain ( & self , phrase_hash : & str ) -> Vec < DegreeProof > {
1182
- let mut proofs: Vec < DegreeProof > = vec ! [ ] ;
1183
- let query = doc ! { "phrase_hash" : phrase_hash } ;
1184
- let projection = doc ! { "_id" : 1 , "degree" : 1 } ;
1185
- let find_options = FindOptions :: builder ( ) . projection ( projection) . build ( ) ;
1186
- let mut cursor = self . degree_proofs . find ( query, find_options) . await . unwrap ( ) ;
1187
-
1188
- while let Some ( result) = cursor. next ( ) . await {
1189
- match result {
1190
- Ok ( proof) => {
1191
- proofs. push ( proof) ;
1192
- }
1193
- Err ( e) => println ! ( "Error: {:?}" , e) ,
1194
- }
1195
- }
1196
- proofs
1197
- }
1198
-
1199
1176
/**
1200
1177
* Check to see if degree already exists between two accounts
1201
1178
*
0 commit comments