Skip to content

Commit

Permalink
fix(crypto): make transaction amount required (#2574)
Browse files Browse the repository at this point in the history
  • Loading branch information
spkjp authored and faustbrian committed May 13, 2019
1 parent d2b426e commit e6c8406
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/unit/core-transactions/handler-registry.test.ts
Expand Up @@ -21,7 +21,7 @@ class TestTransaction extends Transactions.Transaction {
public static getSchema(): Transactions.schemas.TransactionSchema {
return extend(transactionBaseSchema, {
$id: "test",
required: ["recipientId", "amount", "asset"],
required: ["recipientId", "asset"],
properties: {
type: { transactionType: TEST_TRANSACTION_TYPE },
recipientId: { $ref: "address" },
Expand Down
4 changes: 2 additions & 2 deletions packages/crypto/src/transactions/types/schemas.ts
Expand Up @@ -16,7 +16,7 @@ const strictTransaction = {
export const transactionBaseSchema = {
$id: undefined,
type: "object",
required: ["type", "senderPublicKey", "fee", "timestamp"],
required: ["type", "senderPublicKey", "fee", "amount", "timestamp"],
properties: {
id: { anyOf: [{ $ref: "transactionId" }, { type: "null" }] },
version: { enum: [1, 2] },
Expand Down Expand Up @@ -58,7 +58,7 @@ export const strictSchema = (schema: TransactionSchema): TransactionSchema => {

export const transfer = extend(transactionBaseSchema, {
$id: "transfer",
required: ["recipientId", "amount"],
required: ["recipientId"],
properties: {
type: { transactionType: TransactionTypes.Transfer },
vendorField: { anyOf: [{ type: "null" }, { type: "string", format: "vendorField" }] },
Expand Down

0 comments on commit e6c8406

Please sign in to comment.