Skip to content

Commit

Permalink
feat: clean etherman
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Jul 1, 2024
1 parent a750d45 commit ada2f7e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 186 deletions.
67 changes: 0 additions & 67 deletions etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,73 +842,6 @@ func (etherMan *Client) sequenceBatchesValidium(opts bind.TransactOpts, sequence
return tx, err
}

// BuildTrustedVerifyBatchesTxData builds a []bytes to be sent to the PoE SC method TrustedVerifyBatches.
// func (etherMan *Client) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, inputs *ethmanTypes.FinalProofInputs, beneficiary common.Address) (to *common.Address, data []byte, err error) {
// opts, err := etherMan.generateRandomAuth()
// if err != nil {
// return nil, nil, fmt.Errorf("failed to build trusted verify batches, err: %w", err)
// }
// opts.NoSend = true
// // force nonce, gas limit and gas price to avoid querying it from the chain
// opts.Nonce = big.NewInt(1)
// opts.GasLimit = uint64(1)
// opts.GasPrice = big.NewInt(1)

// var newLocalExitRoot [32]byte
// copy(newLocalExitRoot[:], inputs.NewLocalExitRoot)

// var newStateRoot [32]byte
// copy(newStateRoot[:], inputs.NewStateRoot)

// proof, err := convertProof(inputs.FinalProof.Proof)
// if err != nil {
// log.Errorf("error converting proof. Error: %v, Proof: %s", err, inputs.FinalProof.Proof)
// return nil, nil, err
// }

// const pendStateNum = 0 // TODO hardcoded for now until we implement the pending state feature

// tx, err := etherMan.RollupManager.VerifyBatchesTrustedAggregator(
// &opts,
// etherMan.RollupID,
// pendStateNum,
// lastVerifiedBatch,
// newVerifiedBatch,
// newLocalExitRoot,
// newStateRoot,
// beneficiary,
// proof,
// )
// if err != nil {
// if parsedErr, ok := tryParseError(err); ok {
// err = parsedErr
// }
// return nil, nil, err
// }

// return tx.To(), tx.Data(), nil
// return nil, nil, nil
// }

// func convertProof(p string) ([24][32]byte, error) {
// if len(p) != 24*32*2+2 {
// return [24][32]byte{}, fmt.Errorf("invalid proof length. Length: %d", len(p))
// }
// p = strings.TrimPrefix(p, "0x")
// proof := [24][32]byte{}
// for i := 0; i < 24; i++ {
// data := p[i*64 : (i+1)*64]
// p, err := encoding.DecodeBytes(&data)
// if err != nil {
// return [24][32]byte{}, fmt.Errorf("failed to decode proof, err: %w", err)
// }
// var aux [32]byte
// copy(aux[:], p)
// proof[i] = aux
// }
// return proof, nil
// }

// GetSendSequenceFee get super/trusted sequencer fee
func (etherMan *Client) GetSendSequenceFee(numBatches uint64) (*big.Int, error) {
f, err := etherMan.RollupManager.GetBatchFee(&bind.CallOpts{Pending: false})
Expand Down
59 changes: 0 additions & 59 deletions etherman/mock_etherscan.go

This file was deleted.

59 changes: 0 additions & 59 deletions etherman/mock_ethgasstation.go

This file was deleted.

1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ require (
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
Expand Down

0 comments on commit ada2f7e

Please sign in to comment.