Write state diff to CSV #2
@ -8,12 +8,14 @@ import (
|
|||||||
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
![]() 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 👌
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
![]() I think we probably want to include the address (and/or trie key) as a field here I think we probably want to include the address (and/or trie key) as a field here
|
|||||||
Headers = []string{
|
Headers = []string{
|
||||||
"blockNumber", "blockHash", "accountAction", "codeHash",
|
"blockNumber", "blockHash", "accountAction", "codeHash",
|
||||||
"nonceValue", "balanceValue", "contractRoot", "storageDiffPaths",
|
"nonceValue", "balanceValue", "contractRoot", "storageDiffPaths",
|
||||||
|
"accountAddress", "storageValue",
|
||||||
![]() 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 👌
|
|||||||
}
|
}
|
||||||
|
|
||||||
timeStampFormat = "20060102150405.00000"
|
timeStampFormat = "20060102150405.00000"
|
||||||
@ -67,8 +69,8 @@ func (p *publisher) publishStateDiffToCSV(sd builder.StateDiff) (string, error)
|
|||||||
![]() 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 👌
|
|||||||
|
|
||||||
func accumulateUpdatedAccountRows(sd builder.StateDiff) [][]string {
|
func accumulateUpdatedAccountRows(sd builder.StateDiff) [][]string {
|
||||||
var updatedAccountRows [][]string
|
var updatedAccountRows [][]string
|
||||||
for _, accountDiff := range sd.UpdatedAccounts {
|
for accountAddr, accountDiff := range sd.UpdatedAccounts {
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
formattedAccountData := formatAccountDiffIncremental(accountDiff, sd, updatedAccountAction)
|
formattedAccountData := formatAccountDiffIncremental(accountAddr, accountDiff, sd, updatedAccountAction)
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
|
|
||||||
updatedAccountRows = append(updatedAccountRows, formattedAccountData)
|
updatedAccountRows = append(updatedAccountRows, formattedAccountData)
|
||||||
}
|
}
|
||||||
@ -78,8 +80,8 @@ func accumulateUpdatedAccountRows(sd builder.StateDiff) [][]string {
|
|||||||
![]() 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 👌
|
|||||||
|
|
||||||
func accumulateDeletedAccountRows(sd builder.StateDiff) [][]string {
|
func accumulateDeletedAccountRows(sd builder.StateDiff) [][]string {
|
||||||
var deletedAccountRows [][]string
|
var deletedAccountRows [][]string
|
||||||
for _, accountDiff := range sd.DeletedAccounts {
|
for accountAddr, accountDiff := range sd.DeletedAccounts {
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
formattedAccountData := formatAccountDiffEventual(accountDiff, sd, deletedAccountAction)
|
formattedAccountData := formatAccountDiffEventual(accountAddr, accountDiff, sd, deletedAccountAction)
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
|
|
||||||
deletedAccountRows = append(deletedAccountRows, formattedAccountData)
|
deletedAccountRows = append(deletedAccountRows, formattedAccountData)
|
||||||
}
|
}
|
||||||
@ -89,8 +91,8 @@ func accumulateDeletedAccountRows(sd builder.StateDiff) [][]string {
|
|||||||
![]() 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 👌
|
|||||||
|
|
||||||
func accumulateCreatedAccountRows(sd builder.StateDiff) [][]string {
|
func accumulateCreatedAccountRows(sd builder.StateDiff) [][]string {
|
||||||
var createdAccountRows [][]string
|
var createdAccountRows [][]string
|
||||||
for _, accountDiff := range sd.CreatedAccounts {
|
for accountAddr, accountDiff := range sd.CreatedAccounts {
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
formattedAccountData := formatAccountDiffEventual(accountDiff, sd, createdAccountAction)
|
formattedAccountData := formatAccountDiffEventual(accountAddr, accountDiff, sd, createdAccountAction)
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
|
|
||||||
createdAccountRows = append(createdAccountRows, formattedAccountData)
|
createdAccountRows = append(createdAccountRows, formattedAccountData)
|
||||||
}
|
}
|
||||||
@ -98,10 +100,12 @@ func accumulateCreatedAccountRows(sd builder.StateDiff) [][]string {
|
|||||||
![]() 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 👌
|
|||||||
return createdAccountRows
|
return createdAccountRows
|
||||||
}
|
}
|
||||||
|
|
||||||
func formatAccountDiffEventual(accountDiff builder.AccountDiff, sd builder.StateDiff, accountAction string) []string {
|
func formatAccountDiffEventual(accountAddr common.Address, accountDiff builder.AccountDiff, sd builder.StateDiff, accountAction 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 👌
![]() 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 👌
|
|||||||
newContractRoot := accountDiff.ContractRoot.Value
|
newContractRoot := accountDiff.ContractRoot.Value
|
||||||
var storageDiffPaths []string
|
var storageDiffPaths []string
|
||||||
for k := range accountDiff.Storage {
|
var storageValue builder.DiffString
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
|
for k, v := range accountDiff.Storage {
|
||||||
![]() 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 👌
|
|||||||
|
storageValue = v
|
||||||
![]() 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 👌
|
|||||||
storageDiffPaths = append(storageDiffPaths, k)
|
storageDiffPaths = append(storageDiffPaths, k)
|
||||||
}
|
}
|
||||||
formattedAccountData := []string{
|
formattedAccountData := []string{
|
||||||
@ -113,15 +117,19 @@ func formatAccountDiffEventual(accountDiff builder.AccountDiff, sd builder.State
|
|||||||
![]() 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 👌
|
|||||||
accountDiff.Balance.Value.String(),
|
accountDiff.Balance.Value.String(),
|
||||||
*newContractRoot,
|
*newContractRoot,
|
||||||
strings.Join(storageDiffPaths, ","),
|
strings.Join(storageDiffPaths, ","),
|
||||||
|
accountAddr.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 👌
|
|||||||
|
*storageValue.Value,
|
||||||
![]() 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 👌
|
|||||||
}
|
}
|
||||||
return formattedAccountData
|
return formattedAccountData
|
||||||
}
|
}
|
||||||
|
|
||||||
func formatAccountDiffIncremental(accountDiff builder.AccountDiff, sd builder.StateDiff, accountAction string) []string {
|
func formatAccountDiffIncremental(accountAddr common.Address, accountDiff builder.AccountDiff, sd builder.StateDiff, accountAction 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 👌
![]() 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 👌
|
|||||||
newContractRoot := accountDiff.ContractRoot.Value
|
newContractRoot := accountDiff.ContractRoot.Value
|
||||||
var storageDiffPaths []string
|
var storageDiffPaths []string
|
||||||
for k := range accountDiff.Storage {
|
var storageValue builder.DiffString
|
||||||
![]() 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 👌
![]() 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 👌
|
|||||||
|
for k, v := range accountDiff.Storage {
|
||||||
![]() 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 👌
|
|||||||
storageDiffPaths = append(storageDiffPaths, k)
|
storageDiffPaths = append(storageDiffPaths, k)
|
||||||
|
storageValue = v
|
||||||
![]() 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 👌
|
|||||||
}
|
}
|
||||||
formattedAccountData := []string{
|
formattedAccountData := []string{
|
||||||
strconv.FormatInt(sd.BlockNumber, 10),
|
strconv.FormatInt(sd.BlockNumber, 10),
|
||||||
@ -132,6 +140,8 @@ func formatAccountDiffIncremental(accountDiff builder.AccountDiff, sd builder.St
|
|||||||
![]() 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 👌
|
|||||||
accountDiff.Balance.Value.String(),
|
accountDiff.Balance.Value.String(),
|
||||||
*newContractRoot,
|
*newContractRoot,
|
||||||
strings.Join(storageDiffPaths, ","),
|
strings.Join(storageDiffPaths, ","),
|
||||||
|
accountAddr.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 👌
|
|||||||
|
*storageValue.Value,
|
||||||
![]() 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 👌
|
|||||||
}
|
}
|
||||||
return formattedAccountData
|
return formattedAccountData
|
||||||
}
|
}
|
||||||
|
|||||||
![]() 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 👌
|
@ -34,6 +34,8 @@ var expectedCreatedAccountRow = []string{
|
|||||||
strconv.FormatInt(testhelpers.NewBalanceValue, 10),
|
strconv.FormatInt(testhelpers.NewBalanceValue, 10),
|
||||||
testhelpers.ContractRoot,
|
testhelpers.ContractRoot,
|
||||||
testhelpers.StoragePath,
|
testhelpers.StoragePath,
|
||||||
|
testhelpers.ContractAddress,
|
||||||
|
testhelpers.StorageValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
var expectedUpdatedAccountRow = []string{
|
var expectedUpdatedAccountRow = []string{
|
||||||
@ -45,6 +47,8 @@ var expectedUpdatedAccountRow = []string{
|
|||||||
strconv.FormatInt(testhelpers.NewBalanceValue, 10),
|
strconv.FormatInt(testhelpers.NewBalanceValue, 10),
|
||||||
testhelpers.ContractRoot,
|
testhelpers.ContractRoot,
|
||||||
testhelpers.StoragePath,
|
testhelpers.StoragePath,
|
||||||
|
testhelpers.ContractAddress,
|
||||||
|
testhelpers.StorageValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
var expectedDeletedAccountRow = []string{
|
var expectedDeletedAccountRow = []string{
|
||||||
@ -56,6 +60,8 @@ var expectedDeletedAccountRow = []string{
|
|||||||
strconv.FormatInt(testhelpers.NewBalanceValue, 10),
|
strconv.FormatInt(testhelpers.NewBalanceValue, 10),
|
||||||
testhelpers.ContractRoot,
|
testhelpers.ContractRoot,
|
||||||
testhelpers.StoragePath,
|
testhelpers.StoragePath,
|
||||||
|
testhelpers.ContractAddress,
|
||||||
|
testhelpers.StorageValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPublisher(t *testing.T) {
|
func TestPublisher(t *testing.T) {
|
||||||
|
@ -15,9 +15,10 @@ var (
|
|||||||
NewBalanceValue = rand.Int63()
|
NewBalanceValue = rand.Int63()
|
||||||
ContractRoot = "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
|
ContractRoot = "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
|
||||||
StoragePath = "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
|
StoragePath = "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
|
||||||
newStorage = "0x03"
|
StorageValue = "0x03"
|
||||||
storage = map[string]builder.DiffString{StoragePath: {Value: &newStorage}}
|
storage = map[string]builder.DiffString{StoragePath: {Value: &StorageValue}}
|
||||||
address = common.HexToAddress("0xaE9BEa628c4Ce503DcFD7E305CaB4e29E7476592")
|
address = common.HexToAddress("0xaE9BEa628c4Ce503DcFD7E305CaB4e29E7476592")
|
||||||
|
ContractAddress = address.String()
|
||||||
CreatedAccountDiffs = map[common.Address]builder.AccountDiff{address: {
|
CreatedAccountDiffs = map[common.Address]builder.AccountDiff{address: {
|
||||||
Nonce: builder.DiffUint64{Value: &NewNonceValue},
|
Nonce: builder.DiffUint64{Value: &NewNonceValue},
|
||||||
Balance: builder.DiffBigInt{Value: big.NewInt(NewBalanceValue)},
|
Balance: builder.DiffBigInt{Value: big.NewInt(NewBalanceValue)},
|
||||||
|
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 👌