diff --git a/contracts/pyth-pnau-decoder-v1.clar b/contracts/pyth-pnau-decoder-v1.clar index fa4a007..4445e31 100644 --- a/contracts/pyth-pnau-decoder-v1.clar +++ b/contracts/pyth-pnau-decoder-v1.clar @@ -117,7 +117,7 @@ ;; Check major version (asserts! (is-eq (get value cursor-version-maj) PYTHNET_MAJOR_VERSION) ERR_VERSION_MAJ) ;; Check minor version - (asserts! (is-eq (get value cursor-version-min) PYTHNET_MINOR_VERSION) ERR_VERSION_MIN) + (asserts! (>= (get value cursor-version-min) PYTHNET_MINOR_VERSION) ERR_VERSION_MIN) ;; Check proof type (asserts! (is-eq (get value cursor-proof-type) u0) ERR_PROOF_TYPE) (ok { diff --git a/unit-tests/pyth/pnau.test.ts b/unit-tests/pyth/pnau.test.ts index 8fe3b27..14fc20e 100644 --- a/unit-tests/pyth/pnau.test.ts +++ b/unit-tests/pyth/pnau.test.ts @@ -564,7 +564,7 @@ describe("pyth-pnau-decoder-v1::decode-and-verify-price-feeds failures", () => { expect(res.result).toBeErr(Cl.uint(2002)); }); - it("should fail if PNAU minor version is incorrect", () => { + it("should not fail if PNAU minor version is above minimum minor due to forward compatibility", () => { let actualPricesUpdates = pyth.buildPriceUpdateBatch([ [pyth.BtcPriceIdentifier, { price: 100n }], ]); @@ -597,7 +597,7 @@ describe("pyth-pnau-decoder-v1::decode-and-verify-price-feeds failures", () => { [Cl.buffer(pnau), executionPlan], sender, ); - expect(res.result).toBeErr(Cl.uint(2003)); + expect(res.result.type).toBe(ClarityType.ResponseOk) }); it("should fail if PNAU proof type version is incorrect", () => {