Write state diff to CSV #2
@ -22,16 +22,17 @@ var (
|
||||
|
||||
updatedAccountAction = "updated"
|
||||
)
|
||||
|
||||
func createCSVFilePath(path string) string {
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
func createCSVFilePath(path, blockNumber string) string {
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
now := time.Now()
|
||||
timeStamp := now.Format(timeStampFormat)
|
||||
filePath := filepath.Join(path, timeStamp)
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
suffix := timeStamp + "-" + blockNumber
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
filePath := filepath.Join(path, suffix)
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
filePath = filePath + ".csv"
|
||||
return filePath
|
||||
}
|
||||
|
||||
func (p *publisher) publishStateDiffToCSV(sd builder.StateDiff) (string, error) {
|
||||
filePath := createCSVFilePath(p.Config.Path)
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
filePath := createCSVFilePath(p.Config.Path, strconv.FormatInt(sd.BlockNumber, 10))
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
||||
|
||||
file, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
|
||||
And then I think the And then I think the `_` here could be captured to publish the address
And then I think the And then I think the `_` here could be captured to publish the address
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
I'm a little confused about how this works - isn't I'm a little confused about how this works - isn't `accountDiff.Storage` a map? Does `k` capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the data
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
Yep, good call - Yep, good call - `k` is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌
|
@ -116,6 +116,10 @@ func testFileName(t *testing.T) {
|
||||
if !strings.HasPrefix(fileName, dir) {
|
||||
t.Errorf(testhelpers.TestFailureFormatString, t.Name(), dir, fileName)
|
||||
}
|
||||
blockNumberWithFileExt := strconv.FormatInt(testhelpers.BlockNumber, 10) + ".csv"
|
||||
if !strings.HasSuffix(fileName, blockNumberWithFileExt) {
|
||||
t.Errorf(testhelpers.TestFailureFormatString, t.Name(), blockNumberWithFileExt, fileName)
|
||||
}
|
||||
}
|
||||
|
||||
func testColumnHeaders(t *testing.T) {
|
||||
|
And then I think the
_
here could be captured to publish the addressAnd then I think the
_
here could be captured to publish the addressI'm a little confused about how this works - isn't
accountDiff.Storage
a map? Doesk
capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the dataI'm a little confused about how this works - isn't
accountDiff.Storage
a map? Doesk
capture the key and value? Thinking we probably want both of those so that we can parse the new value and associate it with the corresponding key when consuming the dataYep, good call -
k
is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌Yep, good call -
k
is just capturing the path to the storage value. I think I'll want both the key and the value when I add the storage value to the csv 👌