@@ -61,25 +61,15 @@ describe('ExtrinsicSignatureV4', (): void => {
6161 registry . setMetadata ( metadata ) ;
6262
6363 expect (
64- new ExtrinsicSignature ( registry ) . signFake (
64+ ( ) => new ExtrinsicSignature ( registry ) . signFake (
6565 registry . createType ( 'Call' ) ,
6666 pairs . alice . publicKey ,
6767 signOptions
6868 ) . toHex ( )
69- ) . toEqual (
70- '0x' +
71- '00' + // MultiAddress
72- 'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
73- '01' +
74- '0101010101010101010101010101010101010101010101010101010101010101' +
75- '0101010101010101010101010101010101010101010101010101010101010101' +
76- '00' + // TransactionExtension version
77- '00a5010000' +
78- '00' // Mode
79- ) ;
69+ ) . toThrow ( 'Extrinsic: ExtrinsicV5 does not include signing support' ) ;
8070 } ) ;
8171
82- it ( 'fake signs default (AccountId address) ' , ( ) : void => {
72+ it ( 'Errors on fake sign ' , ( ) : void => {
8373 const registry = new TypeRegistry ( ) ;
8474 const metadata = new Metadata ( registry , metadataStatic ) ;
8575
@@ -90,76 +80,26 @@ describe('ExtrinsicSignatureV4', (): void => {
9080 } ) ;
9181
9282 expect (
93- new ExtrinsicSignature ( registry ) . signFake (
83+ ( ) => new ExtrinsicSignature ( registry ) . signFake (
9484 registry . createType ( 'Call' ) ,
9585 pairs . alice . address ,
9686 signOptions
9787 ) . toHex ( )
98- ) . toEqual (
99- '0x' +
100- // Address = AccountId, no prefix
101- 'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
102- // This is a prefix-less signature, anySignture as opposed to Multi above
103- '0101010101010101010101010101010101010101010101010101010101010101' +
104- '0101010101010101010101010101010101010101010101010101010101010101' +
105- '00' + // TransactionExtension version
106- '00a5010000' +
107- '00' // mode
108- ) ;
88+ ) . toThrow ( 'Extrinsic: ExtrinsicV5 does not include signing support' ) ;
10989 } ) ;
11090
111- it ( 'fake signs with non-enum signature' , ( ) : void => {
112- const registry = new TypeRegistry ( ) ;
113- const metadata = new Metadata ( registry , metadataStatic ) ;
114-
115- registry . setMetadata ( metadata ) ;
116- registry . register ( {
117- Address : 'AccountId' ,
118- ExtrinsicSignature : '[u8;65]'
119- } ) ;
120-
121- expect (
122- new ExtrinsicSignature ( registry ) . signFake (
123- registry . createType ( 'Call' ) ,
124- pairs . alice . address ,
125- signOptions
126- ) . toHex ( )
127- ) . toEqual (
128- '0x' +
129- // Address = AccountId, no prefix
130- 'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
131- // 65 bytes here
132- '01' +
133- '0101010101010101010101010101010101010101010101010101010101010101' +
134- '0101010101010101010101010101010101010101010101010101010101010101' +
135- '00' + // TransactionExtension version
136- '00a5010000' +
137- '00' // mode
138- ) ;
139- } ) ;
140-
141- it ( 'injects a signature' , ( ) : void => {
91+ it ( 'Errors on injecting a signature' , ( ) : void => {
14292 const registry = new TypeRegistry ( ) ;
14393 const metadata = new Metadata ( registry , metadataStatic ) ;
14494
14595 registry . setMetadata ( metadata ) ;
14696
14797 expect (
148- new ExtrinsicSignature ( registry ) . addSignature (
98+ ( ) => new ExtrinsicSignature ( registry ) . addSignature (
14999 pairs . alice . publicKey ,
150100 new Uint8Array ( 65 ) . fill ( 1 ) ,
151101 new Uint8Array ( 0 )
152102 ) . toHex ( )
153- ) . toEqual (
154- '0x' +
155- '00' + // MultiAddress
156- 'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
157- '01' +
158- '0101010101010101010101010101010101010101010101010101010101010101' +
159- '0101010101010101010101010101010101010101010101010101010101010101' +
160- '00' + // TransactionExtension version
161- '00000000' +
162- '00' // mode
163- ) ;
103+ ) . toThrow ( 'Extrinsic: ExtrinsicV5 does not include signing support' ) ;
164104 } ) ;
165105} ) ;
0 commit comments