From 6a62607dba0139a153ad94b63951e1a320d5bf7d Mon Sep 17 00:00:00 2001 From: AbigailDeng Date: Thu, 9 May 2024 17:44:55 +0800 Subject: [PATCH] feat: if dataType cannot be found and also is not VirtualTransactionCreated --- README.md | 2 +- src/util/proto.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2694f167..b1871d15 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ | Statements | Branches | Functions | Lines | | --------------------------- | ----------------------- | ------------------------- | ----------------- | -| ![Statements](https://img.shields.io/badge/statements-96.82%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-93.69%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-96.72%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-97.01%25-brightgreen.svg?style=flat) | +| ![Statements](https://img.shields.io/badge/statements-96.72%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-93.49%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-96.72%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-96.91%25-brightgreen.svg?style=flat) | ## 1. Introduction diff --git a/src/util/proto.js b/src/util/proto.js index 33a54a86..3b96a734 100644 --- a/src/util/proto.js +++ b/src/util/proto.js @@ -246,6 +246,12 @@ const handleLogs = (logs = [], services, Root) => { return getDeserializeLogResult(serializedData, dataType); } } else { + // if dataType cannot be found and also is not VirtualTransactionCreated + if (!dataType) { + return { + message: 'This log is not supported.', + }; + } // other method return getDeserializeLogResult(serializedData, dataType); }