Commit a080ec6 1 parent 53b8117 commit a080ec6 Copy full SHA for a080ec6
File tree 1 file changed +10
-6
lines changed
identity_iota_core/tests/e2e
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -213,12 +213,16 @@ async fn can_get_historical_identity_data() -> anyhow::Result<()> {
213
213
. collect :: < Result < Vec < bool > , identity_iota_core:: rebased:: Error > > ( ) ?;
214
214
assert_eq ! ( has_previous_version_responses, vec![ true , false ] ) ;
215
215
216
- // compare changes
217
- let documents: Vec < IotaDocument > = history
218
- . into_iter ( )
219
- . map ( |data| IotaDocument :: unpack_from_iota_object_data ( & did, & data, true ) )
220
- . collect :: < Result < _ , _ > > ( ) ?;
221
- assert_ne ! ( documents[ 0 ] . to_string( ) , documents[ 1 ] . to_string( ) ) ;
216
+ let versions: Vec < SequenceNumber > = history. iter ( ) . map ( |elem| elem. version ) . collect ( ) ;
217
+ let version_numbers: Vec < usize > = versions. iter ( ) . map ( |v| ( * v) . into ( ) ) . collect ( ) ;
218
+
219
+ // Check that we have 2 versions (original and updated)
220
+ assert_eq ! ( version_numbers. len( ) , 2 ) ;
221
+ // Check that versions are in descending order (newest to oldest)
222
+ assert ! (
223
+ version_numbers[ 0 ] > version_numbers[ 1 ] ,
224
+ "versions should be in descending order"
225
+ ) ;
222
226
223
227
// paging:
224
228
// you can either loop until no result is returned
You can’t perform that action at this time.
0 commit comments