diff --git a/.github/workflows/golang-test.yml b/.github/workflows/golang-test.yml new file mode 100644 index 0000000..e5f3616 --- /dev/null +++ b/.github/workflows/golang-test.yml @@ -0,0 +1,45 @@ +name: Golang Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: Run Golang Tests + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ['1.22.5'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Install dependencies + working-directory: ./golang + run: go mod download + + - name: Copy config file + working-directory: ./golang + run: make copy-config + + - name: Run tests + working-directory: ./golang + run: make test + + - name: Run lint + working-directory: ./golang + run: | + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + make lint + + - name: Run all checks + working-directory: ./golang + run: make check diff --git a/.github/workflows/typescript-test.yml b/.github/workflows/typescript-test.yml new file mode 100644 index 0000000..5ac48fe --- /dev/null +++ b/.github/workflows/typescript-test.yml @@ -0,0 +1,40 @@ +name: TypeScript Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: Run TypeScript Tests + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.9.0 + + - name: Install dependencies + working-directory: ./typescript + run: pnpm install --frozen-lockfile + + - name: Build + working-directory: ./typescript + run: pnpm build + + - name: Run tests + working-directory: ./typescript + run: pnpm test diff --git a/configs/chain-config.json b/configs/chain-config.json index 65c10a5..08fcb1b 100644 --- a/configs/chain-config.json +++ b/configs/chain-config.json @@ -1,21 +1,11 @@ { "11155111": { "contracts": { - "atlas": { - "address": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482" - }, - "atlasVerification": { - "address": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3" - }, - "sorter": { - "address": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C" - }, - "simulator": { - "address": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0" - }, - "multicall3": { - "address": "0xcA11bde05977b3631167028862bE2a173976CA11" - } + "atlas": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482", + "atlasVerification": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3", + "sorter": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C", + "simulator": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "eip712Domain": { "name": "AtlasVerification", @@ -27,21 +17,11 @@ "137": { "contracts": { - "atlas": { - "address": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5" - }, - "atlasVerification": { - "address": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220" - }, - "sorter": { - "address": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f" - }, - "simulator": { - "address": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B" - }, - "multicall3": { - "address": "0xcA11bde05977b3631167028862bE2a173976CA11" - } + "atlas": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5", + "atlasVerification": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220", + "sorter": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f", + "simulator": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "eip712Domain": { "name": "AtlasVerification", @@ -50,24 +30,14 @@ "verifyingContract": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220" } }, - + "80002": { "contracts": { - "atlas": { - "address": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9" - }, - "atlasVerification": { - "address": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435" - }, - "sorter": { - "address": "0xa55051bd82eFeA1dD487875C84fE9c016859659B" - }, - "simulator": { - "address": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2" - }, - "multicall3": { - "address": "0xcA11bde05977b3631167028862bE2a173976CA11" - } + "atlas": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9", + "atlasVerification": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435", + "sorter": "0xa55051bd82eFeA1dD487875C84fE9c016859659B", + "simulator": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "eip712Domain": { "name": "AtlasVerification", @@ -75,5 +45,37 @@ "chainId": 80002, "verifyingContract": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435" } - } + }, + + "56": { + "contracts": { + "atlas": "0xD72D821dA82964c0546a5501347a3959808E072f", + "atlasVerification": "0xae631aCDC436b9Dfd75C5629F825330d91459445", + "sorter": "0xb47387995e866908B25b49e8BaC7e499170461A6", + "simulator": "0xAb665f032e6A20Ef7D43FfD4E92a2f4fd6d5771e", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" + }, + "eip712Domain": { + "name": "AtlasVerification", + "version": "1.0", + "chainId": 56, + "verifyingContract": "0xae631aCDC436b9Dfd75C5629F825330d91459445" + } + }, + + "97": { + "contracts": { + "atlas": "0x164d3f6Bd3e78220f59e33729aA0E473C57EB067", + "atlasVerification": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B", + "sorter": "0xc41EEF5317a0e477Fef550f792AF5b5Bb9e13b34", + "simulator": "0x91113eBDFD0c14BFAF48affD400800Bf851F6D11", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" + }, + "eip712Domain": { + "name": "AtlasVerification", + "version": "1.0", + "chainId": 97, + "verifyingContract": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B" + } + } } diff --git a/golang/config/atlas_config.go b/golang/config/atlas_config.go index da5a77e..bd0ee3a 100644 --- a/golang/config/atlas_config.go +++ b/golang/config/atlas_config.go @@ -15,16 +15,12 @@ import ( "github.com/ethereum/go-ethereum/signer/core/apitypes" ) -type ContractJSON struct { - Address string `json:"address"` -} - type ContractsJSON struct { - Atlas ContractJSON `json:"atlas"` - AtlasVerification ContractJSON `json:"atlasVerification"` - Sorter ContractJSON `json:"sorter"` - Simulator ContractJSON `json:"simulator"` - Multicall3 ContractJSON `json:"multicall3"` + Atlas string `json:"atlas"` + AtlasVerification string `json:"atlasVerification"` + Sorter string `json:"sorter"` + Simulator string `json:"simulator"` + Multicall3 string `json:"multicall3"` } type Contracts struct { @@ -84,11 +80,11 @@ func init() { for chainID, config := range chainConfigJSON { chainConfig[chainID] = ChainConfig{ Contracts: Contracts{ - Atlas: common.HexToAddress(config.Contracts.Atlas.Address), - AtlasVerification: common.HexToAddress(config.Contracts.AtlasVerification.Address), - Sorter: common.HexToAddress(config.Contracts.Sorter.Address), - Simulator: common.HexToAddress(config.Contracts.Simulator.Address), - Multicall3: common.HexToAddress(config.Contracts.Multicall3.Address), + Atlas: common.HexToAddress(config.Contracts.Atlas), + AtlasVerification: common.HexToAddress(config.Contracts.AtlasVerification), + Sorter: common.HexToAddress(config.Contracts.Sorter), + Simulator: common.HexToAddress(config.Contracts.Simulator), + Multicall3: common.HexToAddress(config.Contracts.Multicall3), }, EIP712Domain: config.EIP712Domain, } diff --git a/golang/config/chain-config.json b/golang/config/chain-config.json index 65c10a5..08fcb1b 100644 --- a/golang/config/chain-config.json +++ b/golang/config/chain-config.json @@ -1,21 +1,11 @@ { "11155111": { "contracts": { - "atlas": { - "address": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482" - }, - "atlasVerification": { - "address": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3" - }, - "sorter": { - "address": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C" - }, - "simulator": { - "address": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0" - }, - "multicall3": { - "address": "0xcA11bde05977b3631167028862bE2a173976CA11" - } + "atlas": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482", + "atlasVerification": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3", + "sorter": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C", + "simulator": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "eip712Domain": { "name": "AtlasVerification", @@ -27,21 +17,11 @@ "137": { "contracts": { - "atlas": { - "address": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5" - }, - "atlasVerification": { - "address": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220" - }, - "sorter": { - "address": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f" - }, - "simulator": { - "address": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B" - }, - "multicall3": { - "address": "0xcA11bde05977b3631167028862bE2a173976CA11" - } + "atlas": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5", + "atlasVerification": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220", + "sorter": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f", + "simulator": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "eip712Domain": { "name": "AtlasVerification", @@ -50,24 +30,14 @@ "verifyingContract": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220" } }, - + "80002": { "contracts": { - "atlas": { - "address": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9" - }, - "atlasVerification": { - "address": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435" - }, - "sorter": { - "address": "0xa55051bd82eFeA1dD487875C84fE9c016859659B" - }, - "simulator": { - "address": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2" - }, - "multicall3": { - "address": "0xcA11bde05977b3631167028862bE2a173976CA11" - } + "atlas": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9", + "atlasVerification": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435", + "sorter": "0xa55051bd82eFeA1dD487875C84fE9c016859659B", + "simulator": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "eip712Domain": { "name": "AtlasVerification", @@ -75,5 +45,37 @@ "chainId": 80002, "verifyingContract": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435" } - } + }, + + "56": { + "contracts": { + "atlas": "0xD72D821dA82964c0546a5501347a3959808E072f", + "atlasVerification": "0xae631aCDC436b9Dfd75C5629F825330d91459445", + "sorter": "0xb47387995e866908B25b49e8BaC7e499170461A6", + "simulator": "0xAb665f032e6A20Ef7D43FfD4E92a2f4fd6d5771e", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" + }, + "eip712Domain": { + "name": "AtlasVerification", + "version": "1.0", + "chainId": 56, + "verifyingContract": "0xae631aCDC436b9Dfd75C5629F825330d91459445" + } + }, + + "97": { + "contracts": { + "atlas": "0x164d3f6Bd3e78220f59e33729aA0E473C57EB067", + "atlasVerification": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B", + "sorter": "0xc41EEF5317a0e477Fef550f792AF5b5Bb9e13b34", + "simulator": "0x91113eBDFD0c14BFAF48affD400800Bf851F6D11", + "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11" + }, + "eip712Domain": { + "name": "AtlasVerification", + "version": "1.0", + "chainId": 97, + "verifyingContract": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B" + } + } } diff --git a/typescript/src/index.test.ts b/typescript/src/index.test.ts index 6af6c25..380f9c7 100644 --- a/typescript/src/index.test.ts +++ b/typescript/src/index.test.ts @@ -1,5 +1,6 @@ import { chainConfig, mergeChainConfigs } from './index'; import { ChainConfig } from './types'; +import { beforeEach, describe, expect, it } from '@jest/globals'; describe('mergeChainConfigs', () => { beforeEach(() => { @@ -7,11 +8,11 @@ describe('mergeChainConfigs', () => { (global as any).chainConfig = { '137': { contracts: { - atlas: { address: '0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5' }, - atlasVerification: { address: '0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220' }, - sorter: { address: '0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f' }, - simulator: { address: '0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B' }, - multicall3: { address: '0xcA11bde05977b3631167028862bE2a173976CA11' }, + atlas: '0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5', + atlasVerification: '0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220', + sorter: '0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f', + simulator: '0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B', + multicall3: '0xcA11bde05977b3631167028862bE2a173976CA11', }, eip712Domain: { name: 'AtlasVerification', @@ -27,23 +28,23 @@ describe('mergeChainConfigs', () => { const result = mergeChainConfigs({ '137': { contracts: { - atlasVerification: { address: '0x7000000000000000000000000000000000000000' }, + atlasVerification: '0x7000000000000000000000000000000000000000', }, }, }); - expect(result['137'].contracts.atlas.address).toBe('0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5'); - expect(result['137'].contracts.atlasVerification.address).toBe('0x7000000000000000000000000000000000000000'); + expect(result['137'].contracts.atlas).toBe('0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5'); + expect(result['137'].contracts.atlasVerification).toBe('0x7000000000000000000000000000000000000000'); }); it('should prioritize new complete config for existing chain', () => { const newConfig: ChainConfig = { contracts: { - atlas: { address: '0x3000000000000000000000000000000000000000' }, - atlasVerification: { address: '0x4000000000000000000000000000000000000000' }, - sorter: { address: '0x5000000000000000000000000000000000000000' }, - simulator: { address: '0x6000000000000000000000000000000000000000' }, - multicall3: { address: '0x7000000000000000000000000000000000000000' }, + atlas: '0x3000000000000000000000000000000000000000', + atlasVerification: '0x4000000000000000000000000000000000000000', + sorter: '0x5000000000000000000000000000000000000000', + simulator: '0x6000000000000000000000000000000000000000', + multicall3: '0x7000000000000000000000000000000000000000', }, eip712Domain: { name: 'New', @@ -61,11 +62,11 @@ describe('mergeChainConfigs', () => { it('should add new chain config', () => { const newConfig: ChainConfig = { contracts: { - atlas: { address: '0x9000000000000000000000000000000000000000' }, - atlasVerification: { address: '0xa000000000000000000000000000000000000000' }, - sorter: { address: '0xb000000000000000000000000000000000000000' }, - simulator: { address: '0xc000000000000000000000000000000000000000' }, - multicall3: { address: '0xd000000000000000000000000000000000000000' }, + atlas: '0x9000000000000000000000000000000000000000', + atlasVerification: '0xa000000000000000000000000000000000000000', + sorter: '0xb000000000000000000000000000000000000000', + simulator: '0xc000000000000000000000000000000000000000', + multicall3: '0xd000000000000000000000000000000000000000', }, eip712Domain: { name: 'New Chain', @@ -85,7 +86,7 @@ describe('mergeChainConfigs', () => { mergeChainConfigs({ '3': { contracts: { - atlas: { address: '0xf000000000000000000000000000000000000000' }, + atlas: '0xf000000000000000000000000000000000000000', }, } as ChainConfig, }); @@ -98,16 +99,16 @@ describe('mergeChainConfigs', () => { const providedConfigs = { [existingChainId]: { contracts: { - atlas: { address: '0x7000000000000000000000000000000000000000' } + atlas: '0x7000000000000000000000000000000000000000' } }, [newChainId]: { contracts: { - atlas: { address: '0x8000000000000000000000000000000000000000' }, - atlasVerification: { address: '0x9000000000000000000000000000000000000000' }, - sorter: { address: '0xa000000000000000000000000000000000000000' }, - simulator: { address: '0xb000000000000000000000000000000000000000' }, - multicall3: { address: '0xc000000000000000000000000000000000000000' } + atlas: '0x8000000000000000000000000000000000000000', + atlasVerification: '0x9000000000000000000000000000000000000000', + sorter: '0xa000000000000000000000000000000000000000', + simulator: '0xb000000000000000000000000000000000000000', + multicall3: '0xc000000000000000000000000000000000000000' }, eip712Domain: { name: 'New Chain', @@ -120,8 +121,8 @@ describe('mergeChainConfigs', () => { const mergedConfigs = mergeChainConfigs(providedConfigs); - expect(mergedConfigs[existingChainId].contracts.atlas.address).toBe('0x7000000000000000000000000000000000000000'); - expect(mergedConfigs[newChainId].contracts.atlas.address).toBe('0x8000000000000000000000000000000000000000'); + expect(mergedConfigs[existingChainId].contracts.atlas).toBe('0x7000000000000000000000000000000000000000'); + expect(mergedConfigs[newChainId].contracts.atlas).toBe('0x8000000000000000000000000000000000000000'); }); it('should not change anything when merging an empty config', () => { @@ -143,8 +144,8 @@ describe('mergeChainConfigs', () => { const providedConfig = { [existingChainId]: { contracts: { - atlas: { address: '0x7000000000000000000000000000000000000000' }, - sorter: { address: '0x8000000000000000000000000000000000000000' } + atlas: '0x7000000000000000000000000000000000000000', + sorter: '0x8000000000000000000000000000000000000000' }, eip712Domain: { name: 'Updated Chain', @@ -155,8 +156,8 @@ describe('mergeChainConfigs', () => { const mergedConfigs = mergeChainConfigs(providedConfig); - expect(mergedConfigs[existingChainId].contracts.atlas.address).toBe('0x7000000000000000000000000000000000000000'); - expect(mergedConfigs[existingChainId].contracts.sorter.address).toBe('0x8000000000000000000000000000000000000000'); + expect(mergedConfigs[existingChainId].contracts.atlas).toBe('0x7000000000000000000000000000000000000000'); + expect(mergedConfigs[existingChainId].contracts.sorter).toBe('0x8000000000000000000000000000000000000000'); expect(mergedConfigs[existingChainId].eip712Domain.name).toBe('Updated Chain'); expect(mergedConfigs[existingChainId].eip712Domain.version).toBe('2.0'); }); @@ -167,7 +168,7 @@ describe('mergeChainConfigs', () => { const providedConfig = { [existingChainId]: { contracts: { - atlas: { address: '0x7000000000000000000000000000000000000000' } + atlas: '0x7000000000000000000000000000000000000000' } } }; diff --git a/typescript/src/index.ts b/typescript/src/index.ts index add063f..31a602f 100644 --- a/typescript/src/index.ts +++ b/typescript/src/index.ts @@ -77,16 +77,11 @@ export function mergeChainConfigs(providedConfigs: { [chainId: string]: PartialC function isFullChainConfig(config: PartialChainConfig | ChainConfig): config is ChainConfig { return ( typeof config.contracts === 'object' && - typeof config.contracts.atlas === 'object' && - typeof config.contracts.atlas.address === 'string' && - typeof config.contracts.atlasVerification === 'object' && - typeof config.contracts.atlasVerification.address === 'string' && - typeof config.contracts.sorter === 'object' && - typeof config.contracts.sorter.address === 'string' && - typeof config.contracts.simulator === 'object' && - typeof config.contracts.simulator.address === 'string' && - typeof config.contracts.multicall3 === 'object' && - typeof config.contracts.multicall3.address === 'string' && + typeof config.contracts.atlas === 'string' && + typeof config.contracts.atlasVerification === 'string' && + typeof config.contracts.sorter === 'string' && + typeof config.contracts.simulator === 'string' && + typeof config.contracts.multicall3 === 'string' && typeof config.eip712Domain === 'object' && typeof config.eip712Domain.name === 'string' && typeof config.eip712Domain.version === 'string' && diff --git a/typescript/src/types.ts b/typescript/src/types.ts index 9af4b57..a470ca3 100644 --- a/typescript/src/types.ts +++ b/typescript/src/types.ts @@ -1,10 +1,10 @@ export type ChainConfig = { contracts: { - atlas: { address: string }; - atlasVerification: { address: string }; - sorter: { address: string }; - simulator: { address: string }; - multicall3: { address: string }; + atlas: string; + atlasVerification: string; + sorter: string; + simulator: string; + multicall3: string; }; eip712Domain: { name: string; diff --git a/typescript/test/index.test.ts b/typescript/test/index.test.ts index e4d7276..1fcaf5a 100644 --- a/typescript/test/index.test.ts +++ b/typescript/test/index.test.ts @@ -63,11 +63,11 @@ describe('Chain Config', () => { expect(config).toBeInstanceOf(Object); expect(config?.contracts).toEqual( expect.objectContaining({ - atlas: expect.any(Object), - atlasVerification: expect.any(Object), - sorter: expect.any(Object), - simulator: expect.any(Object), - multicall3: expect.any(Object) + atlas: expect.any(String), + atlasVerification: expect.any(String), + sorter: expect.any(String), + simulator: expect.any(String), + multicall3: expect.any(String) }) ); expect(config?.eip712Domain).toEqual( @@ -120,26 +120,26 @@ describe('Chain Config', () => { const providedConfigs: { [chainId: string]: PartialChainConfig } = { [existingChainId]: { contracts: { - atlas: { address: '0x7000000000000000000000000000000000000000' } + atlas: '0x7000000000000000000000000000000000000000' } } }; const mergedConfigs = mergeChainConfigs(providedConfigs); - expect(mergedConfigs[existingChainId].contracts.atlas.address).toBe('0x7000000000000000000000000000000000000000'); - expect(mergedConfigs[existingChainId].contracts.atlasVerification.address).toBe(chainConfig[existingChainId].contracts.atlasVerification.address); + expect(mergedConfigs[existingChainId].contracts.atlas).toBe('0x7000000000000000000000000000000000000000'); + expect(mergedConfigs[existingChainId].contracts.atlasVerification).toBe(chainConfig[existingChainId].contracts.atlasVerification); }); it('should add new chain config', () => { const newChainId = '999999'; const newConfig: ChainConfig = { contracts: { - atlas: { address: '0x9000000000000000000000000000000000000000' }, - atlasVerification: { address: '0xa000000000000000000000000000000000000000' }, - sorter: { address: '0xb000000000000000000000000000000000000000' }, - simulator: { address: '0xc000000000000000000000000000000000000000' }, - multicall3: { address: '0xd000000000000000000000000000000000000000' } + atlas: '0x9000000000000000000000000000000000000000', + atlasVerification: '0xa000000000000000000000000000000000000000', + sorter: '0xb000000000000000000000000000000000000000', + simulator: '0xc000000000000000000000000000000000000000', + multicall3: '0xd000000000000000000000000000000000000000' }, eip712Domain: { name: 'New Chain', @@ -159,7 +159,7 @@ describe('Chain Config', () => { const newChainId = '888888'; const incompleteConfig: PartialChainConfig = { contracts: { - atlas: { address: '0xf000000000000000000000000000000000000000' } + atlas: '0xf000000000000000000000000000000000000000' } };