From 02c2710b535066bccdb13f16744bba7fd84d0aa8 Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Mon, 4 Dec 2023 11:18:31 +0800 Subject: [PATCH 1/3] Update fetch-data.js --- packages/ens-test-env/src/fetch-data.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/ens-test-env/src/fetch-data.js b/packages/ens-test-env/src/fetch-data.js index 137f797d..87bd6d32 100644 --- a/packages/ens-test-env/src/fetch-data.js +++ b/packages/ens-test-env/src/fetch-data.js @@ -113,6 +113,11 @@ async function decompressToOutput() { extractProgressBar.stop() reject(err.message) }) + + const readMePath = `${dataPath}/ipfs/blocks/_README` + if (fs.existsSync(readMePath)) { + await fs.rm(readMePath, {force: true}) + } }) } From 447e1e9b1b8663cff72d032b670a6407cb5372e7 Mon Sep 17 00:00:00 2001 From: tate Date: Tue, 5 Dec 2023 13:38:44 +1100 Subject: [PATCH 2/3] fix: generateRecordCallArray inconsistent with setAbiRecord --- .../ensjs/src/utils/generateRecordCallArray.test.ts | 12 ++++++++++-- packages/ensjs/src/utils/generateRecordCallArray.ts | 8 +++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/ensjs/src/utils/generateRecordCallArray.test.ts b/packages/ensjs/src/utils/generateRecordCallArray.test.ts index c96142ff..5dd3cd54 100644 --- a/packages/ensjs/src/utils/generateRecordCallArray.test.ts +++ b/packages/ensjs/src/utils/generateRecordCallArray.test.ts @@ -44,11 +44,11 @@ it('adds contentHash call when contentHash is defined', () => { ] `) }) -it('adds abi call when abi is defined', () => { +it('adds abi call when abi is null', () => { expect( generateRecordCallArray({ namehash: namehash('test.eth'), - abi: { contentType: 0, encodedData: '0x' }, + abi: null, }), ).toMatchInlineSnapshot(` [ @@ -56,6 +56,14 @@ it('adds abi call when abi is defined', () => { ] `) }) +it('does not add abi call when abi is undefined', () => { + expect( + generateRecordCallArray({ + namehash: namehash('test.eth'), + abi: undefined, + }), + ).toMatchInlineSnapshot(`[]`) +}) it('adds text calls when texts array is defined and not empty', () => { expect( generateRecordCallArray({ diff --git a/packages/ensjs/src/utils/generateRecordCallArray.ts b/packages/ensjs/src/utils/generateRecordCallArray.ts index 7a627ddd..5d68622a 100644 --- a/packages/ensjs/src/utils/generateRecordCallArray.ts +++ b/packages/ensjs/src/utils/generateRecordCallArray.ts @@ -1,5 +1,6 @@ import { type Hex } from 'viem' import type { Prettify } from '../types.js' +import type { EncodedAbi } from './encoders/encodeAbi.js' import { encodeClearRecords } from './encoders/encodeClearRecords.js' import { encodeSetAbi, @@ -25,7 +26,7 @@ export type RecordOptions = Prettify<{ /** Array of coin records */ coins?: Omit[] /** ABI value */ - abi?: Omit + abi?: EncodedAbi | null }> export const generateRecordCallArray = ({ @@ -47,8 +48,9 @@ export const generateRecordCallArray = ({ if (data) calls.push(data) } - if (abi) { - const data = encodeSetAbi({ namehash, ...abi } as EncodeSetAbiParameters) + if (abi !== undefined) { + const abi_ = abi ?? { contentType: 0, encodedData: null } + const data = encodeSetAbi({ namehash, ...abi_ } as EncodeSetAbiParameters) if (data) calls.push(data) } From fad378aa6764ec05c7cda951d6fef278be165924 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 07:59:06 +0000 Subject: [PATCH 3/3] v3.0.0-beta.11 --- packages/ensjs/package.json | 2 +- packages/ensjs/src/errors/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ensjs/package.json b/packages/ensjs/package.json index aa7b3b2f..2013c7a5 100644 --- a/packages/ensjs/package.json +++ b/packages/ensjs/package.json @@ -1,6 +1,6 @@ { "name": "@ensdomains/ensjs", - "version": "3.0.0-beta.10", + "version": "3.0.0-beta.11", "description": "ENS javascript library for contract interaction", "type": "module", "main": "./dist/cjs/index.js", diff --git a/packages/ensjs/src/errors/version.ts b/packages/ensjs/src/errors/version.ts index 745a16d1..41f41a0a 100644 --- a/packages/ensjs/src/errors/version.ts +++ b/packages/ensjs/src/errors/version.ts @@ -1 +1 @@ -export const version = 'v3.0.0-beta.10' +export const version = 'v3.0.0-beta.11'