This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
173 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
pkg/transformers/storage_diffs/maker/test_helpers/datatypes.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package test_helpers | ||
|
||
import ( | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
type BlockMetadata struct { | ||
BlockNumber int `db:"block_number"` | ||
BlockHash string `db:"block_hash"` | ||
} | ||
|
||
type VariableRes struct { | ||
BlockMetadata | ||
Value string | ||
} | ||
|
||
type MappingRes struct { | ||
BlockMetadata | ||
Key string | ||
Value string | ||
} | ||
|
||
type DoubleMappingRes struct { | ||
BlockMetadata | ||
KeyOne string `db:"key_one"` | ||
KeyTwo string `db:"key_two"` | ||
Value string | ||
} | ||
|
||
func AssertVariable(res VariableRes, blockNumber int, blockHash, value string) { | ||
Expect(res.BlockNumber).To(Equal(blockNumber)) | ||
Expect(res.BlockHash).To(Equal(blockHash)) | ||
Expect(res.Value).To(Equal(value)) | ||
} | ||
|
||
func AssertMapping(res MappingRes, blockNumber int, blockHash, key, value string) { | ||
Expect(res.BlockNumber).To(Equal(blockNumber)) | ||
Expect(res.BlockHash).To(Equal(blockHash)) | ||
Expect(res.Key).To(Equal(key)) | ||
Expect(res.Value).To(Equal(value)) | ||
} | ||
|
||
func AssertDoubleMapping(res DoubleMappingRes, blockNumber int, blockHash, keyOne, keyTwo, value string) { | ||
Expect(res.BlockNumber).To(Equal(blockNumber)) | ||
Expect(res.BlockHash).To(Equal(blockHash)) | ||
Expect(res.KeyOne).To(Equal(keyOne)) | ||
Expect(res.KeyTwo).To(Equal(keyTwo)) | ||
Expect(res.Value).To(Equal(value)) | ||
} |
Oops, something went wrong.