github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/test/contracts/bin/FailureTest/FailureTest.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package FailureTest 5 6 import ( 7 "errors" 8 "math/big" 9 "strings" 10 11 ethereum "github.com/ethereum/go-ethereum" 12 "github.com/ethereum/go-ethereum/accounts/abi" 13 "github.com/ethereum/go-ethereum/accounts/abi/bind" 14 "github.com/ethereum/go-ethereum/common" 15 "github.com/ethereum/go-ethereum/core/types" 16 "github.com/ethereum/go-ethereum/event" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = errors.New 22 _ = big.NewInt 23 _ = strings.NewReader 24 _ = ethereum.NotFound 25 _ = bind.Bind 26 _ = common.Big1 27 _ = types.BloomLookup 28 _ = event.NewSubscription 29 _ = abi.ConvertType 30 ) 31 32 // FailureTestMetaData contains all meta data concerning the FailureTest contract. 33 var FailureTestMetaData = &bind.MetaData{ 34 ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"from\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"to\",\"type\":\"uint256\"}],\"name\":\"numberChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"storeAndFail\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", 35 Bin: "0x608060405234801561001057600080fd5b5061016c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80636057361d14610046578063b99f3d721461005b578063f2c9ecd81461006e575b600080fd5b61005961005436600461011d565b610083565b005b61005961006936600461011d565b6100c8565b60005460405190815260200160405180910390f35b600080549082905560408051828152602081018490527f64f52b55f0d87dc11f539f2fe367a83c370795772e3312de727215ce118b8fef910160405180910390a15050565b6100d181610083565b60405162461bcd60e51b815260206004820152601860248201527f74686973206d6574686f6420616c77617973206661696c730000000000000000604482015260640160405180910390fd5b60006020828403121561012f57600080fd5b503591905056fea26469706673582212205f0653d69b95544dde31143743c51b6e438ac63084ed44018d865ccfc3ea7c0164736f6c634300080c0033", 36 } 37 38 // FailureTestABI is the input ABI used to generate the binding from. 39 // Deprecated: Use FailureTestMetaData.ABI instead. 40 var FailureTestABI = FailureTestMetaData.ABI 41 42 // FailureTestBin is the compiled bytecode used for deploying new contracts. 43 // Deprecated: Use FailureTestMetaData.Bin instead. 44 var FailureTestBin = FailureTestMetaData.Bin 45 46 // DeployFailureTest deploys a new Ethereum contract, binding an instance of FailureTest to it. 47 func DeployFailureTest(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *FailureTest, error) { 48 parsed, err := FailureTestMetaData.GetAbi() 49 if err != nil { 50 return common.Address{}, nil, nil, err 51 } 52 if parsed == nil { 53 return common.Address{}, nil, nil, errors.New("GetABI returned nil") 54 } 55 56 address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(FailureTestBin), backend) 57 if err != nil { 58 return common.Address{}, nil, nil, err 59 } 60 return address, tx, &FailureTest{FailureTestCaller: FailureTestCaller{contract: contract}, FailureTestTransactor: FailureTestTransactor{contract: contract}, FailureTestFilterer: FailureTestFilterer{contract: contract}}, nil 61 } 62 63 // FailureTest is an auto generated Go binding around an Ethereum contract. 64 type FailureTest struct { 65 FailureTestCaller // Read-only binding to the contract 66 FailureTestTransactor // Write-only binding to the contract 67 FailureTestFilterer // Log filterer for contract events 68 } 69 70 // FailureTestCaller is an auto generated read-only Go binding around an Ethereum contract. 71 type FailureTestCaller struct { 72 contract *bind.BoundContract // Generic contract wrapper for the low level calls 73 } 74 75 // FailureTestTransactor is an auto generated write-only Go binding around an Ethereum contract. 76 type FailureTestTransactor struct { 77 contract *bind.BoundContract // Generic contract wrapper for the low level calls 78 } 79 80 // FailureTestFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 81 type FailureTestFilterer struct { 82 contract *bind.BoundContract // Generic contract wrapper for the low level calls 83 } 84 85 // FailureTestSession is an auto generated Go binding around an Ethereum contract, 86 // with pre-set call and transact options. 87 type FailureTestSession struct { 88 Contract *FailureTest // Generic contract binding to set the session for 89 CallOpts bind.CallOpts // Call options to use throughout this session 90 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 91 } 92 93 // FailureTestCallerSession is an auto generated read-only Go binding around an Ethereum contract, 94 // with pre-set call options. 95 type FailureTestCallerSession struct { 96 Contract *FailureTestCaller // Generic contract caller binding to set the session for 97 CallOpts bind.CallOpts // Call options to use throughout this session 98 } 99 100 // FailureTestTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 101 // with pre-set transact options. 102 type FailureTestTransactorSession struct { 103 Contract *FailureTestTransactor // Generic contract transactor binding to set the session for 104 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 105 } 106 107 // FailureTestRaw is an auto generated low-level Go binding around an Ethereum contract. 108 type FailureTestRaw struct { 109 Contract *FailureTest // Generic contract binding to access the raw methods on 110 } 111 112 // FailureTestCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 113 type FailureTestCallerRaw struct { 114 Contract *FailureTestCaller // Generic read-only contract binding to access the raw methods on 115 } 116 117 // FailureTestTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 118 type FailureTestTransactorRaw struct { 119 Contract *FailureTestTransactor // Generic write-only contract binding to access the raw methods on 120 } 121 122 // NewFailureTest creates a new instance of FailureTest, bound to a specific deployed contract. 123 func NewFailureTest(address common.Address, backend bind.ContractBackend) (*FailureTest, error) { 124 contract, err := bindFailureTest(address, backend, backend, backend) 125 if err != nil { 126 return nil, err 127 } 128 return &FailureTest{FailureTestCaller: FailureTestCaller{contract: contract}, FailureTestTransactor: FailureTestTransactor{contract: contract}, FailureTestFilterer: FailureTestFilterer{contract: contract}}, nil 129 } 130 131 // NewFailureTestCaller creates a new read-only instance of FailureTest, bound to a specific deployed contract. 132 func NewFailureTestCaller(address common.Address, caller bind.ContractCaller) (*FailureTestCaller, error) { 133 contract, err := bindFailureTest(address, caller, nil, nil) 134 if err != nil { 135 return nil, err 136 } 137 return &FailureTestCaller{contract: contract}, nil 138 } 139 140 // NewFailureTestTransactor creates a new write-only instance of FailureTest, bound to a specific deployed contract. 141 func NewFailureTestTransactor(address common.Address, transactor bind.ContractTransactor) (*FailureTestTransactor, error) { 142 contract, err := bindFailureTest(address, nil, transactor, nil) 143 if err != nil { 144 return nil, err 145 } 146 return &FailureTestTransactor{contract: contract}, nil 147 } 148 149 // NewFailureTestFilterer creates a new log filterer instance of FailureTest, bound to a specific deployed contract. 150 func NewFailureTestFilterer(address common.Address, filterer bind.ContractFilterer) (*FailureTestFilterer, error) { 151 contract, err := bindFailureTest(address, nil, nil, filterer) 152 if err != nil { 153 return nil, err 154 } 155 return &FailureTestFilterer{contract: contract}, nil 156 } 157 158 // bindFailureTest binds a generic wrapper to an already deployed contract. 159 func bindFailureTest(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 160 parsed, err := FailureTestMetaData.GetAbi() 161 if err != nil { 162 return nil, err 163 } 164 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 165 } 166 167 // Call invokes the (constant) contract method with params as input values and 168 // sets the output to result. The result type might be a single field for simple 169 // returns, a slice of interfaces for anonymous returns and a struct for named 170 // returns. 171 func (_FailureTest *FailureTestRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 172 return _FailureTest.Contract.FailureTestCaller.contract.Call(opts, result, method, params...) 173 } 174 175 // Transfer initiates a plain transaction to move funds to the contract, calling 176 // its default method if one is available. 177 func (_FailureTest *FailureTestRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 178 return _FailureTest.Contract.FailureTestTransactor.contract.Transfer(opts) 179 } 180 181 // Transact invokes the (paid) contract method with params as input values. 182 func (_FailureTest *FailureTestRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 183 return _FailureTest.Contract.FailureTestTransactor.contract.Transact(opts, method, params...) 184 } 185 186 // Call invokes the (constant) contract method with params as input values and 187 // sets the output to result. The result type might be a single field for simple 188 // returns, a slice of interfaces for anonymous returns and a struct for named 189 // returns. 190 func (_FailureTest *FailureTestCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 191 return _FailureTest.Contract.contract.Call(opts, result, method, params...) 192 } 193 194 // Transfer initiates a plain transaction to move funds to the contract, calling 195 // its default method if one is available. 196 func (_FailureTest *FailureTestTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 197 return _FailureTest.Contract.contract.Transfer(opts) 198 } 199 200 // Transact invokes the (paid) contract method with params as input values. 201 func (_FailureTest *FailureTestTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 202 return _FailureTest.Contract.contract.Transact(opts, method, params...) 203 } 204 205 // GetNumber is a free data retrieval call binding the contract method 0xf2c9ecd8. 206 // 207 // Solidity: function getNumber() view returns(uint256) 208 func (_FailureTest *FailureTestCaller) GetNumber(opts *bind.CallOpts) (*big.Int, error) { 209 var out []interface{} 210 err := _FailureTest.contract.Call(opts, &out, "getNumber") 211 212 if err != nil { 213 return *new(*big.Int), err 214 } 215 216 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 217 218 return out0, err 219 220 } 221 222 // GetNumber is a free data retrieval call binding the contract method 0xf2c9ecd8. 223 // 224 // Solidity: function getNumber() view returns(uint256) 225 func (_FailureTest *FailureTestSession) GetNumber() (*big.Int, error) { 226 return _FailureTest.Contract.GetNumber(&_FailureTest.CallOpts) 227 } 228 229 // GetNumber is a free data retrieval call binding the contract method 0xf2c9ecd8. 230 // 231 // Solidity: function getNumber() view returns(uint256) 232 func (_FailureTest *FailureTestCallerSession) GetNumber() (*big.Int, error) { 233 return _FailureTest.Contract.GetNumber(&_FailureTest.CallOpts) 234 } 235 236 // Store is a paid mutator transaction binding the contract method 0x6057361d. 237 // 238 // Solidity: function store(uint256 num) returns() 239 func (_FailureTest *FailureTestTransactor) Store(opts *bind.TransactOpts, num *big.Int) (*types.Transaction, error) { 240 return _FailureTest.contract.Transact(opts, "store", num) 241 } 242 243 // Store is a paid mutator transaction binding the contract method 0x6057361d. 244 // 245 // Solidity: function store(uint256 num) returns() 246 func (_FailureTest *FailureTestSession) Store(num *big.Int) (*types.Transaction, error) { 247 return _FailureTest.Contract.Store(&_FailureTest.TransactOpts, num) 248 } 249 250 // Store is a paid mutator transaction binding the contract method 0x6057361d. 251 // 252 // Solidity: function store(uint256 num) returns() 253 func (_FailureTest *FailureTestTransactorSession) Store(num *big.Int) (*types.Transaction, error) { 254 return _FailureTest.Contract.Store(&_FailureTest.TransactOpts, num) 255 } 256 257 // StoreAndFail is a paid mutator transaction binding the contract method 0xb99f3d72. 258 // 259 // Solidity: function storeAndFail(uint256 num) returns() 260 func (_FailureTest *FailureTestTransactor) StoreAndFail(opts *bind.TransactOpts, num *big.Int) (*types.Transaction, error) { 261 return _FailureTest.contract.Transact(opts, "storeAndFail", num) 262 } 263 264 // StoreAndFail is a paid mutator transaction binding the contract method 0xb99f3d72. 265 // 266 // Solidity: function storeAndFail(uint256 num) returns() 267 func (_FailureTest *FailureTestSession) StoreAndFail(num *big.Int) (*types.Transaction, error) { 268 return _FailureTest.Contract.StoreAndFail(&_FailureTest.TransactOpts, num) 269 } 270 271 // StoreAndFail is a paid mutator transaction binding the contract method 0xb99f3d72. 272 // 273 // Solidity: function storeAndFail(uint256 num) returns() 274 func (_FailureTest *FailureTestTransactorSession) StoreAndFail(num *big.Int) (*types.Transaction, error) { 275 return _FailureTest.Contract.StoreAndFail(&_FailureTest.TransactOpts, num) 276 } 277 278 // FailureTestNumberChangedIterator is returned from FilterNumberChanged and is used to iterate over the raw logs and unpacked data for NumberChanged events raised by the FailureTest contract. 279 type FailureTestNumberChangedIterator struct { 280 Event *FailureTestNumberChanged // Event containing the contract specifics and raw log 281 282 contract *bind.BoundContract // Generic contract to use for unpacking event data 283 event string // Event name to use for unpacking event data 284 285 logs chan types.Log // Log channel receiving the found contract events 286 sub ethereum.Subscription // Subscription for errors, completion and termination 287 done bool // Whether the subscription completed delivering logs 288 fail error // Occurred error to stop iteration 289 } 290 291 // Next advances the iterator to the subsequent event, returning whether there 292 // are any more events found. In case of a retrieval or parsing error, false is 293 // returned and Error() can be queried for the exact failure. 294 func (it *FailureTestNumberChangedIterator) Next() bool { 295 // If the iterator failed, stop iterating 296 if it.fail != nil { 297 return false 298 } 299 // If the iterator completed, deliver directly whatever's available 300 if it.done { 301 select { 302 case log := <-it.logs: 303 it.Event = new(FailureTestNumberChanged) 304 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 305 it.fail = err 306 return false 307 } 308 it.Event.Raw = log 309 return true 310 311 default: 312 return false 313 } 314 } 315 // Iterator still in progress, wait for either a data or an error event 316 select { 317 case log := <-it.logs: 318 it.Event = new(FailureTestNumberChanged) 319 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 320 it.fail = err 321 return false 322 } 323 it.Event.Raw = log 324 return true 325 326 case err := <-it.sub.Err(): 327 it.done = true 328 it.fail = err 329 return it.Next() 330 } 331 } 332 333 // Error returns any retrieval or parsing error occurred during filtering. 334 func (it *FailureTestNumberChangedIterator) Error() error { 335 return it.fail 336 } 337 338 // Close terminates the iteration process, releasing any pending underlying 339 // resources. 340 func (it *FailureTestNumberChangedIterator) Close() error { 341 it.sub.Unsubscribe() 342 return nil 343 } 344 345 // FailureTestNumberChanged represents a NumberChanged event raised by the FailureTest contract. 346 type FailureTestNumberChanged struct { 347 From *big.Int 348 To *big.Int 349 Raw types.Log // Blockchain specific contextual infos 350 } 351 352 // FilterNumberChanged is a free log retrieval operation binding the contract event 0x64f52b55f0d87dc11f539f2fe367a83c370795772e3312de727215ce118b8fef. 353 // 354 // Solidity: event numberChanged(uint256 from, uint256 to) 355 func (_FailureTest *FailureTestFilterer) FilterNumberChanged(opts *bind.FilterOpts) (*FailureTestNumberChangedIterator, error) { 356 357 logs, sub, err := _FailureTest.contract.FilterLogs(opts, "numberChanged") 358 if err != nil { 359 return nil, err 360 } 361 return &FailureTestNumberChangedIterator{contract: _FailureTest.contract, event: "numberChanged", logs: logs, sub: sub}, nil 362 } 363 364 // WatchNumberChanged is a free log subscription operation binding the contract event 0x64f52b55f0d87dc11f539f2fe367a83c370795772e3312de727215ce118b8fef. 365 // 366 // Solidity: event numberChanged(uint256 from, uint256 to) 367 func (_FailureTest *FailureTestFilterer) WatchNumberChanged(opts *bind.WatchOpts, sink chan<- *FailureTestNumberChanged) (event.Subscription, error) { 368 369 logs, sub, err := _FailureTest.contract.WatchLogs(opts, "numberChanged") 370 if err != nil { 371 return nil, err 372 } 373 return event.NewSubscription(func(quit <-chan struct{}) error { 374 defer sub.Unsubscribe() 375 for { 376 select { 377 case log := <-logs: 378 // New log arrived, parse the event and forward to the user 379 event := new(FailureTestNumberChanged) 380 if err := _FailureTest.contract.UnpackLog(event, "numberChanged", log); err != nil { 381 return err 382 } 383 event.Raw = log 384 385 select { 386 case sink <- event: 387 case err := <-sub.Err(): 388 return err 389 case <-quit: 390 return nil 391 } 392 case err := <-sub.Err(): 393 return err 394 case <-quit: 395 return nil 396 } 397 } 398 }), nil 399 } 400 401 // ParseNumberChanged is a log parse operation binding the contract event 0x64f52b55f0d87dc11f539f2fe367a83c370795772e3312de727215ce118b8fef. 402 // 403 // Solidity: event numberChanged(uint256 from, uint256 to) 404 func (_FailureTest *FailureTestFilterer) ParseNumberChanged(log types.Log) (*FailureTestNumberChanged, error) { 405 event := new(FailureTestNumberChanged) 406 if err := _FailureTest.contract.UnpackLog(event, "numberChanged", log); err != nil { 407 return nil, err 408 } 409 event.Raw = log 410 return event, nil 411 }