@@ -63,17 +63,7 @@ class ErgoStateContextSpec extends HistoryTestHelpers {
63
63
val imvKey = extensionKvGen(Extension .FieldKeySize - 1 , Extension .FieldValueMaxSize ).sample.get
64
64
sc.appendFullBlock(fbWithFields(imvKey +: oldFields)) shouldBe ' failure
65
65
66
- // https://github.com/ergoplatform/ergo/issues/2114
67
- // this fails sporadically, when `(imvValue._1.head == 0)`, because less value bytes will be generated
68
- // by extensionKvGen(). Workaround is to just generate again while `(imvValue._1.head == 0)`
69
- // TODO: document, and possibly rewrite/replace extensionKvGen after the above issues are clarified/solved
70
- // https://github.com/ergoplatform/ergo/issues/2118
71
-
72
- // validation of field value sizes
73
- var imvValue = extensionKvGen(Extension .FieldKeySize , Extension .FieldValueMaxSize + 1 ).sample.get
74
- while (imvValue._1.head == 0 ) {
75
- imvValue = extensionKvGen(Extension .FieldKeySize , Extension .FieldValueMaxSize + 1 ).sample.get
76
- }
66
+ val imvValue = extensionKvGenImvValue(Extension .FieldKeySize , Extension .FieldValueMaxSize + 1 ).sample.get
77
67
sc.appendFullBlock(fbWithFields(imvValue +: oldFields)) shouldBe ' failure
78
68
79
69
// validation of incorrect interlinks
@@ -82,16 +72,7 @@ class ErgoStateContextSpec extends HistoryTestHelpers {
82
72
).fields
83
73
sc.appendFullBlock(fbWithFields(invalidInterlinks ++ oldFields)) shouldBe ' failure
84
74
85
- // https://github.com/ergoplatform/ergo/issues/2114
86
- // if validMKV._1.head is 1, appendFullBlock within "valid application of correct extension" will fail,
87
- // because with "key.head == 1", improperly packed interlink would be generated.
88
- // As a workaround, just generate new values until (validMKV._1.head != 1)
89
- // TODO: investigate and provide a full fix (followup issue)
90
- // https://github.com/ergoplatform/ergo/issues/2117
91
- var validMKV = extensionKvGen(Extension .FieldKeySize , Extension .FieldValueMaxSize ).sample.get
92
- while (validMKV._1.head == 1 ) {
93
- validMKV = extensionKvGen(Extension .FieldKeySize , Extension .FieldValueMaxSize ).sample.get
94
- }
75
+ val validMKV = extensionKvGenValidMKV(Extension .FieldKeySize , Extension .FieldValueMaxSize ).sample.get
95
76
// validation of key duplicates in fields
96
77
sc.appendFullBlock(fbWithFields(Seq (validMKV, validMKV) ++ oldFields)) shouldBe ' failure
97
78
0 commit comments