Skip to content

Commit 6d9f1f7

Browse files
authored
allow new bundle fields for direct orderflow (#29)
## πŸ“ Summary Allow new bundle fields for `localEndpoint` (direct orderflow) ## β›± Motivation and Context `dropping tx hashes` and `refund recipient` support ## πŸ“š References --- ## βœ… I have run these commands * [x] `make lint` * [x] `make test` * [x] `go mod tidy`
1 parent 0b760fb commit 6d9f1f7

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

β€Žproxy/api_validate.goβ€Ž

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,28 @@ func ValidateEthSendBundle(args *rpctypes.EthSendBundleArgs, publicEndpoint bool
2424
return errSigningAddress
2525
}
2626
}
27-
if len(args.DroppingTxHashes) > 0 {
28-
return errDroppingTxHashed
27+
28+
// do not allow for new bundle fields for public endpoint
29+
if publicEndpoint {
30+
if len(args.DroppingTxHashes) > 0 {
31+
return errDroppingTxHashed
32+
}
33+
34+
if args.RefundPercent != nil {
35+
return errRefundPercent
36+
}
37+
if args.RefundRecipient != nil {
38+
return errRefundRecipient
39+
}
40+
if len(args.RefundTxHashes) > 0 {
41+
return errRefundTxHashes
42+
}
2943
}
44+
3045
if args.UUID != nil {
3146
return errUUID
3247
}
33-
if args.RefundPercent != nil {
34-
return errRefundPercent
35-
}
36-
if args.RefundRecipient != nil {
37-
return errRefundRecipient
38-
}
39-
if len(args.RefundTxHashes) > 0 {
40-
return errRefundTxHashes
41-
}
48+
4249
return nil
4350
}
4451

0 commit comments

Comments
Β (0)