1
1
import { type ContractArtifact } from '@aztec/foundation/abi' ;
2
- import { loadContractArtifact } from '@aztec/types/abi' ;
3
- import type { NoirCompiledContract } from '@aztec/types/noir' ;
4
2
5
- import { readFileSync } from 'fs' ;
6
-
7
- import { getPathToFixture , getTestContractArtifact } from '../tests/fixtures.js' ;
3
+ import { getTestContractArtifact } from '../tests/fixtures.js' ;
8
4
import { computeArtifactHash } from './artifact_hash.js' ;
9
5
10
- const TEST_CONTRACT_ARTIFACT_HASH = `"0x19142676527045a118066698e292cc35db16ab4d7bd16610d35d2e1c607eb8b2"` ;
11
-
12
6
describe ( 'ArtifactHash' , ( ) => {
13
7
it ( 'calculates the artifact hash' , ( ) => {
14
8
const emptyArtifact : ContractArtifact = {
@@ -31,19 +25,8 @@ describe('ArtifactHash', () => {
31
25
const testArtifact = getTestContractArtifact ( ) ;
32
26
33
27
const calculatedArtifactHash = computeArtifactHash ( testArtifact ) . toString ( ) ;
34
- expect ( calculatedArtifactHash ) . toMatchInlineSnapshot ( TEST_CONTRACT_ARTIFACT_HASH ) ;
35
28
for ( let i = 0 ; i < 1000 ; i ++ ) {
36
29
expect ( computeArtifactHash ( testArtifact ) . toString ( ) ) . toBe ( calculatedArtifactHash ) ;
37
30
}
38
31
} ) ;
39
-
40
- it ( 'calculates the test contract artifact hash' , ( ) => {
41
- const path = getPathToFixture ( 'Test.test.json' ) ;
42
- const content = JSON . parse ( readFileSync ( path ) . toString ( ) ) as NoirCompiledContract ;
43
- content . outputs . structs . functions . reverse ( ) ;
44
-
45
- const testArtifact = loadContractArtifact ( content ) ;
46
-
47
- expect ( computeArtifactHash ( testArtifact ) . toString ( ) ) . toMatchInlineSnapshot ( TEST_CONTRACT_ARTIFACT_HASH ) ;
48
- } ) ;
49
32
} ) ;
0 commit comments