Skip to content

Commit

Permalink
Fix naming conventions on the derived oracle approval message
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperschwartz committed Feb 3, 2022
1 parent 01df433 commit e44a3be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package io.provenance.invoice.domain.provenancetx

import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import com.google.protobuf.ByteString
import io.provenance.invoice.config.app.ConfigurationUtil.DEFAULT_OBJECT_MAPPER
import io.provenance.scope.objectstore.util.base64Encode
import io.provenance.scope.util.toByteString
import java.util.UUID

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy::class)
data class OracleApproval(
val oracleApproval: OracleApprovalBody
) {
Expand All @@ -22,4 +25,5 @@ data class OracleApproval(
.toByteString()
}

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy::class)
data class OracleApprovalBody(val payableUuid: UUID)
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ class EventHandlerService(
logger.error("Oracle signing failed", e)
invoiceRepository.update(uuid = invoiceUuid, status = InvoiceStatus.APPROVAL_FAILURE)
null
}
if (response != null) {
}?.txResponse
if (response != null && response.data.isNotBlank() && response.info.isNotBlank()) {
logger.info("Successfully signed as the oracle! Woo! Response: $response")
invoiceRepository.update(uuid = invoiceUuid, status = InvoiceStatus.APPROVED)
} else {
logger.error("Failed to sign as the oracle. Response: $response")
invoiceRepository.update(uuid = invoiceUuid, status = InvoiceStatus.APPROVAL_FAILURE)
}
}
}
Expand Down

0 comments on commit e44a3be

Please sign in to comment.