Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Fix: crash when taker address not allowed (#1019)
Browse files Browse the repository at this point in the history
* stop crashing when takerAddress is invalid
  • Loading branch information
xianny authored Feb 5, 2021
1 parent 8f66252 commit ca7cd44
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions graphql/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const (
RejectedOrderCodeIncorrectExchangeAddress RejectedOrderCode = "INCORRECT_EXCHANGE_ADDRESS"
RejectedOrderCodeSenderAddressNotAllowed RejectedOrderCode = "SENDER_ADDRESS_NOT_ALLOWED"
RejectedOrderCodeDatabaseFullOfOrders RejectedOrderCode = "DATABASE_FULL_OF_ORDERS"
RejectedOrderCodeTakerAddressNotAllowed RejectedOrderCode = "TAKER_ADDRESS_NOT_ALLOWED"
RejectedOrderCodeInvalidSchema RejectedOrderCode = "INVALID_SCHEMA"
)

Expand Down
1 change: 1 addition & 0 deletions graphql/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions graphql/gqltypes/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ func RejectedCodeFromValidatorStatus(status ordervalidator.RejectedOrderStatus)
return RejectedOrderCodeSenderAddressNotAllowed, nil
case ordervalidator.RODatabaseFullOfOrders.Code:
return RejectedOrderCodeDatabaseFullOfOrders, nil
case ordervalidator.ROTakerAddressNotAllowed.Code:
return RejectedOrderCodeTakerAddressNotAllowed, nil
default:
return "", fmt.Errorf("unexpected RejectedOrderStatus.Code: %q", status.Code)
}
Expand Down
4 changes: 3 additions & 1 deletion graphql/gqltypes/types_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ enum RejectedOrderCode {
INCORRECT_EXCHANGE_ADDRESS
SENDER_ADDRESS_NOT_ALLOWED
DATABASE_FULL_OF_ORDERS
TAKER_ADDRESS_NOT_ALLOWED
}

type Mutation {
Expand Down
1 change: 1 addition & 0 deletions packages/mesh-browser-lite/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ export enum RejectedOrderCode {
IncorrectExchangeAddress = 'INCORRECT_EXCHANGE_ADDRESS',
SenderAddressNotAllowed = 'SENDER_ADDRESS_NOT_ALLOWED',
DatabaseFullOfOrders = 'DATABASE_FULL_OF_ORDERS',
TakerAddressNotAllowed = 'TAKER_ADDRESS_NOT_ALLOWED',
}

/** @ignore */
Expand Down
1 change: 1 addition & 0 deletions packages/mesh-graphql-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export enum RejectedOrderCode {
IncorrectExchangeAddress = 'INCORRECT_EXCHANGE_ADDRESS',
SenderAddressNotAllowed = 'SENDER_ADDRESS_NOT_ALLOWED',
DatabaseFullOfOrders = 'DATABASE_FULL_OF_ORDERS',
TakerAddressNotAllowed = 'TAKER_ADDRESS_NOT_ALLOWED',
}

export interface OrderEvent {
Expand Down

0 comments on commit ca7cd44

Please sign in to comment.