Skip to content

Commit

Permalink
fix(sdk): fix data checking (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 authored Dec 30, 2022
1 parent 775c39d commit a0a5a20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
throw new ServerError(Status.INVALID_ARGUMENT, "Block can't be empty")
}
let block: Block
if (binding.data.ethBlock) {
if (binding.data.ethBlock?.block) {
block = binding.data.ethBlock.block as Block
} else {
const jsonString = Utf8ArrayToStr(binding.data.raw)
Expand All @@ -603,7 +603,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
throw new ServerError(Status.INVALID_ARGUMENT, "Trace can't be empty")
}
let trace: Trace
if (binding.data.ethTrace) {
if (binding.data.ethTrace?.trace) {
trace = binding.data.ethTrace.trace as Trace
} else {
const jsonString = Utf8ArrayToStr(binding.data.raw)
Expand Down Expand Up @@ -631,7 +631,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
}
const promises: Promise<ProcessResult>[] = []
let event: Transaction_UserTransaction
if (binding.data.aptEvent) {
if (binding.data.aptEvent?.event) {
event = binding.data.aptEvent?.event as Transaction_UserTransaction
} else {
const jsonString = Utf8ArrayToStr(binding.data.raw)
Expand Down

0 comments on commit a0a5a20

Please sign in to comment.