@@ -82,23 +82,49 @@ export function dataModelSuite({
82
82
async function ( ) {
83
83
this . test . link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=of%20Controller%20Documents%201.0.-,Any%20other%20encoding%20MUST%20NOT%20be%20allowed.,-Developers%20are%20advised%20to%20not' ;
84
84
assertBefore ( ) ;
85
+ for ( const proof of proofs ) {
86
+ expect ( proof . verificationMethod ) . to . exist ;
87
+ expect ( proof . verificationMethod ) . to . be . a ( 'string' ) ;
88
+ expect (
89
+ assertions . shouldBeBs58 ( proof . verificationMethod ) ,
90
+ 'Expected "proof.verificationMethod" to be Base58 encoded'
91
+ ) . to . be . true ;
92
+ }
85
93
} ) ;
86
94
it ( 'The type property MUST be DataIntegrityProof.' , async function ( ) {
87
95
this . test . link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=The%20type%20property%20MUST%20be%20DataIntegrityProof.' ;
88
96
assertBefore ( ) ;
97
+ for ( const proof of proofs ) {
98
+ expect ( proof . type ) . to . exist ;
99
+ expect ( proof . type ) . to . be . a ( 'string' ) ;
100
+ expect ( proof . type ) . to . equal ( 'DataIntegrityProof' ) ;
101
+ }
89
102
} ) ;
90
103
it ( 'The cryptosuite property of the proof MUST be eddsa-rdfc-2022 or ' +
91
104
'eddsa-jcs-2022.' , async function ( ) {
92
105
this . test . link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=The%20cryptosuite%20property%20of%20the%20proof%20MUST%20be%20eddsa%2Drdfc%2D2022%20or%20eddsa%2Djcs%2D2022.' ;
93
106
assertBefore ( ) ;
107
+ for ( const proof of proofs ) {
108
+ expect ( proof . cryptosuite ) . to . exist ;
109
+ expect ( proof . cryptosuite ) . to . be . a ( 'string' ) ;
110
+ expect ( proof . cryptosuite ) . to . oneOf (
111
+ [ 'eddsa-rdfc-2022' , 'eddsa-jcs-2022' ] ) ;
112
+ }
94
113
} ) ;
95
114
it ( 'The proofValue property of the proof MUST be a detached EdDSA ' +
96
115
'signature produced according to [RFC8032], encoded using the ' +
97
116
'base-58-btc header and alphabet as described in the Multibase ' +
98
117
'section of Controller Documents 1.0.' , async function ( ) {
99
118
this . test . link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=The%20proofValue%20property%20of%20the%20proof%20MUST%20be%20a%20detached%20EdDSA%20signature%20produced%20according%20to%20%5BRFC8032%5D%2C%20encoded%20using%20the%20base%2D58%2Dbtc%20header%20and%20alphabet%20as%20described%20in%20the%20Multibase%20section%20of%20Controller%20Documents%201.0.' ;
100
119
assertBefore ( ) ;
101
-
120
+ for ( const proof of proofs ) {
121
+ expect ( proof . proofValue ) . to . exist ;
122
+ expect ( proof . proofValue ) . to . be . a ( 'string' ) ;
123
+ expect (
124
+ assertions . shouldBeBs58 ( proof . proofValue ) ,
125
+ 'Expected "proof.proofValue" to be Base58 encoded'
126
+ ) . to . be . true ;
127
+ }
102
128
} ) ;
103
129
} ) ;
104
130
}
0 commit comments