@@ -20,10 +20,10 @@ import (
2020)
2121
2222type stats struct {
23- SentAt time.Time
24- TxnHash string
25- IncludedInBlock uint64
26- InclusionDelayMs time.Duration
23+ SentAt time.Time
24+ TxnHash string
25+ IncludedInBlock uint64
26+ InclusionDelay time.Duration
2727}
2828
2929func main () {
@@ -123,11 +123,11 @@ func main() {
123123 time .Sleep (time .Duration (rand .Float64 () * float64 (time .Second )))
124124 }
125125
126- if err := writeToFile (fmt .Sprintf ("flashblocks-%s.csv" , region ), flashblockTimings ); err != nil {
126+ if err := writeToFile (fmt .Sprintf ("/data/ flashblocks-%s.csv" , region ), flashblockTimings ); err != nil {
127127 log .Fatalf ("Failed to write to file: %v" , err )
128128 }
129129
130- if err := writeToFile (fmt .Sprintf ("base-%s.csv" , region ), baseTimings ); err != nil {
130+ if err := writeToFile (fmt .Sprintf ("/data/ base-%s.csv" , region ), baseTimings ); err != nil {
131131 log .Fatalf ("Failed to write to file: %v" , err )
132132 }
133133}
@@ -152,7 +152,7 @@ func writeToFile(filename string, data []stats) error {
152152 d .SentAt .String (),
153153 d .TxnHash ,
154154 strconv .FormatUint (d .IncludedInBlock , 10 ),
155- strconv .FormatInt (d .InclusionDelayMs .Milliseconds (), 10 ),
155+ strconv .FormatInt (d .InclusionDelay .Milliseconds (), 10 ),
156156 }
157157 if err := writer .Write (row ); err != nil {
158158 log .Fatalf ("Failed to write to file: %v" , err )
@@ -211,10 +211,10 @@ func timeTransaction(chainId *big.Int, privateKey *ecdsa.PrivateKey, fromAddress
211211 } else {
212212 now := time .Now ()
213213 return stats {
214- SentAt : sentAt ,
215- InclusionDelayMs : now .Sub (sentAt ),
216- TxnHash : tx .Hash ().Hex (),
217- IncludedInBlock : receipt .BlockNumber .Uint64 (),
214+ SentAt : sentAt ,
215+ InclusionDelay : now .Sub (sentAt ),
216+ TxnHash : tx .Hash ().Hex (),
217+ IncludedInBlock : receipt .BlockNumber .Uint64 (),
218218 }, nil
219219 }
220220 }
0 commit comments