From cfb125a96f4068c4f92e93167f07b82f66e6d474 Mon Sep 17 00:00:00 2001 From: Benjamin Samuels <1222451+bsamuels453@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:10:42 -0700 Subject: [PATCH] fix tests --- chain/test_chain_test.go | 10 +++---- fuzzing/reversion/artifact.go | 53 ----------------------------------- 2 files changed, 5 insertions(+), 58 deletions(-) diff --git a/chain/test_chain_test.go b/chain/test_chain_test.go index ff0ca589..f5805fbd 100644 --- a/chain/test_chain_test.go +++ b/chain/test_chain_test.go @@ -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. @@ -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. @@ -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. @@ -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. @@ -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() diff --git a/fuzzing/reversion/artifact.go b/fuzzing/reversion/artifact.go index d4751ac2..aa5c90b7 100644 --- a/fuzzing/reversion/artifact.go +++ b/fuzzing/reversion/artifact.go @@ -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 {