Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsamuels453 committed Aug 28, 2024
1 parent b6411ea commit cfb125a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 58 deletions.
10 changes: 5 additions & 5 deletions chain/test_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func TestChainDynamicDeployments(t *testing.T) {
assert.NoError(t, err)

// Add our transaction to the block
err = chain.PendingBlockAddTx(&msg)
err, _ = chain.PendingBlockAddTx(&msg)
assert.NoError(t, err)

// Commit the pending block to the chain, so it becomes the new head.
Expand Down Expand Up @@ -385,7 +385,7 @@ func TestChainDeploymentWithArgs(t *testing.T) {
assert.NoError(t, err)

// Add our transaction to the block
err = chain.PendingBlockAddTx(&msg)
err, _ = chain.PendingBlockAddTx(&msg)
assert.NoError(t, err)

// Commit the pending block to the chain, so it becomes the new head.
Expand Down Expand Up @@ -494,7 +494,7 @@ func TestChainCloning(t *testing.T) {
assert.NoError(t, err)

// Add our transaction to the block
err = chain.PendingBlockAddTx(&msg)
err, _ = chain.PendingBlockAddTx(&msg)
assert.NoError(t, err)

// Commit the pending block to the chain, so it becomes the new head.
Expand Down Expand Up @@ -588,7 +588,7 @@ func TestChainCallSequenceReplayMatchSimple(t *testing.T) {
assert.NoError(t, err)

// Add our transaction to the block
err = chain.PendingBlockAddTx(&msg)
err, _ = chain.PendingBlockAddTx(&msg)
assert.NoError(t, err)

// Commit the pending block to the chain, so it becomes the new head.
Expand Down Expand Up @@ -627,7 +627,7 @@ func TestChainCallSequenceReplayMatchSimple(t *testing.T) {
_, err := recreatedChain.PendingBlockCreate()
assert.NoError(t, err)
for _, message := range chain.blocks[i].Messages {
err = recreatedChain.PendingBlockAddTx(message)
err, _ = recreatedChain.PendingBlockAddTx(message)
assert.NoError(t, err)
}
err = recreatedChain.PendingBlockCommit()
Expand Down
53 changes: 0 additions & 53 deletions fuzzing/reversion/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,59 +125,6 @@ func (r *ReportArtifact) ConvertToHtml(buf io.Writer) error {

err = tmpl.Execute(buf, r)
return err

/*
writer := md.NewMarkdown(buf)
writer.H1("Reversion Metrics")
for _, funcArtifact := range r.FunctionArtifacts {
//writer.H3(fmt.Sprintf("",funcArtifact.Name))
rows := [][]string{}
header := []string{
"Function Name",
"Revert Reason",
"Count",
"Percent Attributed",
"Change vs. Prev Run",
"Percent Attributed in Prev Run",
}
for _, revertArtifact := range funcArtifact.RevertReasons {
diffValue := "No prev. data"
prevValue := diffValue
if revertArtifact.PrevPctAttributed != nil {
prevValue = fmt.Sprintf("%0.1f%%", float64(*revertArtifact.PrevPctAttributed)*100)
change := (revertArtifact.PctAttributed - *revertArtifact.PrevPctAttributed) / math.Abs(*revertArtifact.PrevPctAttributed)
if change > 0 {
diffValue = fmt.Sprintf("Increased by %.1f%%", float64(change)*100)
} else {
diffValue = fmt.Sprintf("Decreased by %.1f%%", float64(change)*-100)
}
}
row := []string{
funcArtifact.Name,
revertArtifact.Reason,
fmt.Sprintf("%d", revertArtifact.Total),
fmt.Sprintf("%0.1f%%", revertArtifact.PctAttributed*100),
diffValue,
prevValue,
}
rows = append(rows, row)
}
if len(rows) > 0 {
writer.Table(md.TableSet{
Header: header,
Rows: rows,
})
}
}
err := writer.Build()
return err
*/
}

func (r *ReportArtifact) getFunctionArtifact(funcName string) *FunctionArtifact {
Expand Down

0 comments on commit cfb125a

Please sign in to comment.