@@ -14,6 +14,9 @@ object RLPImplicitDerivations {
14
14
// as opposed to a list of 0 or 1 items.
15
15
omitTrailingOptionals : Boolean
16
16
)
17
+ object DerivationPolicy {
18
+ val default = DerivationPolicy (omitTrailingOptionals = true )
19
+ }
17
20
18
21
/** Support introspecting on what happened during encoding the tail. */
19
22
case class FieldInfo (isOptional : Boolean )
@@ -70,7 +73,7 @@ object RLPImplicitDerivations {
70
73
hEncoder : Lazy [RLPEncoder [H ]],
71
74
tEncoder : Lazy [RLPListEncoder [T ]],
72
75
ev : H <:< Option [_],
73
- policy : DerivationPolicy
76
+ policy : DerivationPolicy = DerivationPolicy .default
74
77
): RLPListEncoder [FieldType [K , H ] :: T ] = {
75
78
val hInfo = FieldInfo (isOptional = true )
76
79
// Create an encoder that takes a list of field values.
@@ -142,7 +145,7 @@ object RLPImplicitDerivations {
142
145
// contextual error messages.
143
146
witness : Witness .Aux [K ],
144
147
ev : Option [V ] =:= H ,
145
- policy : DerivationPolicy
148
+ policy : DerivationPolicy = DerivationPolicy .default
146
149
): RLPListDecoder [FieldType [K , H ] :: T ] = {
147
150
val fieldName : String = witness.value.name
148
151
val hInfo = FieldInfo (isOptional = true )
0 commit comments