github.com/intfoundation/intchain@v0.0.0-20220727031208-4316ad31ca73/accounts/abi/bind/util_test.go (about)

     1  // Copyright 2016 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package bind_test
    18  
    19  import (
    20  	"github.com/intfoundation/intchain/accounts/abi/bind"
    21  	"github.com/intfoundation/intchain/common"
    22  	"github.com/intfoundation/intchain/crypto"
    23  )
    24  
    25  var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
    26  
    27  var waitDeployedTests = map[string]struct {
    28  	code        string
    29  	gas         uint64
    30  	wantAddress common.Address
    31  	wantErr     error
    32  }{
    33  	"successful deploy": {
    34  		code:        `6060604052600a8060106000396000f360606040526008565b00`,
    35  		gas:         3000000,
    36  		wantAddress: common.HexToAddress("0x3a220f351252089d385b29beca14e27f204c296a"),
    37  	},
    38  	"empty code": {
    39  		code:        ``,
    40  		gas:         300000,
    41  		wantErr:     bind.ErrNoCodeAfterDeploy,
    42  		wantAddress: common.HexToAddress("0x3a220f351252089d385b29beca14e27f204c296a"),
    43  	},
    44  }
    45