@@ -147,35 +147,38 @@ describe('Program Manager', () => {
147147
148148 it ( 'Should build correct authorizations when using the unchecked version' , async ( ) => {
149149 // Build an authorization for the spin function of "puzzle_spinner_v002.aleo".
150- const authorization = await programManager . buildAuthorizationUnchecked ( {
151- programName : PUZZLE_SPINNER_PROGRAM_ID ,
152- functionName : "spin" ,
153- inputs : [
154- PUZZLE_SPINNER_V002_INPUT_0 ,
155- PUZZLE_SPINNER_V002_INPUT_1 ,
156- PUZZLE_SPINNER_V002_INPUT_2 ,
157- ] ,
158- privateKey : PrivateKey . from_string ( < string > process . env [ "PUZZLE_PK" ] )
159- } ) ;
160-
161- // Ensure serialization methods lead to the expected.
162- const authorizationFromString = Authorization . fromString ( authorization . toString ( ) ) ;
163- const authorizationFromBytes = Authorization . fromBytesLe ( authorization . toBytesLe ( ) ) ;
164-
165- // Ensure all authorizations are equal.
166- expect ( authorizationFromString . equals ( authorizationFromBytes ) ) ;
167- expect ( authorizationFromString . equals ( authorization ) ) ;
168-
169- // Get execution ID from previous authorization.
170- const executionId = authorization . toExecutionId ( ) . toString ( ) ;
171- const feeAuthorization = await programManager . buildFeeAuthorization ( {
172- deploymentOrExecutionId : executionId ,
173- baseFeeCredits : 0.1 ,
174- } ) ;
150+ if ( network === "mainnet" ) {
151+ const authorization = await programManager . buildAuthorizationUnchecked ( {
152+ programName : PUZZLE_SPINNER_PROGRAM_ID ,
153+ functionName : "spin" ,
154+ inputs : [
155+ PUZZLE_SPINNER_V002_INPUT_0 ,
156+ PUZZLE_SPINNER_V002_INPUT_1 ,
157+ PUZZLE_SPINNER_V002_INPUT_2 ,
158+ ] ,
159+ privateKey : PrivateKey . from_string ( < string > process . env [ "PUZZLE_PK" ] )
160+ } ) ;
161+
162+ // Ensure serialization methods lead to the expected.
163+ const authorizationFromString = Authorization . fromString ( authorization . toString ( ) ) ;
164+ const authorizationFromBytes = Authorization . fromBytesLe ( authorization . toBytesLe ( ) ) ;
165+
166+ // Ensure all authorizations are equal.
167+ expect ( authorizationFromString . equals ( authorizationFromBytes ) ) ;
168+ expect ( authorizationFromString . equals ( authorization ) ) ;
169+
170+ // Get execution ID from previous authorization.
171+ const executionId = authorization . toExecutionId ( ) . toString ( ) ;
172+ const feeAuthorization = await programManager . buildFeeAuthorization ( {
173+ deploymentOrExecutionId : executionId ,
174+ baseFeeCredits : 0.1 ,
175+ } ) ;
176+
177+ // Ensure the authorizations have the correct number of transitions.
178+ expect ( authorization . transitions ( ) . length ) . equal ( 3 ) ;
179+ expect ( feeAuthorization . transitions ( ) . length ) . equal ( 1 ) ;
180+ }
175181
176- // Ensure the authorizations have the correct number of transitions.
177- expect ( authorization . transitions ( ) . length ) . equal ( 3 ) ;
178- expect ( feeAuthorization . transitions ( ) . length ) . equal ( 1 ) ;
179182 } ) ;
180183 } ) ;
181184} ) ;
0 commit comments