Write state diff to CSV #2

Merged
elizabethengelman merged 47 commits from ee-state-diff into statediff-for-archive-node 2019-01-28 21:31:02 +00:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit ecd34978d3 - Show all commits

View File

@ -22,16 +22,17 @@ var (
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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 👌
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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 👌
updatedAccountAction = "updated"
)
func createCSVFilePath(path string) string {
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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 {
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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)
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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)
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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)
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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))
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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 {

rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:00:34 +00:00 (Migrated from github.com)
Review

And then I think the _ here could be captured to publish the address

And then I think the `_` here could be captured to publish the address
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
rmulhol commented 2019-01-03 23:05:31 +00:00 (Migrated from github.com)
Review

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 `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
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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 👌
elizabethengelman commented 2019-01-10 19:33:36 +00:00 (Migrated from github.com)
Review

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 - `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 👌

View File

@ -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) {