Factor out a bad storage diff for testing

This commit is contained in:
Elizabeth Engelman
2019-09-25 16:36:44 -05:00
parent 6869330bd3
commit f315988507
3 changed files with 22 additions and 30 deletions
+2 -7
View File
@@ -67,7 +67,7 @@ var _ = Describe("Storage row parsing", func() {
Describe("FromGethStateDiff", func() {
var (
accountDiff = statediff.AccountDiff{Key: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}}
stateDiff = &statediff.StateDiff{
stateDiff = &statediff.StateDiff{
BlockNumber: big.NewInt(rand.Int63()),
BlockHash: fakes.FakeHash,
}
@@ -113,12 +113,7 @@ var _ = Describe("Storage row parsing", func() {
})
It("returns an err if decoding the storage value Rlp fails", func() {
storageDiff := statediff.StorageDiff{
Key: []byte{0, 9, 8, 7, 6, 5, 4, 3, 2, 1},
Value: test_data.StorageKey,
}
_, err := utils.FromGethStateDiff(accountDiff, stateDiff, storageDiff)
_, err := utils.FromGethStateDiff(accountDiff, stateDiff, test_data.StorageWithBadValue)
Expect(err).To(HaveOccurred())
Expect(err).To(MatchError("rlp: input contains more than one value"))
})