diff --git a/apps/desktop/src/components/OperationTile/OriginationTile.test.tsx b/apps/desktop/src/components/OperationTile/OriginationTile.test.tsx index 516aaccf66..9294c59c48 100644 --- a/apps/desktop/src/components/OperationTile/OriginationTile.test.tsx +++ b/apps/desktop/src/components/OperationTile/OriginationTile.test.tsx @@ -59,6 +59,13 @@ describe("", () => { ); expect(screen.getByTestId("title")).toHaveTextContent("Contract Origination"); }); + + it("shows a contract origination title if operation failed and there is no contract", () => { + render(fixture(contextValue, originationFixture({ originatedContract: undefined })), { + store, + }); + expect(screen.getByTestId("title")).toHaveTextContent("Contract Origination"); + }); }); }); diff --git a/apps/desktop/src/components/OperationTile/OriginationTile.tsx b/apps/desktop/src/components/OperationTile/OriginationTile.tsx index 54ad820a0c..c994bff178 100644 --- a/apps/desktop/src/components/OperationTile/OriginationTile.tsx +++ b/apps/desktop/src/components/OperationTile/OriginationTile.tsx @@ -14,7 +14,7 @@ import { AddressPill } from "../AddressPill/AddressPill"; export const OriginationTile = ({ operation }: { operation: OriginationOperation }) => { const isMultisig = - operation.originatedContract.codeHash === CODE_HASH && + operation.originatedContract?.codeHash === CODE_HASH && operation.originatedContract.typeHash === TYPE_HASH; const contractTitle = isMultisig ? "Multisig Account Created" : "Contract Origination"; diff --git a/packages/tzkt/src/types.ts b/packages/tzkt/src/types.ts index 609ed83811..b03be843db 100644 --- a/packages/tzkt/src/types.ts +++ b/packages/tzkt/src/types.ts @@ -151,7 +151,7 @@ export type TransactionOperation = CommonOperationFields & { export type OriginationOperation = CommonOperationFields & { type: "origination"; - originatedContract: { + originatedContract?: { address: RawPkh; codeHash: number; typeHash: number;