remove unused error test, other unused code in tests

This commit is contained in:
Jared Wasinger 2024-12-02 14:47:02 +07:00 committed by Felix Lange
parent 6b5967afd8
commit 2df68eb106
1 changed files with 0 additions and 58 deletions

View File

@ -34,7 +34,6 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"io" "io"
"math/big" "math/big"
"strings"
"testing" "testing"
"time" "time"
) )
@ -63,11 +62,6 @@ func testSetup() (*bind.TransactOpts, *backends.SimulatedBackend, error) {
}, },
) )
_, err := JSON(strings.NewReader(nested_libraries.C1MetaData.ABI))
if err != nil {
return nil, nil, err
}
signer := types.LatestSigner(params.AllDevChainProtocolChanges) signer := types.LatestSigner(params.AllDevChainProtocolChanges)
opts := &bind.TransactOpts{ opts := &bind.TransactOpts{
From: testAddr, From: testAddr,
@ -97,58 +91,6 @@ func testSetup() (*bind.TransactOpts, *backends.SimulatedBackend, error) {
return opts, &bindBackend, nil return opts, &bindBackend, nil
} }
/*
// test deployment and interaction for a basic contract with no library deps
func TestErrors(t *testing.T) {
opts, bindBackend, err := testSetup()
if err != nil {
t.Fatalf("err setting up test: %v", err)
}
defer bindBackend.Backend.Close()
deploymentParams := DeploymentParams{
Contracts: []ContractDeployParams{
{
Meta: solc_errors.CMetaData,
},
},
}
res, err := LinkAndDeploy(opts, bindBackend, deploymentParams)
if err != nil {
t.Fatalf("err: %+v\n", err)
}
bindBackend.Commit()
if len(res.Addrs) != 1 {
t.Fatalf("deployment should have generated 1 addresses. got %d", len(res.Addrs))
}
for _, tx := range res.Txs {
_, err = bind.WaitDeployed(context.Background(), bindBackend, tx)
if err != nil {
t.Fatalf("error deploying library: %+v", err)
}
}
c, err := solc_errors.NewC()
if err != nil {
t.Fatalf("err is %v", err)
}
doInput, err := c.PackFoo()
if err != nil {
t.Fatalf("pack function input err: %v\n", doInput)
}
contractAddr := res.Addrs[solc_errors.CMetaData.Pattern]
contractInstance := &ContractInstance{
Address: contractAddr,
Backend: bindBackend,
}
_, err = Transact(contractInstance, opts, doInput)
if err != nil {
t.Fatalf("err submitting tx: %v", err)
}
}
*/
// test that deploying a contract with library dependencies works, // test that deploying a contract with library dependencies works,
// verifying by calling method on the deployed contract. // verifying by calling method on the deployed contract.
func TestDeploymentLibraries(t *testing.T) { func TestDeploymentLibraries(t *testing.T) {