query
stringlengths 8
6.75k
| document
stringlengths 9
1.89M
| negatives
listlengths 19
19
| metadata
dict |
---|---|---|---|
NewCardBaseTransactor creates a new writeonly instance of CardBase, bound to a specific deployed contract.
|
func NewCardBaseTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBaseTransactor, error) {
contract, err := bindCardBase(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &CardBaseTransactor{contract: contract}, nil
}
|
[
"func NewCardBase(address common.Address, backend bind.ContractBackend) (*CardBase, error) {\n\tcontract, err := bindCardBase(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func NewBaseSmartContract(parent object.Parent) *BaseSmartContract {\n\t// TODO: NewCompositeHolder\n\treturn &BaseSmartContract{\n\t\tCompositeMap: make(map[string]object.Composite),\n\t\tChildStorage: storage.NewMapStorage(),\n\t\tParent: parent,\n\t}\n}",
"func DeployCardBase(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBase, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBaseBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewStandardTransactor(address common.Address, transactor bind.ContractTransactor) (*StandardTransactor, error) {\n\tcontract, err := bindStandard(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardTransactor{contract: contract}, nil\n}",
"func newBase() *base {\n\treturn &base{\n\t\tDeploymentName: configuration.GetConfiguration().Jenkins.Controller.DeploymentName,\n\t\tDomain: \"\",\n\t\tExistingVolumeClaim: \"\",\n\t\tJenkinsUriPrefix: configuration.GetConfiguration().Jenkins.Controller.DefaultURIPrefix,\n\t\tIPAddress: \"\",\n\t\tNamespace: \"\",\n\t}\n}",
"func (t *DefaultTransactor) NewTransactor(account accounts.Account) (*bind.TransactOpts, error) {\n\tif !t.wallet.Contains(account) {\n\t\treturn nil, errors.New(\"account not found in wallet\")\n\t}\n\treturn &bind.TransactOpts{\n\t\tFrom: account.Address,\n\t\tSigner: func(signer types.Signer, address common.Address, tx *types.Transaction) (*types.Transaction, error) {\n\t\t\tif address != account.Address {\n\t\t\t\treturn nil, errors.New(\"not authorized to sign this account\")\n\t\t\t}\n\t\t\t// Last parameter (chainID) is only relevant when making EIP155 compliant signatures.\n\t\t\t// Since we use only non EIP155 signatures, set this to zero value.\n\t\t\t// For more details, see here (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md).\n\t\t\treturn t.wallet.SignTx(account, tx, big.NewInt(0))\n\t\t},\n\t}, nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func NewBalanceSheetTransactor(address common.Address, transactor bind.ContractTransactor) (*BalanceSheetTransactor, error) {\n\tcontract, err := bindBalanceSheet(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BalanceSheetTransactor{contract: contract}, nil\n}",
"func NewBankTransactor(address common.Address, transactor bind.ContractTransactor) (*BankTransactor, error) {\n\tcontract, err := bindBank(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BankTransactor{contract: contract}, nil\n}",
"func NewSmartcontractTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartcontractTransactor, error) {\n\tcontract, err := bindSmartcontract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractTransactor{contract: contract}, nil\n}",
"func NewRBACTransactor(address common.Address, transactor bind.ContractTransactor) (*RBACTransactor, error) {\n\tcontract, err := bindRBAC(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RBACTransactor{contract: contract}, nil\n}",
"func NewCarTransactor(address common.Address, transactor bind.ContractTransactor) (*CarTransactor, error) {\n\tcontract, err := bindCar(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarTransactor{contract: contract}, nil\n}",
"func NewBaseController() BaseController {\n\tbaseController := BaseController{}\n\treturn baseController\n}",
"func newBaseQueue(\n\tname string, impl queueImpl, store *Store, cfg queueConfig,\n) *baseQueue {\n\t// Use the default process timeout if none specified.\n\tif cfg.processTimeout == 0 {\n\t\tcfg.processTimeout = defaultProcessTimeout\n\t}\n\n\tambient := store.cfg.AmbientCtx\n\n\tif !cfg.acceptsUnsplitRanges && !cfg.needsSystemConfig {\n\t\thelper.Fatalf(\"misconfigured queue: acceptsUnsplitRanges=false requires needsSystemConfig=true; got %+v\", cfg)\n\t}\n\n\tbq := baseQueue{\n\t\tAmbientContext: ambient,\n\t\tname: name,\n\t\timpl: impl,\n\t\tstore: store,\n\t\tqueueConfig: cfg,\n\t\tincoming: make(chan struct{}, 1),\n\t}\n\tbq.mu.Locker = new(syncutil.Mutex)\n\tbq.mu.replicas = map[multiraftbase.GroupID]*replicaItem{}\n\tbq.processMu = new(syncutil.Mutex)\n\n\treturn &bq\n}",
"func NewGenericContract(addr *common.Address, block *Block, trx *Transaction) *Contract {\n\t// make the contract\n\treturn &Contract{\n\t\tType: AccountTypeContract,\n\t\tOrdinalIndex: TransactionIndex(block, trx),\n\t\tAddress: Address(*addr),\n\t\tTransactionHash: trx.Hash,\n\t\tTimeStamp: block.TimeStamp,\n\t\tName: \"\",\n\t\tVersion: \"\",\n\t\tSupportContact: \"\",\n\t\tLicense: \"\",\n\t\tCompiler: \"\",\n\t\tIsOptimized: false,\n\t\tOptimizeRuns: 0,\n\t\tSourceCode: \"\",\n\t\tSourceCodeHash: nil,\n\t\tAbi: \"\",\n\t\tValidated: nil,\n\t}\n}",
"func NewOwnedTransactor(address bgmcommon.Address, transactor bind.ContractTransactor) (*OwnedTransactor, error) {\n\tcontract, err := bindOwned(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedTransactor{contract: contract}, nil\n}",
"func NewMit-raCrowdsaleTransactor(address common.Address, transactor bind.ContractTransactor) (*Mit-raCrowdsaleTransactor, error) {\n\tcontract, err := bindMit-raCrowdsale(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Mit-raCrowdsaleTransactor{contract: contract}, nil\n}",
"func NewCivilTCRContract(address common.Address, backend bind.ContractBackend) (*CivilTCRContract, error) {\n\tcontract, err := bindCivilTCRContract(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CivilTCRContract{CivilTCRContractCaller: CivilTCRContractCaller{contract: contract}, CivilTCRContractTransactor: CivilTCRContractTransactor{contract: contract}, CivilTCRContractFilterer: CivilTCRContractFilterer{contract: contract}}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardBaseFilterer creates a new log filterer instance of CardBase, bound to a specific deployed contract.
|
func NewCardBaseFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBaseFilterer, error) {
contract, err := bindCardBase(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &CardBaseFilterer{contract: contract}, nil
}
|
[
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewCardBase(address common.Address, backend bind.ContractBackend) (*CardBase, error) {\n\tcontract, err := bindCardBase(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func newCaptureFilter(opts FilterOptions) (*captureFilter, error) {\n\tif opts == nil {\n\t\treturn &captureFilter{CaptureFilterOptions: DefaultCaptureFilterOptions()}, nil\n\t}\n\n\tvar capOpts *CaptureFilterOptions\n\tswitch opts.(type) {\n\tcase *CaptureFilterOptions:\n\t\tcapOpts = opts.(*CaptureFilterOptions)\n\t\tbreak\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Need CaptureFilterOptions\")\n\t}\n\n\treturn &captureFilter{CaptureFilterOptions: capOpts}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewBorrowCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapGuardianIterator{contract: _Comptroller.contract, event: \"NewBorrowCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseNewCard)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func newFilterBattery(filters ...Filterer) FilterBattery {\n\tret := FilterBattery{}\n\tfor _, f := range filters {\n\t\tret = append(ret, f)\n\t}\n\treturn ret\n}",
"func NewSuperCoinFilterer(address common.Address, filterer bind.ContractFilterer) (*SuperCoinFilterer, error) {\n\tcontract, err := bindSuperCoin(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SuperCoinFilterer{contract: contract}, nil\n}",
"func NewIFactRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*IFactRegistryFilterer, error) {\n\tcontract, err := bindIFactRegistry(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &IFactRegistryFilterer{contract: contract}, nil\n}",
"func NewBankFilterer(address common.Address, filterer bind.ContractFilterer) (*BankFilterer, error) {\n\tcontract, err := bindBank(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BankFilterer{contract: contract}, nil\n}",
"func NewCarFilterer(address common.Address, filterer bind.ContractFilterer) (*CarFilterer, error) {\n\tcontract, err := bindCar(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarFilterer{contract: contract}, nil\n}",
"func newFilterConsumer() filter.Filter {\n\t// When first called, load the config in\n\tconsumerConfigOnce.Do(func() {\n\t\tif err := initConfigConsumer(); err != nil {\n\t\t\tlogger.Warnf(\"[Hystrix Filter]ShutdownConfig load failed for consumer, error is: %v , will use default\", err)\n\t\t}\n\t})\n\treturn &Filter{COrP: true}\n}",
"func newFilterProvider() filter.Filter {\n\tproviderConfigOnce.Do(func() {\n\t\tif err := initConfigProvider(); err != nil {\n\t\t\tlogger.Warnf(\"[Hystrix Filter]ShutdownConfig load failed for provider, error is: %v , will use default\", err)\n\t\t}\n\t})\n\treturn &Filter{COrP: false}\n}",
"func NewGopherConFilterer(address common.Address, filterer bind.ContractFilterer) (*GopherConFilterer, error) {\n\tcontract, err := bindGopherCon(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GopherConFilterer{contract: contract}, nil\n}",
"func NewCardBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBattlesFilterer, error) {\n\tcontract, err := bindCardBattles(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesFilterer{contract: contract}, nil\n}",
"func NewClonesFilterer(address common.Address, filterer bind.ContractFilterer) (*ClonesFilterer, error) {\n\tcontract, err := bindClones(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesFilterer{contract: contract}, nil\n}",
"func NewLBCFilterer(address common.Address, filterer bind.ContractFilterer) (*LBCFilterer, error) {\n\tcontract, err := bindLBC(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LBCFilterer{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
bindCardBase binds a generic wrapper to an already deployed contract.
|
func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(CardBaseABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
|
[
"func DeployCardBase(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBase, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBaseBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func NewCardBase(address common.Address, backend bind.ContractBackend) (*CardBase, error) {\n\tcontract, err := bindCardBase(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindZBGCard(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ZBGCardABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (c *Container) Bind(i interface{}) {\n iv := reflect.ValueOf(i)\n if iv.Kind() != reflect.Ptr {\n panic(\"Container: invalid type, need pointer\")\n }\n\n // initialize binding\n rt := iv.Elem().Type()\n item := bindItem{zero: reflect.Zero(rt), cmIdx: -1, imIdx: -1}\n item.pool.New = func() interface{} { return reflect.New(rt) }\n\n // get binding info\n if bind, ok := i.(IBind); ok {\n item.info = bind.GetBindInfo(i)\n }\n\n // get method index\n it := iv.Type()\n nm := it.NumMethod()\n for i := 0; i < nm; i++ {\n switch it.Method(i).Name {\n case ConstructMethod:\n item.cmIdx = i\n case InitMethod:\n item.imIdx = i\n }\n }\n\n // get class name\n pkgPath := rt.PkgPath()\n\n if index := strings.Index(pkgPath, \"/\"+ControllerWeb); index >= 0 {\n pkgPath = pkgPath[index+1:]\n }\n\n if index := strings.Index(pkgPath, \"/\"+ControllerCmd); index >= 0 {\n pkgPath = pkgPath[index+1:]\n }\n\n name := pkgPath + \"/\" + rt.Name()\n\n if len(name) > VendorLength && name[:VendorLength] == VendorPrefix {\n name = name[VendorLength:]\n }\n\n c.items[name] = &item\n}",
"func bindStandard(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(StandardABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor), nil\n}",
"func (me *Buffer) BindBase(index gl.Uint) {\r\n\tgl.BindBufferBase(me.GlTarget, index, me.GlHandle)\r\n}",
"func NewBaseSmartContract(parent object.Parent) *BaseSmartContract {\n\t// TODO: NewCompositeHolder\n\treturn &BaseSmartContract{\n\t\tCompositeMap: make(map[string]object.Composite),\n\t\tChildStorage: storage.NewMapStorage(),\n\t\tParent: parent,\n\t}\n}",
"func bindBank(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BankABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindDropkitContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(DropkitContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (serviceBroker *ServiceBroker) Bind(ctx context.Context, instanceID, bindingID string, details brokerapi.BindDetails, asyncAllowed bool) (brokerapi.Binding, error) {\n\tvar binding brokerapi.Binding\n\tlog.Println(\"Bind a new Service\")\n\n\terr := cf.Bind(serviceBroker.Host, details.BindResource.AppGuid, details.BindResource.SpaceGuid, serviceBroker.Config.CloudFoundry.Username, serviceBroker.Config.CloudFoundry.Password, serviceBroker.Config.DNS.Domain)\n\tif err != nil {\n\t\t//return binding, err\n\t\tlog.Printf(\"Error: %s\", err)\n\t\treturn binding, nil\n\t}\n\n\treturn binding, nil\n}",
"func bindVRFRequestIDBaseTestHelper(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(VRFRequestIDBaseTestHelperABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindPinStorage(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(PinStorageABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func bindComptroller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ComptrollerABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (b *BrokerOperations) Bind(instance_id, binding_id string, breq *openservicebroker.BindRequest) *openservicebroker.Response {\n\t// Find the service instance that is being bound to\n\tsi, err := b.Client.ServiceInstances(broker.Namespace).Get(instance_id, metav1.GetOptions{})\n\tif err != nil {\n\t\tif errors.IsNotFound(err) {\n\t\t\treturn &openservicebroker.Response{http.StatusGone, &openservicebroker.BindResponse{}, nil}\n\t\t}\n\t\treturn &openservicebroker.Response{http.StatusInternalServerError, nil, err}\n\t}\n\n\t// in principle, bind should alter state somewhere\n\n\t// Create some credentials to return. In this case the credentials are\n\t// pulled from the service instance but a real broker might\n\t// return unique credentials for each binding so that multiple users\n\t// of a service instance are not sharing credentials.\n\tcredentials := map[string]interface{}{}\n\tcredentials[\"credential\"] = si.Spec.Credential\n\n\treturn &openservicebroker.Response{\n\t\tCode: http.StatusCreated,\n\t\tBody: &openservicebroker.BindResponse{Credentials: credentials},\n\t\tErr: nil,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
FilterContractUpgrade is a free log retrieval operation binding the contract event 0x450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa446199305. Solidity: event ContractUpgrade(newContract address)
|
func (_CardBase *CardBaseFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CardBaseContractUpgradeIterator, error) {
logs, sub, err := _CardBase.contract.FilterLogs(opts, "ContractUpgrade")
if err != nil {
return nil, err
}
return &CardBaseContractUpgradeIterator{contract: _CardBase.contract, event: "ContractUpgrade", logs: logs, sub: sub}, nil
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CryptoCardsCoreContractUpgradeIterator, error) {\n\n\tlogs, sub, err := _CryptoCardsCore.contract.FilterLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreContractUpgradeIterator{contract: _CryptoCardsCore.contract, event: \"ContractUpgrade\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBattlesContractUpgrade) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesContractUpgrade)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"ContractUpgrade\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBaseContractUpgrade) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseContractUpgrade)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"ContractUpgrade\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*TransparentUpgradeableProxyUpgradedIterator, error) {\n\n\tvar implementationRule []interface{}\n\tfor _, implementationItem := range implementation {\n\t\timplementationRule = append(implementationRule, implementationItem)\n\t}\n\n\tlogs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, \"Upgraded\", implementationRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TransparentUpgradeableProxyUpgradedIterator{contract: _TransparentUpgradeableProxy.contract, event: \"Upgraded\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewCloseFactor(opts *bind.FilterOpts) (*ComptrollerNewCloseFactorIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewCloseFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewCloseFactorIterator{contract: _Comptroller.contract, event: \"NewCloseFactor\", logs: logs, sub: sub}, nil\n}",
"func (_VorCoordinator *VorCoordinatorFilterer) FilterChangeFee(opts *bind.FilterOpts) (*VorCoordinatorChangeFeeIterator, error) {\n\n\tlogs, sub, err := _VorCoordinator.contract.FilterLogs(opts, \"ChangeFee\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &VorCoordinatorChangeFeeIterator{contract: _VorCoordinator.contract, event: \"ChangeFee\", logs: logs, sub: sub}, nil\n}",
"func (c *EventCollector) FilterAddedNewsroomContract(newsroomAddr common.Address) ([]*model.Event, error) {\n\tnwsrmFilterer := filterer.NewNewsroomContractFilterers(newsroomAddr)\n\tc.updateFiltererStartingBlock(nwsrmFilterer)\n\tretrieve := retriever.NewEventRetriever(c.httpClient, []model.ContractFilterers{nwsrmFilterer})\n\terr := retrieve.Retrieve()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnwsrmEvents := retrieve.PastEvents\n\treturn nwsrmEvents, nil\n}",
"func (_DNSResolverContract *DNSResolverContractFilterer) FilterUpdated(opts *bind.FilterOpts) (*DNSResolverContractUpdatedIterator, error) {\n\n\tlogs, sub, err := _DNSResolverContract.contract.FilterLogs(opts, \"Updated\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DNSResolverContractUpdatedIterator{contract: _DNSResolverContract.contract, event: \"Updated\", logs: logs, sub: sub}, nil\n}",
"func (_MSContract *MSContractFilterer) FilterEventClosing(opts *bind.FilterOpts) (*MSContractEventClosingIterator, error) {\n\n\tlogs, sub, err := _MSContract.contract.FilterLogs(opts, \"EventClosing\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MSContractEventClosingIterator{contract: _MSContract.contract, event: \"EventClosing\", logs: logs, sub: sub}, nil\n}",
"func (_UniswapV2 *UniswapV2Filterer) FilterBurn(opts *bind.FilterOpts, sender []common.Address, to []common.Address) (*UniswapV2BurnIterator, error) {\n\n\tvar senderRule []interface{}\n\tfor _, senderItem := range sender {\n\t\tsenderRule = append(senderRule, senderItem)\n\t}\n\n\tvar toRule []interface{}\n\tfor _, toItem := range to {\n\t\ttoRule = append(toRule, toItem)\n\t}\n\n\tlogs, sub, err := _UniswapV2.contract.FilterLogs(opts, \"Burn\", senderRule, toRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &UniswapV2BurnIterator{contract: _UniswapV2.contract, event: \"Burn\", logs: logs, sub: sub}, nil\n}",
"func (_Oneinch *OneinchFilterer) FilterImplementationUpdated(opts *bind.FilterOpts, newImpl []common.Address) (*OneinchImplementationUpdatedIterator, error) {\n\n\tvar newImplRule []interface{}\n\tfor _, newImplItem := range newImpl {\n\t\tnewImplRule = append(newImplRule, newImplItem)\n\t}\n\n\tlogs, sub, err := _Oneinch.contract.FilterLogs(opts, \"ImplementationUpdated\", newImplRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OneinchImplementationUpdatedIterator{contract: _Oneinch.contract, event: \"ImplementationUpdated\", logs: logs, sub: sub}, nil\n}",
"func NewUpgradeContractRequest(from *account.Account, module, name string, code []byte, opts ...RequestOption) (*Request, error) {\n\tif from == nil || !from.HasContractAccount() {\n\t\treturn nil, common.ErrInvalidAccount\n\t}\n\n\tif module == \"\" || name == \"\" || len(code) == 0 {\n\t\treturn nil, common.ErrInvalidParam\n\t}\n\n\treqArgs := generateDeployArgs(nil, nil, code, module, \"\", from.GetContractAccount(), name)\n\treturn NewRequest(from, Xkernel3Module, \"\", XkernelUpgradeMethod, reqArgs, \"\", \"\", opts...)\n}",
"func (_TrueUSD *TrueUSDFilterer) FilterChangeBurnBoundsEvent(opts *bind.FilterOpts) (*TrueUSDChangeBurnBoundsEventIterator, error) {\n\n\tlogs, sub, err := _TrueUSD.contract.FilterLogs(opts, \"ChangeBurnBoundsEvent\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TrueUSDChangeBurnBoundsEventIterator{contract: _TrueUSD.contract, event: \"ChangeBurnBoundsEvent\", logs: logs, sub: sub}, nil\n}",
"func (_MultiSigWalletFactoryContract *MultiSigWalletFactoryContractFilterer) FilterContractInstantiation(opts *bind.FilterOpts) (*MultiSigWalletFactoryContractContractInstantiationIterator, error) {\n\n\tlogs, sub, err := _MultiSigWalletFactoryContract.contract.FilterLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MultiSigWalletFactoryContractContractInstantiationIterator{contract: _MultiSigWalletFactoryContract.contract, event: \"ContractInstantiation\", logs: logs, sub: sub}, nil\n}",
"func (_BerryMaster *BerryMasterFilterer) FilterNewBerryAddress(opts *bind.FilterOpts) (*BerryMasterNewBerryAddressIterator, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.FilterLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryMasterNewBerryAddressIterator{contract: _BerryMaster.contract, event: \"NewBerryAddress\", logs: logs, sub: sub}, nil\n}",
"func (_Stakinginfo *StakinginfoFilterer) FilterRewardUpdate(opts *bind.FilterOpts) (*StakinginfoRewardUpdateIterator, error) {\n\n\tlogs, sub, err := _Stakinginfo.contract.FilterLogs(opts, \"RewardUpdate\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StakinginfoRewardUpdateIterator{contract: _Stakinginfo.contract, event: \"RewardUpdate\", logs: logs, sub: sub}, nil\n}",
"func newAuthAccountContractsChangeFunction(\n\tfunctionType *sema.FunctionType,\n\tgauge common.MemoryGauge,\n\thandler AccountContractAdditionHandler,\n\taddressValue interpreter.AddressValue,\n\tisUpdate bool,\n) *interpreter.HostFunctionValue {\n\treturn interpreter.NewHostFunctionValue(\n\t\tgauge,\n\t\tfunctionType,\n\t\tfunc(invocation interpreter.Invocation) interpreter.Value {\n\n\t\t\tlocationRange := invocation.LocationRange\n\n\t\t\tconst requiredArgumentCount = 2\n\n\t\t\tnameValue, ok := invocation.Arguments[0].(*interpreter.StringValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tnewCodeValue, ok := invocation.Arguments[1].(*interpreter.ArrayValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tconstructorArguments := invocation.Arguments[requiredArgumentCount:]\n\t\t\tconstructorArgumentTypes := invocation.ArgumentTypes[requiredArgumentCount:]\n\n\t\t\tcode, err := interpreter.ByteArrayValueToByteSlice(invocation.Interpreter, newCodeValue, locationRange)\n\t\t\tif err != nil {\n\t\t\t\tpanic(errors.NewDefaultUserError(\"add requires the second argument to be an array\"))\n\t\t\t}\n\n\t\t\t// Get the existing code\n\n\t\t\tcontractName := nameValue.Str\n\n\t\t\tif contractName == \"\" {\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"contract name argument cannot be empty.\" +\n\t\t\t\t\t\t\"it must match the name of the deployed contract declaration or contract interface declaration\",\n\t\t\t\t))\n\t\t\t}\n\n\t\t\taddress := addressValue.ToAddress()\n\t\t\tlocation := common.NewAddressLocation(invocation.Interpreter, address, contractName)\n\n\t\t\texistingCode, err := handler.GetAccountContractCode(location)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tif isUpdate {\n\t\t\t\t// We are updating an existing contract.\n\t\t\t\t// Ensure that there's a contract/contract-interface with the given name exists already\n\n\t\t\t\tif len(existingCode) == 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot update non-existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// We are adding a new contract.\n\t\t\t\t// Ensure that no contract/contract interface with the given name exists already\n\n\t\t\t\tif len(existingCode) > 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot overwrite existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check the code\n\t\t\thandleContractUpdateError := func(err error) {\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(&InvalidContractDeploymentError{\n\t\t\t\t\tErr: err,\n\t\t\t\t\tLocationRange: locationRange,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// NOTE: do NOT use the program obtained from the host environment, as the current program.\n\t\t\t// Always re-parse and re-check the new program.\n\n\t\t\t// NOTE: *DO NOT* store the program – the new or updated program\n\t\t\t// should not be effective during the execution\n\n\t\t\tconst getAndSetProgram = false\n\n\t\t\tprogram, err := handler.ParseAndCheckProgram(\n\t\t\t\tcode,\n\t\t\t\tlocation,\n\t\t\t\tgetAndSetProgram,\n\t\t\t)\n\t\t\thandleContractUpdateError(err)\n\n\t\t\t// The code may declare exactly one contract or one contract interface.\n\n\t\t\tvar contractTypes []*sema.CompositeType\n\t\t\tvar contractInterfaceTypes []*sema.InterfaceType\n\n\t\t\tprogram.Elaboration.ForEachGlobalType(func(_ string, variable *sema.Variable) {\n\t\t\t\tswitch ty := variable.Type.(type) {\n\t\t\t\tcase *sema.CompositeType:\n\t\t\t\t\tif ty.Kind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractTypes = append(contractTypes, ty)\n\t\t\t\t\t}\n\n\t\t\t\tcase *sema.InterfaceType:\n\t\t\t\t\tif ty.CompositeKind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractInterfaceTypes = append(contractInterfaceTypes, ty)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar deployedType sema.Type\n\t\t\tvar contractType *sema.CompositeType\n\t\t\tvar contractInterfaceType *sema.InterfaceType\n\t\t\tvar declaredName string\n\t\t\tvar declarationKind common.DeclarationKind\n\n\t\t\tswitch {\n\t\t\tcase len(contractTypes) == 1 && len(contractInterfaceTypes) == 0:\n\t\t\t\tcontractType = contractTypes[0]\n\t\t\t\tdeclaredName = contractType.Identifier\n\t\t\t\tdeployedType = contractType\n\t\t\t\tdeclarationKind = common.DeclarationKindContract\n\t\t\tcase len(contractInterfaceTypes) == 1 && len(contractTypes) == 0:\n\t\t\t\tcontractInterfaceType = contractInterfaceTypes[0]\n\t\t\t\tdeclaredName = contractInterfaceType.Identifier\n\t\t\t\tdeployedType = contractInterfaceType\n\t\t\t\tdeclarationKind = common.DeclarationKindContractInterface\n\t\t\t}\n\n\t\t\tif deployedType == nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the code must declare exactly one contract or contract interface\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// The declared contract or contract interface must have the name\n\t\t\t// passed to the constructor as the first argument\n\n\t\t\tif declaredName != contractName {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the name argument must match the name of the declaration: got %q, expected %q\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t\tcontractName,\n\t\t\t\t\tdeclaredName,\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// Validate the contract update\n\n\t\t\tif isUpdate {\n\t\t\t\toldCode, err := handler.GetAccountContractCode(location)\n\t\t\t\thandleContractUpdateError(err)\n\n\t\t\t\toldProgram, err := parser.ParseProgram(\n\t\t\t\t\tgauge,\n\t\t\t\t\toldCode,\n\t\t\t\t\tparser.Config{},\n\t\t\t\t)\n\n\t\t\t\tif !ignoreUpdatedProgramParserError(err) {\n\t\t\t\t\thandleContractUpdateError(err)\n\t\t\t\t}\n\n\t\t\t\tvalidator := NewContractUpdateValidator(\n\t\t\t\t\tlocation,\n\t\t\t\t\tcontractName,\n\t\t\t\t\toldProgram,\n\t\t\t\t\tprogram.Program,\n\t\t\t\t)\n\t\t\t\terr = validator.Validate()\n\t\t\t\thandleContractUpdateError(err)\n\t\t\t}\n\n\t\t\tinter := invocation.Interpreter\n\n\t\t\terr = updateAccountContractCode(\n\t\t\t\thandler,\n\t\t\t\tlocation,\n\t\t\t\tprogram,\n\t\t\t\tcode,\n\t\t\t\tcontractType,\n\t\t\t\tconstructorArguments,\n\t\t\t\tconstructorArgumentTypes,\n\t\t\t\tupdateAccountContractCodeOptions{\n\t\t\t\t\tcreateContract: !isUpdate,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tvar eventType *sema.CompositeType\n\n\t\t\tif isUpdate {\n\t\t\t\teventType = AccountContractUpdatedEventType\n\t\t\t} else {\n\t\t\t\teventType = AccountContractAddedEventType\n\t\t\t}\n\n\t\t\tcodeHashValue := CodeToHashValue(inter, code)\n\n\t\t\thandler.EmitEvent(\n\t\t\t\tinter,\n\t\t\t\teventType,\n\t\t\t\t[]interpreter.Value{\n\t\t\t\t\taddressValue,\n\t\t\t\t\tcodeHashValue,\n\t\t\t\t\tnameValue,\n\t\t\t\t},\n\t\t\t\tlocationRange,\n\t\t\t)\n\n\t\t\treturn interpreter.NewDeployedContractValue(\n\t\t\t\tinter,\n\t\t\t\taddressValue,\n\t\t\t\tnameValue,\n\t\t\t\tnewCodeValue,\n\t\t\t)\n\t\t},\n\t)\n}",
"func (_HoQuPlatform *HoQuPlatformFilterer) FilterLeadPriceChanged(opts *bind.FilterOpts, contractAddress []common.Address) (*HoQuPlatformLeadPriceChangedIterator, error) {\n\n\tvar contractAddressRule []interface{}\n\tfor _, contractAddressItem := range contractAddress {\n\t\tcontractAddressRule = append(contractAddressRule, contractAddressItem)\n\t}\n\n\tlogs, sub, err := _HoQuPlatform.contract.FilterLogs(opts, \"LeadPriceChanged\", contractAddressRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HoQuPlatformLeadPriceChangedIterator{contract: _HoQuPlatform.contract, event: \"LeadPriceChanged\", logs: logs, sub: sub}, nil\n}",
"func (_NewsroomFactory *NewsroomFactoryFilterer) FilterContractInstantiation(opts *bind.FilterOpts) (*NewsroomFactoryContractInstantiationIterator, error) {\n\n\tlogs, sub, err := _NewsroomFactory.contract.FilterLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &NewsroomFactoryContractInstantiationIterator{contract: _NewsroomFactory.contract, event: \"ContractInstantiation\", logs: logs, sub: sub}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WatchContractUpgrade is a free log subscription operation binding the contract event 0x450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa446199305. Solidity: event ContractUpgrade(newContract address)
|
func (_CardBase *CardBaseFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBaseContractUpgrade) (event.Subscription, error) {
logs, sub, err := _CardBase.contract.WatchLogs(opts, "ContractUpgrade")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(CardBaseContractUpgrade)
if err := _CardBase.contract.UnpackLog(event, "ContractUpgrade", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
|
[
"func (_CardBattles *CardBattlesFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBattlesContractUpgrade) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesContractUpgrade)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"ContractUpgrade\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CardBaseContractUpgradeIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseContractUpgradeIterator{contract: _CardBase.contract, event: \"ContractUpgrade\", logs: logs, sub: sub}, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CryptoCardsCoreContractUpgradeIterator, error) {\n\n\tlogs, sub, err := _CryptoCardsCore.contract.FilterLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreContractUpgradeIterator{contract: _CryptoCardsCore.contract, event: \"ContractUpgrade\", logs: logs, sub: sub}, nil\n}",
"func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyUpgraded, implementation []common.Address) (event.Subscription, error) {\n\n\tvar implementationRule []interface{}\n\tfor _, implementationItem := range implementation {\n\t\timplementationRule = append(implementationRule, implementationItem)\n\t}\n\n\tlogs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, \"Upgraded\", implementationRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(TransparentUpgradeableProxyUpgraded)\n\t\t\t\tif err := _TransparentUpgradeableProxy.contract.UnpackLog(event, \"Upgraded\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_MultiSigWalletFactoryContract *MultiSigWalletFactoryContractFilterer) WatchContractInstantiation(opts *bind.WatchOpts, sink chan<- *MultiSigWalletFactoryContractContractInstantiation) (event.Subscription, error) {\n\n\tlogs, sub, err := _MultiSigWalletFactoryContract.contract.WatchLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(MultiSigWalletFactoryContractContractInstantiation)\n\t\t\t\tif err := _MultiSigWalletFactoryContract.contract.UnpackLog(event, \"ContractInstantiation\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_LBC *LBCFilterer) WatchBalanceIncrease(opts *bind.WatchOpts, sink chan<- *LBCBalanceIncrease) (event.Subscription, error) {\n\n\tlogs, sub, err := _LBC.contract.WatchLogs(opts, \"BalanceIncrease\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(LBCBalanceIncrease)\n\t\t\t\tif err := _LBC.contract.UnpackLog(event, \"BalanceIncrease\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_NewsroomFactory *NewsroomFactoryFilterer) WatchContractInstantiation(opts *bind.WatchOpts, sink chan<- *NewsroomFactoryContractInstantiation) (event.Subscription, error) {\n\n\tlogs, sub, err := _NewsroomFactory.contract.WatchLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(NewsroomFactoryContractInstantiation)\n\t\t\t\tif err := _NewsroomFactory.contract.UnpackLog(event, \"ContractInstantiation\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func newAuthAccountContractsChangeFunction(\n\tfunctionType *sema.FunctionType,\n\tgauge common.MemoryGauge,\n\thandler AccountContractAdditionHandler,\n\taddressValue interpreter.AddressValue,\n\tisUpdate bool,\n) *interpreter.HostFunctionValue {\n\treturn interpreter.NewHostFunctionValue(\n\t\tgauge,\n\t\tfunctionType,\n\t\tfunc(invocation interpreter.Invocation) interpreter.Value {\n\n\t\t\tlocationRange := invocation.LocationRange\n\n\t\t\tconst requiredArgumentCount = 2\n\n\t\t\tnameValue, ok := invocation.Arguments[0].(*interpreter.StringValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tnewCodeValue, ok := invocation.Arguments[1].(*interpreter.ArrayValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tconstructorArguments := invocation.Arguments[requiredArgumentCount:]\n\t\t\tconstructorArgumentTypes := invocation.ArgumentTypes[requiredArgumentCount:]\n\n\t\t\tcode, err := interpreter.ByteArrayValueToByteSlice(invocation.Interpreter, newCodeValue, locationRange)\n\t\t\tif err != nil {\n\t\t\t\tpanic(errors.NewDefaultUserError(\"add requires the second argument to be an array\"))\n\t\t\t}\n\n\t\t\t// Get the existing code\n\n\t\t\tcontractName := nameValue.Str\n\n\t\t\tif contractName == \"\" {\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"contract name argument cannot be empty.\" +\n\t\t\t\t\t\t\"it must match the name of the deployed contract declaration or contract interface declaration\",\n\t\t\t\t))\n\t\t\t}\n\n\t\t\taddress := addressValue.ToAddress()\n\t\t\tlocation := common.NewAddressLocation(invocation.Interpreter, address, contractName)\n\n\t\t\texistingCode, err := handler.GetAccountContractCode(location)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tif isUpdate {\n\t\t\t\t// We are updating an existing contract.\n\t\t\t\t// Ensure that there's a contract/contract-interface with the given name exists already\n\n\t\t\t\tif len(existingCode) == 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot update non-existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// We are adding a new contract.\n\t\t\t\t// Ensure that no contract/contract interface with the given name exists already\n\n\t\t\t\tif len(existingCode) > 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot overwrite existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check the code\n\t\t\thandleContractUpdateError := func(err error) {\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(&InvalidContractDeploymentError{\n\t\t\t\t\tErr: err,\n\t\t\t\t\tLocationRange: locationRange,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// NOTE: do NOT use the program obtained from the host environment, as the current program.\n\t\t\t// Always re-parse and re-check the new program.\n\n\t\t\t// NOTE: *DO NOT* store the program – the new or updated program\n\t\t\t// should not be effective during the execution\n\n\t\t\tconst getAndSetProgram = false\n\n\t\t\tprogram, err := handler.ParseAndCheckProgram(\n\t\t\t\tcode,\n\t\t\t\tlocation,\n\t\t\t\tgetAndSetProgram,\n\t\t\t)\n\t\t\thandleContractUpdateError(err)\n\n\t\t\t// The code may declare exactly one contract or one contract interface.\n\n\t\t\tvar contractTypes []*sema.CompositeType\n\t\t\tvar contractInterfaceTypes []*sema.InterfaceType\n\n\t\t\tprogram.Elaboration.ForEachGlobalType(func(_ string, variable *sema.Variable) {\n\t\t\t\tswitch ty := variable.Type.(type) {\n\t\t\t\tcase *sema.CompositeType:\n\t\t\t\t\tif ty.Kind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractTypes = append(contractTypes, ty)\n\t\t\t\t\t}\n\n\t\t\t\tcase *sema.InterfaceType:\n\t\t\t\t\tif ty.CompositeKind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractInterfaceTypes = append(contractInterfaceTypes, ty)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar deployedType sema.Type\n\t\t\tvar contractType *sema.CompositeType\n\t\t\tvar contractInterfaceType *sema.InterfaceType\n\t\t\tvar declaredName string\n\t\t\tvar declarationKind common.DeclarationKind\n\n\t\t\tswitch {\n\t\t\tcase len(contractTypes) == 1 && len(contractInterfaceTypes) == 0:\n\t\t\t\tcontractType = contractTypes[0]\n\t\t\t\tdeclaredName = contractType.Identifier\n\t\t\t\tdeployedType = contractType\n\t\t\t\tdeclarationKind = common.DeclarationKindContract\n\t\t\tcase len(contractInterfaceTypes) == 1 && len(contractTypes) == 0:\n\t\t\t\tcontractInterfaceType = contractInterfaceTypes[0]\n\t\t\t\tdeclaredName = contractInterfaceType.Identifier\n\t\t\t\tdeployedType = contractInterfaceType\n\t\t\t\tdeclarationKind = common.DeclarationKindContractInterface\n\t\t\t}\n\n\t\t\tif deployedType == nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the code must declare exactly one contract or contract interface\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// The declared contract or contract interface must have the name\n\t\t\t// passed to the constructor as the first argument\n\n\t\t\tif declaredName != contractName {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the name argument must match the name of the declaration: got %q, expected %q\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t\tcontractName,\n\t\t\t\t\tdeclaredName,\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// Validate the contract update\n\n\t\t\tif isUpdate {\n\t\t\t\toldCode, err := handler.GetAccountContractCode(location)\n\t\t\t\thandleContractUpdateError(err)\n\n\t\t\t\toldProgram, err := parser.ParseProgram(\n\t\t\t\t\tgauge,\n\t\t\t\t\toldCode,\n\t\t\t\t\tparser.Config{},\n\t\t\t\t)\n\n\t\t\t\tif !ignoreUpdatedProgramParserError(err) {\n\t\t\t\t\thandleContractUpdateError(err)\n\t\t\t\t}\n\n\t\t\t\tvalidator := NewContractUpdateValidator(\n\t\t\t\t\tlocation,\n\t\t\t\t\tcontractName,\n\t\t\t\t\toldProgram,\n\t\t\t\t\tprogram.Program,\n\t\t\t\t)\n\t\t\t\terr = validator.Validate()\n\t\t\t\thandleContractUpdateError(err)\n\t\t\t}\n\n\t\t\tinter := invocation.Interpreter\n\n\t\t\terr = updateAccountContractCode(\n\t\t\t\thandler,\n\t\t\t\tlocation,\n\t\t\t\tprogram,\n\t\t\t\tcode,\n\t\t\t\tcontractType,\n\t\t\t\tconstructorArguments,\n\t\t\t\tconstructorArgumentTypes,\n\t\t\t\tupdateAccountContractCodeOptions{\n\t\t\t\t\tcreateContract: !isUpdate,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tvar eventType *sema.CompositeType\n\n\t\t\tif isUpdate {\n\t\t\t\teventType = AccountContractUpdatedEventType\n\t\t\t} else {\n\t\t\t\teventType = AccountContractAddedEventType\n\t\t\t}\n\n\t\t\tcodeHashValue := CodeToHashValue(inter, code)\n\n\t\t\thandler.EmitEvent(\n\t\t\t\tinter,\n\t\t\t\teventType,\n\t\t\t\t[]interpreter.Value{\n\t\t\t\t\taddressValue,\n\t\t\t\t\tcodeHashValue,\n\t\t\t\t\tnameValue,\n\t\t\t\t},\n\t\t\t\tlocationRange,\n\t\t\t)\n\n\t\t\treturn interpreter.NewDeployedContractValue(\n\t\t\t\tinter,\n\t\t\t\taddressValue,\n\t\t\t\tnameValue,\n\t\t\t\tnewCodeValue,\n\t\t\t)\n\t\t},\n\t)\n}",
"func (_KyberNetworkProxyV4 *KyberNetworkProxyV4Filterer) WatchEtherWithdraw(opts *bind.WatchOpts, sink chan<- *KyberNetworkProxyV4EtherWithdraw) (event.Subscription, error) {\n\n\tlogs, sub, err := _KyberNetworkProxyV4.contract.WatchLogs(opts, \"EtherWithdraw\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(KyberNetworkProxyV4EtherWithdraw)\n\t\t\t\tif err := _KyberNetworkProxyV4.contract.UnpackLog(event, \"EtherWithdraw\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (s *MarketWatch) storeContract(locationID int64, c Contract) (ContractChange, bool) {\n\tsMap := s.getContractStore(locationID)\n\tchange := ContractChange{\n\t\tContractId: c.Contract.Contract.ContractId,\n\t\tLocationId: c.Contract.Contract.StartLocationId,\n\t\tTimeChanged: time.Now().UTC(), // We know this was within 30 minutes of this time\n\t}\n\n\tv, loaded := sMap.LoadOrStore(c.Contract.Contract.ContractId, c)\n\tif loaded {\n\t\tcontract := v.(Contract)\n\t\tif len(contract.Contract.Bids) != len(c.Contract.Bids) {\n\t\t\tchange.Price = contract.Contract.Contract.Price\n\t\t\tchange.Bids = contract.Contract.Bids\n\t\t\tchange.Type_ = contract.Contract.Contract.Type_\n\t\t\tchange.DateExpired = contract.Contract.Contract.DateExpired\n\t\t\tchange.Changed = true\n\t\t}\n\t\tsMap.Store(contract.Contract.Contract.ContractId, contract)\n\t\treturn change, false\n\t}\n\treturn change, true\n}",
"func (_Oneinch *OneinchFilterer) WatchImplementationUpdated(opts *bind.WatchOpts, sink chan<- *OneinchImplementationUpdated, newImpl []common.Address) (event.Subscription, error) {\n\n\tvar newImplRule []interface{}\n\tfor _, newImplItem := range newImpl {\n\t\tnewImplRule = append(newImplRule, newImplItem)\n\t}\n\n\tlogs, sub, err := _Oneinch.contract.WatchLogs(opts, \"ImplementationUpdated\", newImplRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(OneinchImplementationUpdated)\n\t\t\t\tif err := _Oneinch.contract.UnpackLog(event, \"ImplementationUpdated\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_VorCoordinator *VorCoordinatorFilterer) WatchChangeFee(opts *bind.WatchOpts, sink chan<- *VorCoordinatorChangeFee) (event.Subscription, error) {\n\n\tlogs, sub, err := _VorCoordinator.contract.WatchLogs(opts, \"ChangeFee\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(VorCoordinatorChangeFee)\n\t\t\t\tif err := _VorCoordinator.contract.UnpackLog(event, \"ChangeFee\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_MSContract *MSContractFilterer) WatchEventClosing(opts *bind.WatchOpts, sink chan<- *MSContractEventClosing) (event.Subscription, error) {\n\n\tlogs, sub, err := _MSContract.contract.WatchLogs(opts, \"EventClosing\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(MSContractEventClosing)\n\t\t\t\tif err := _MSContract.contract.UnpackLog(event, \"EventClosing\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_BerryMaster *BerryMasterFilterer) WatchNewBerryAddress(opts *bind.WatchOpts, sink chan<- *BerryMasterNewBerryAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.WatchLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(BerryMasterNewBerryAddress)\n\t\t\t\tif err := _BerryMaster.contract.UnpackLog(event, \"NewBerryAddress\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_ILendingPool *ILendingPoolFilterer) WatchReserveDataUpdated(opts *bind.WatchOpts, sink chan<- *ILendingPoolReserveDataUpdated, reserve []common.Address) (event.Subscription, error) {\n\n\tvar reserveRule []interface{}\n\tfor _, reserveItem := range reserve {\n\t\treserveRule = append(reserveRule, reserveItem)\n\t}\n\n\tlogs, sub, err := _ILendingPool.contract.WatchLogs(opts, \"ReserveDataUpdated\", reserveRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ILendingPoolReserveDataUpdated)\n\t\t\t\tif err := _ILendingPool.contract.UnpackLog(event, \"ReserveDataUpdated\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_EthoFSController *EthoFSControllerSession) ExtendContract(HostingContractAddress common.Address, HostingContractExtensionDuration uint32) (*types.Transaction, error) {\n\treturn _EthoFSController.Contract.ExtendContract(&_EthoFSController.TransactOpts, HostingContractAddress, HostingContractExtensionDuration)\n}",
"func (_Stakinginfo *StakinginfoFilterer) WatchRewardUpdate(opts *bind.WatchOpts, sink chan<- *StakinginfoRewardUpdate) (event.Subscription, error) {\n\n\tlogs, sub, err := _Stakinginfo.contract.WatchLogs(opts, \"RewardUpdate\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(StakinginfoRewardUpdate)\n\t\t\t\tif err := _Stakinginfo.contract.UnpackLog(event, \"RewardUpdate\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func NewUpgradeContractRequest(from *account.Account, module, name string, code []byte, opts ...RequestOption) (*Request, error) {\n\tif from == nil || !from.HasContractAccount() {\n\t\treturn nil, common.ErrInvalidAccount\n\t}\n\n\tif module == \"\" || name == \"\" || len(code) == 0 {\n\t\treturn nil, common.ErrInvalidParam\n\t}\n\n\treqArgs := generateDeployArgs(nil, nil, code, module, \"\", from.GetContractAccount(), name)\n\treturn NewRequest(from, Xkernel3Module, \"\", XkernelUpgradeMethod, reqArgs, \"\", \"\", opts...)\n}",
"func (_CrossEther *CrossEtherFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *CrossEtherWithdraw) (event.Subscription, error) {\n\n\tlogs, sub, err := _CrossEther.contract.WatchLogs(opts, \"Withdraw\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CrossEtherWithdraw)\n\t\t\t\tif err := _CrossEther.contract.UnpackLog(event, \"Withdraw\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
FilterNewCard is a free log retrieval operation binding the contract event 0xc56570397f0bcf235fc72dc30f5c4d9c77206bfce1443759a8ee3a19dcd196e4. Solidity: event NewCard(owner address, cardID uint256, creationBattleID uint128, attributes uint256)
|
func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {
logs, sub, err := _CardBase.contract.FilterLogs(opts, "NewCard")
if err != nil {
return nil, err
}
return &CardBaseNewCardIterator{contract: _CardBase.contract, event: "NewCard", logs: logs, sub: sub}, nil
}
|
[
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesNewCard)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseNewCard)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewSupplyCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapIterator{contract: _Comptroller.contract, event: \"NewSupplyCap\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewSupplyCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapGuardianIterator{contract: _Comptroller.contract, event: \"NewSupplyCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewBorrowCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapIterator{contract: _Comptroller.contract, event: \"NewBorrowCap\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewBorrowCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapGuardianIterator{contract: _Comptroller.contract, event: \"NewBorrowCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func (_Pxa *PxaFilterer) FilterNewAsset(opts *bind.FilterOpts) (*PxaNewAssetIterator, error) {\n\n\tlogs, sub, err := _Pxa.contract.FilterLogs(opts, \"NewAsset\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PxaNewAssetIterator{contract: _Pxa.contract, event: \"NewAsset\", logs: logs, sub: sub}, nil\n}",
"func (_BerryMaster *BerryMasterFilterer) FilterNewBerryAddress(opts *bind.FilterOpts) (*BerryMasterNewBerryAddressIterator, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.FilterLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryMasterNewBerryAddressIterator{contract: _BerryMaster.contract, event: \"NewBerryAddress\", logs: logs, sub: sub}, nil\n}",
"func (_ParameterizerContract *ParameterizerContractFilterer) FilterNewChallenge(opts *bind.FilterOpts, propID [][32]byte, challenger []common.Address) (*ParameterizerContractNewChallengeIterator, error) {\n\n\tvar propIDRule []interface{}\n\tfor _, propIDItem := range propID {\n\t\tpropIDRule = append(propIDRule, propIDItem)\n\t}\n\n\tvar challengerRule []interface{}\n\tfor _, challengerItem := range challenger {\n\t\tchallengerRule = append(challengerRule, challengerItem)\n\t}\n\n\tlogs, sub, err := _ParameterizerContract.contract.FilterLogs(opts, \"_NewChallenge\", propIDRule, challengerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ParameterizerContractNewChallengeIterator{contract: _ParameterizerContract.contract, event: \"_NewChallenge\", logs: logs, sub: sub}, nil\n}",
"func (_Paper *PaperFilterer) FilterNewPaper(opts *bind.FilterOpts) (*PaperNewPaperIterator, error) {\n\n\tlogs, sub, err := _Paper.contract.FilterLogs(opts, \"NewPaper\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PaperNewPaperIterator{contract: _Paper.contract, event: \"NewPaper\", logs: logs, sub: sub}, nil\n}",
"func (_BattleGroups *BattleGroupsFilterer) FilterNewBattleGroup(opts *bind.FilterOpts) (*BattleGroupsNewBattleGroupIterator, error) {\n\n\tlogs, sub, err := _BattleGroups.contract.FilterLogs(opts, \"NewBattleGroup\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattleGroupsNewBattleGroupIterator{contract: _BattleGroups.contract, event: \"NewBattleGroup\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewCloseFactor(opts *bind.FilterOpts) (*ComptrollerNewCloseFactorIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewCloseFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewCloseFactorIterator{contract: _Comptroller.contract, event: \"NewCloseFactor\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCapGuardian(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCapGuardian) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCapGuardian)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCapGuardian\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCap(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCap, cToken []common.Address) (event.Subscription, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCap)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCap\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) ParseNewSupplyCap(log types.Log) (*ComptrollerNewSupplyCap, error) {\n\tevent := new(ComptrollerNewSupplyCap)\n\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCap\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}",
"func (_LivroVisitas *LivroVisitasFilterer) FilterNewVisitor(opts *bind.FilterOpts) (*LivroVisitasNewVisitorIterator, error) {\n\n\tlogs, sub, err := _LivroVisitas.contract.FilterLogs(opts, \"NewVisitor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LivroVisitasNewVisitorIterator{contract: _LivroVisitas.contract, event: \"NewVisitor\", logs: logs, sub: sub}, nil\n}",
"func (q *Query) NewFilter(fn FilterFunc) *Filter {\n done := make(chan bool)\n q.done = append(q.done, done)\n f := &Filter{\n in: make(chan *blob.Blob),\n fn: fn,\n out: q.result,\n done: done,\n skip: q.skip,\n }\n q.filters = append(q.filters, f)\n return f\n}",
"func newCaptureFilter(opts FilterOptions) (*captureFilter, error) {\n\tif opts == nil {\n\t\treturn &captureFilter{CaptureFilterOptions: DefaultCaptureFilterOptions()}, nil\n\t}\n\n\tvar capOpts *CaptureFilterOptions\n\tswitch opts.(type) {\n\tcase *CaptureFilterOptions:\n\t\tcapOpts = opts.(*CaptureFilterOptions)\n\t\tbreak\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Need CaptureFilterOptions\")\n\t}\n\n\treturn &captureFilter{CaptureFilterOptions: capOpts}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WatchNewCard is a free log subscription operation binding the contract event 0xc56570397f0bcf235fc72dc30f5c4d9c77206bfce1443759a8ee3a19dcd196e4. Solidity: event NewCard(owner address, cardID uint256, creationBattleID uint128, attributes uint256)
|
func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {
logs, sub, err := _CardBase.contract.WatchLogs(opts, "NewCard")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(CardBaseNewCard)
if err := _CardBase.contract.UnpackLog(event, "NewCard", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
|
[
"func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesNewCard)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCap(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCap, cToken []common.Address) (event.Subscription, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCap)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCap\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCapGuardian(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCapGuardian) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCapGuardian)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCapGuardian\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewBorrowCap(opts *bind.WatchOpts, sink chan<- *ComptrollerNewBorrowCap, cToken []common.Address) (event.Subscription, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewBorrowCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewBorrowCap)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewBorrowCap\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_BerryMaster *BerryMasterFilterer) WatchNewBerryAddress(opts *bind.WatchOpts, sink chan<- *BerryMasterNewBerryAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.WatchLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(BerryMasterNewBerryAddress)\n\t\t\t\tif err := _BerryMaster.contract.UnpackLog(event, \"NewBerryAddress\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"createCard\", _owner, _attributes)\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewBorrowCapGuardian(opts *bind.WatchOpts, sink chan<- *ComptrollerNewBorrowCapGuardian) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewBorrowCapGuardian)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewBorrowCapGuardian\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewSupplyCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapIterator{contract: _Comptroller.contract, event: \"NewSupplyCap\", logs: logs, sub: sub}, nil\n}",
"func (_Pxa *PxaFilterer) WatchNewAsset(opts *bind.WatchOpts, sink chan<- *PxaNewAsset) (event.Subscription, error) {\n\n\tlogs, sub, err := _Pxa.contract.WatchLogs(opts, \"NewAsset\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(PxaNewAsset)\n\t\t\t\tif err := _Pxa.contract.UnpackLog(event, \"NewAsset\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (wts *WTServer) SendNewWatchNewChannel(newChan *channeldb.OpenChannel) error {\n\tmsg := NewWatchNewChannelMessage(newChan)\n\treturn wts.SendToPeers(msg)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)\n}",
"func (s *csServer) Create(ctx context.Context, c *cs.Card) (*cs.Card, error) {\n\n\ttx, err := s.db.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuid, err := tx.CreateCard(c)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\ttx.Rollback()\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\tc.Id = uid\n\n\tlog.Printf(\"created card: %+v\\n\", c)\n\treturn c, nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewCloseFactor(opts *bind.WatchOpts, sink chan<- *ComptrollerNewCloseFactor) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewCloseFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewCloseFactor)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewCloseFactor\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Paper *PaperFilterer) WatchNewPaper(opts *bind.WatchOpts, sink chan<- *PaperNewPaper) (event.Subscription, error) {\n\n\tlogs, sub, err := _Paper.contract.WatchLogs(opts, \"NewPaper\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(PaperNewPaper)\n\t\t\t\tif err := _Paper.contract.UnpackLog(event, \"NewPaper\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_ParameterizerContract *ParameterizerContractFilterer) WatchNewChallenge(opts *bind.WatchOpts, sink chan<- *ParameterizerContractNewChallenge, propID [][32]byte, challenger []common.Address) (event.Subscription, error) {\n\n\tvar propIDRule []interface{}\n\tfor _, propIDItem := range propID {\n\t\tpropIDRule = append(propIDRule, propIDItem)\n\t}\n\n\tvar challengerRule []interface{}\n\tfor _, challengerItem := range challenger {\n\t\tchallengerRule = append(challengerRule, challengerItem)\n\t}\n\n\tlogs, sub, err := _ParameterizerContract.contract.WatchLogs(opts, \"_NewChallenge\", propIDRule, challengerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ParameterizerContractNewChallenge)\n\t\t\t\tif err := _ParameterizerContract.contract.UnpackLog(event, \"_NewChallenge\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (s *Service) createCardHandler(w http.ResponseWriter, r *http.Request) {\n\t// Get the authenticated user from the request context\n\tauthenticatedUser, err := accounts.GetAuthenticatedUser(r)\n\tif err != nil {\n\t\tresponse.UnauthorizedError(w, err.Error())\n\t\treturn\n\t}\n\n\t// Request body cannot be nil\n\tif r.Body == nil {\n\t\tresponse.Error(w, \"Request body cannot be nil\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Read the request body\n\tpayload, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tresponse.Error(w, \"Error reading request body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Unmarshal the request body into the request prototype\n\tcardRequest := new(CardRequest)\n\tif err := json.Unmarshal(payload, cardRequest); err != nil {\n\t\tlogger.ERROR.Printf(\"Failed to unmarshal card request: %s\", payload)\n\t\tresponse.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Create a new card\n\tcard, err := s.createCard(authenticatedUser, cardRequest)\n\tif err != nil {\n\t\tlogger.ERROR.Printf(\"Create card error: %s\", err)\n\t\tresponse.Error(w, err.Error(), getErrStatusCode(err))\n\t\treturn\n\t}\n\n\t// Create response\n\tcardResponse, err := NewCardResponse(card)\n\tif err != nil {\n\t\tresponse.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// Set Location header to the newly created resource\n\tw.Header().Set(\"Location\", fmt.Sprintf(\"/v1/cards/%d\", card.ID))\n\t// Write JSON response\n\tresponse.WriteJSON(w, cardResponse, http.StatusCreated)\n}",
"func (m *MoonpayCustomer) CreateCard(tokenid uuid.UUID) (card Card, err error) {\n\ttype data struct {\n\t\tTokenID uuid.UUID `json:\"tokenId\"`\n\t}\n\tresp, err := req.Post(m.url(\"/cards\"), m.authHeader(), req.BodyJSON(data{tokenid}))\n\tif err := m.handleError(resp, err); err != nil {\n\t\treturn card, err\n\t}\n\n\terr = resp.ToJSON(&card)\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DeployCardBattles deploys a new Ethereum contract, binding an instance of CardBattles to it.
|
func DeployCardBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBattles, error) {
parsed, err := abi.JSON(strings.NewReader(CardBattlesABI))
if err != nil {
return common.Address{}, nil, nil, err
}
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBattlesBin), backend)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil
}
|
[
"func DeployBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Battles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBattles(address common.Address, backend bind.ContractBackend) (*CardBattles, error) {\n\tcontract, err := bindCardBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func bindBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployChequesbooks(authPtr *bind.TransactOpts, backend bind.ContractBackended) (bgmcommon.Address, *types.Transaction, *Chequesbooks, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ChequesbooksABI))\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, bgmcommon.FromHex(ChequesbooksBin), backend)\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Chequesbooks{ChequesbooksCalled: ChequesbooksCalled{contract: contract}, ChequesbooksTransactor: ChequesbooksTransactor{contract: contract}}, nil\n}",
"func DeployBalanceSheet(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BalanceSheet, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BalanceSheetABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BalanceSheetBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BalanceSheet{BalanceSheetCaller: BalanceSheetCaller{contract: contract}, BalanceSheetTransactor: BalanceSheetTransactor{contract: contract}, BalanceSheetFilterer: BalanceSheetFilterer{contract: contract}}, nil\n}",
"func NewContractDeployerFacade(\n\tprivateKey string,\n\trpc string,\n\tcontractArgs []string,\n\tcontractType string,\n\tgasLimit int,\n\tgasPrice int,\n) (*contractDeployerFacade, error) {\n\tfmt.Println(\"Starting account and blockchain connection process.\")\n\t// Process the private key from the flag\n\tuserAccount, err := ethacc.CreateAccount(privateKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Successfully accessed account for Public Key: %s\\n\",\n\t\tuserAccount.Account)\n\n\t// Connect to the RPC client with the give URL\n\tethClient, err1 := ethrpc.CreateClient(rpc)\n\tif err1 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to connect to given \" +\n\t\t\t\"rpc url : %v \\n\", err1)\n\t}\n\tdefer ethClient.CloseClient()\n\n\t// Attempt to load data from the blockchain given the connected RPC Client\n\tcurrBlockchainState, err2 := ethClient.LoadBlockChainState(context.Background())\n\tif err2 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to retrieve account using \" +\n\t\t\t\"provided private key : %v\\n\", err2)\n\t}\n\n\tfmt.Printf(\"Succesfully connected to RPC client %s. Current Block Height %d \"+\n\t\t\", for chain id: %d\\n\", ethClient.RawUrl, currBlockchainState.BlockNumber,\n\t\tcurrBlockchainState.ChainId)\n\n\t// Using the client and the account get data needed for contract deployment\n\tauth, err3 := ethClient.GetDataForTransaction(context.Background(),\n\t\tuserAccount, currBlockchainState.ChainId, gasLimit, gasPrice)\n\tif err3 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to get data for transaction \" +\n\t\t\t\"processing: %v\\n\", err3)\n\t}\n\n\tcontractDeployerFacade := &contractDeployerFacade{\n\t\tbaseContractInteractorFacade{\n\t\t\tuserAccount,\n\t\t\tethClient,\n\t\t\tcurrBlockchainState,\n\t\t\tauth,\n\t\t\tcontractType,\n\t\t},\n\t\tcontractArgs,\n\t}\n\tfmt.Println(\"Successfully completed account and blockchain connection \" +\n\t\t\"process.\")\n\treturn contractDeployerFacade, nil\n}",
"func DeployClones(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Clones, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ClonesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ClonesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Clones{ClonesCaller: ClonesCaller{contract: contract}, ClonesTransactor: ClonesTransactor{contract: contract}, ClonesFilterer: ClonesFilterer{contract: contract}}, nil\n}",
"func NewCardBattlesTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBattlesTransactor, error) {\n\tcontract, err := bindCardBattles(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesTransactor{contract: contract}, nil\n}",
"func DeployCardBase(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBase, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBaseBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func NewBattles(address common.Address, backend bind.ContractBackend) (*Battles, error) {\n\tcontract, err := bindBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func NewCardBattlesCaller(address common.Address, caller bind.ContractCaller) (*CardBattlesCaller, error) {\n\tcontract, err := bindCardBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesCaller{contract: contract}, nil\n}",
"func DeployChequeBook(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ChequeBook, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ChequeBookABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ChequeBookBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &ChequeBook{ChequeBookCaller: ChequeBookCaller{contract: contract}, ChequeBookTransactor: ChequeBookTransactor{contract: contract}, ChequeBookFilterer: ChequeBookFilterer{contract: contract}}, nil\n}",
"func (k Keeper) DeployModuleCRC20(ctx sdk.Context, denom string) (common.Address, error) {\n\tctor, err := types.ModuleCRC20Contract.ABI.Pack(\"\", denom, uint8(0))\n\tif err != nil {\n\t\treturn common.Address{}, err\n\t}\n\tdata := types.ModuleCRC20Contract.Bin\n\tdata = append(data, ctor...)\n\n\tmsg, res, err := k.CallEVM(ctx, nil, data, big.NewInt(0))\n\tif err != nil {\n\t\treturn common.Address{}, err\n\t}\n\n\tif res.Failed() {\n\t\treturn common.Address{}, fmt.Errorf(\"contract deploy failed: %s\", res.Ret)\n\t}\n\treturn crypto.CreateAddress(types.EVMModuleAddress, msg.Nonce()), nil\n}",
"func DeployERC1155(auth *bind.TransactOpts, backend bind.ContractBackend, uri_ string) (common.Address, *types.Transaction, *ERC1155, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ERC1155ABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC1155Bin), backend, uri_)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &ERC1155{ERC1155Caller: ERC1155Caller{contract: contract}, ERC1155Transactor: ERC1155Transactor{contract: contract}, ERC1155Filterer: ERC1155Filterer{contract: contract}}, nil\n}",
"func DeployArbERC721(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ArbERC721, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ArbERC721ABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ArbERC721Bin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &ArbERC721{ArbERC721Caller: ArbERC721Caller{contract: contract}, ArbERC721Transactor: ArbERC721Transactor{contract: contract}, ArbERC721Filterer: ArbERC721Filterer{contract: contract}}, nil\n}",
"func DeployBerryGetters(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BerryGetters, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BerryGettersABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BerryGettersBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BerryGetters{BerryGettersCaller: BerryGettersCaller{contract: contract}, BerryGettersTransactor: BerryGettersTransactor{contract: contract}, BerryGettersFilterer: BerryGettersFilterer{contract: contract}}, nil\n}",
"func DeployCrossEther(auth *bind.TransactOpts, backend bind.ContractBackend, erc20 common.Address) (common.Address, *types.Transaction, *CrossEther, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CrossEtherABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CrossEtherBin), backend, erc20)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CrossEther{CrossEtherCaller: CrossEtherCaller{contract: contract}, CrossEtherTransactor: CrossEtherTransactor{contract: contract}, CrossEtherFilterer: CrossEtherFilterer{contract: contract}}, nil\n}",
"func DeployBerryMaster(auth *bind.TransactOpts, backend bind.ContractBackend, _berryContract common.Address) (common.Address, *types.Transaction, *BerryMaster, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BerryMasterABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BerryMasterBin), backend, _berryContract)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BerryMaster{BerryMasterCaller: BerryMasterCaller{contract: contract}, BerryMasterTransactor: BerryMasterTransactor{contract: contract}, BerryMasterFilterer: BerryMasterFilterer{contract: contract}}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardBattles creates a new instance of CardBattles, bound to a specific deployed contract.
|
func NewCardBattles(address common.Address, backend bind.ContractBackend) (*CardBattles, error) {
contract, err := bindCardBattles(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil
}
|
[
"func NewBattles(address common.Address, backend bind.ContractBackend) (*Battles, error) {\n\tcontract, err := bindBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBattlesCaller(address common.Address, caller bind.ContractCaller) (*CardBattlesCaller, error) {\n\tcontract, err := bindCardBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesCaller{contract: contract}, nil\n}",
"func NewCardBattlesTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBattlesTransactor, error) {\n\tcontract, err := bindCardBattles(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesTransactor{contract: contract}, nil\n}",
"func bindBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewBattlesCaller(address common.Address, caller bind.ContractCaller) (*BattlesCaller, error) {\n\tcontract, err := bindBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesCaller{contract: contract}, nil\n}",
"func NewBattlesTransactor(address common.Address, transactor bind.ContractTransactor) (*BattlesTransactor, error) {\n\tcontract, err := bindBattles(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesTransactor{contract: contract}, nil\n}",
"func DeployCardBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBattles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func NewCardBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBattlesFilterer, error) {\n\tcontract, err := bindCardBattles(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesFilterer{contract: contract}, nil\n}",
"func NewAddressBook(ctx *pulumi.Context,\n\tname string, args *AddressBookArgs, opts ...pulumi.ResourceOption) (*AddressBook, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Description == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Description'\")\n\t}\n\tif args.GroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'GroupName'\")\n\t}\n\tif args.GroupType == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'GroupType'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource AddressBook\n\terr := ctx.RegisterResource(\"alicloud:cloudfirewall/addressBook:AddressBook\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func DeployBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Battles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func NewLBCCaller(address common.Address, caller bind.ContractCaller) (*LBCCaller, error) {\n\tcontract, err := bindLBC(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LBCCaller{contract: contract}, nil\n}",
"func NewBridges(n uint32, machine string) []Bridge {\n\tvar bridges []Bridge\n\tvar bt bridgeType\n\n\tswitch machine {\n\tcase QemuQ35:\n\t\t// currently only pci bridges are supported\n\t\t// qemu-2.10 will introduce pcie bridges\n\t\tfallthrough\n\tcase QemuPC:\n\t\tbt = pciBridge\n\tdefault:\n\t\treturn nil\n\t}\n\n\tfor i := uint32(0); i < n; i++ {\n\t\tbridges = append(bridges, Bridge{\n\t\t\tType: bt,\n\t\t\tID: fmt.Sprintf(\"%s-bridge-%d\", bt, i),\n\t\t\tAddress: make(map[uint32]string),\n\t\t})\n\t}\n\n\treturn bridges\n}",
"func NewBucket(store *coal.Store, notary *heat.Notary, bindings ...*Binding) *Bucket {\n\treturn &Bucket{\n\t\tstore: store,\n\t\tnotary: notary,\n\t\tbindings: NewRegistry(bindings...),\n\t\tservices: map[string]Service{},\n\t}\n}",
"func NewBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*BattlesFilterer, error) {\n\tcontract, err := bindBattles(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesFilterer{contract: contract}, nil\n}",
"func NewBag(adj string, col string) Bag {\n\treturn Bag{\n\t\tadjective: adj,\n\t\tcolor: col,\n\t\tchildren: make([]Containment, 0),\n\t}\n}",
"func New(conf *config.Config) *BPF {\n\tcode, err := GetBPFCode(conf)\n\tif err != nil {\n\t\tconf.Logger().Fatal(\"ebpf\", zap.Error(err))\n\t}\n\n\tm := bpf.NewModule(code, []string{})\n\n\treturn &BPF{m: m}\n}",
"func NewDropkitContract(address common.Address, backend bind.ContractBackend) (*DropkitContract, error) {\n\tcontract, err := bindDropkitContract(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DropkitContract{DropkitContractCaller: DropkitContractCaller{contract: contract}, DropkitContractTransactor: DropkitContractTransactor{contract: contract}, DropkitContractFilterer: DropkitContractFilterer{contract: contract}}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardBattlesCaller creates a new readonly instance of CardBattles, bound to a specific deployed contract.
|
func NewCardBattlesCaller(address common.Address, caller bind.ContractCaller) (*CardBattlesCaller, error) {
contract, err := bindCardBattles(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &CardBattlesCaller{contract: contract}, nil
}
|
[
"func NewBattlesCaller(address common.Address, caller bind.ContractCaller) (*BattlesCaller, error) {\n\tcontract, err := bindBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesCaller{contract: contract}, nil\n}",
"func NewCardBattles(address common.Address, backend bind.ContractBackend) (*CardBattles, error) {\n\tcontract, err := bindCardBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewBattles(address common.Address, backend bind.ContractBackend) (*Battles, error) {\n\tcontract, err := bindBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func bindBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewLBCCaller(address common.Address, caller bind.ContractCaller) (*LBCCaller, error) {\n\tcontract, err := bindLBC(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LBCCaller{contract: contract}, nil\n}",
"func NewRBACCaller(address common.Address, caller bind.ContractCaller) (*RBACCaller, error) {\n\tcontract, err := bindRBAC(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RBACCaller{contract: contract}, nil\n}",
"func NewCardBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBattlesFilterer, error) {\n\tcontract, err := bindCardBattles(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesFilterer{contract: contract}, nil\n}",
"func NewDropkitContractCaller(address common.Address, caller bind.ContractCaller) (*DropkitContractCaller, error) {\n\tcontract, err := bindDropkitContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DropkitContractCaller{contract: contract}, nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func NewBalanceSheetCaller(address common.Address, caller bind.ContractCaller) (*BalanceSheetCaller, error) {\n\tcontract, err := bindBalanceSheet(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BalanceSheetCaller{contract: contract}, nil\n}",
"func NewCardBattlesTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBattlesTransactor, error) {\n\tcontract, err := bindCardBattles(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesTransactor{contract: contract}, nil\n}",
"func NewClonesCaller(address common.Address, caller bind.ContractCaller) (*ClonesCaller, error) {\n\tcontract, err := bindClones(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesCaller{contract: contract}, nil\n}",
"func NewBerryGettersCaller(address common.Address, caller bind.ContractCaller) (*BerryGettersCaller, error) {\n\tcontract, err := bindBerryGetters(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryGettersCaller{contract: contract}, nil\n}",
"func NewAirdropContractCaller(address common.Address, caller bind.ContractCaller) (*AirdropContractCaller, error) {\n\tcontract, err := bindAirdropContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AirdropContractCaller{contract: contract}, nil\n}",
"func DeployCardBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBattles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func NewAddressBook(ctx *pulumi.Context,\n\tname string, args *AddressBookArgs, opts ...pulumi.ResourceOption) (*AddressBook, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Description == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Description'\")\n\t}\n\tif args.GroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'GroupName'\")\n\t}\n\tif args.GroupType == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'GroupType'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource AddressBook\n\terr := ctx.RegisterResource(\"alicloud:cloudfirewall/addressBook:AddressBook\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func NewBalance(h ConsistentHasher, r naming.Resolver, f ...HasherFromContext) grpc.Balancer {\n\tb := &balance{\n\t\taddrsCh: make(chan []grpc.Address, 1),\n\t\tdone: abool.New(),\n\t\th: h,\n\t\tr: r,\n\t}\n\tif len(f) > 0 {\n\t\tb.f = f[0]\n\t} else {\n\t\tb.f = strOrNumFromContext\n\t}\n\treturn b\n}",
"func NewBankCaller(address common.Address, caller bind.ContractCaller) (*BankCaller, error) {\n\tcontract, err := bindBank(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BankCaller{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardBattlesTransactor creates a new writeonly instance of CardBattles, bound to a specific deployed contract.
|
func NewCardBattlesTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBattlesTransactor, error) {
contract, err := bindCardBattles(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &CardBattlesTransactor{contract: contract}, nil
}
|
[
"func NewBattlesTransactor(address common.Address, transactor bind.ContractTransactor) (*BattlesTransactor, error) {\n\tcontract, err := bindBattles(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesTransactor{contract: contract}, nil\n}",
"func NewCardBattles(address common.Address, backend bind.ContractBackend) (*CardBattles, error) {\n\tcontract, err := bindCardBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func NewBattles(address common.Address, backend bind.ContractBackend) (*Battles, error) {\n\tcontract, err := bindBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func NewCardBattlesCaller(address common.Address, caller bind.ContractCaller) (*CardBattlesCaller, error) {\n\tcontract, err := bindCardBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesCaller{contract: contract}, nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewBalanceSheetTransactor(address common.Address, transactor bind.ContractTransactor) (*BalanceSheetTransactor, error) {\n\tcontract, err := bindBalanceSheet(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BalanceSheetTransactor{contract: contract}, nil\n}",
"func DeployCardBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBattles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func bindBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewDropkitContractTransactor(address common.Address, transactor bind.ContractTransactor) (*DropkitContractTransactor, error) {\n\tcontract, err := bindDropkitContract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DropkitContractTransactor{contract: contract}, nil\n}",
"func NewBattlesCaller(address common.Address, caller bind.ContractCaller) (*BattlesCaller, error) {\n\tcontract, err := bindBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesCaller{contract: contract}, nil\n}",
"func NewClonesTransactor(address common.Address, transactor bind.ContractTransactor) (*ClonesTransactor, error) {\n\tcontract, err := bindClones(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesTransactor{contract: contract}, nil\n}",
"func (t *DefaultTransactor) NewTransactor(account accounts.Account) (*bind.TransactOpts, error) {\n\tif !t.wallet.Contains(account) {\n\t\treturn nil, errors.New(\"account not found in wallet\")\n\t}\n\treturn &bind.TransactOpts{\n\t\tFrom: account.Address,\n\t\tSigner: func(signer types.Signer, address common.Address, tx *types.Transaction) (*types.Transaction, error) {\n\t\t\tif address != account.Address {\n\t\t\t\treturn nil, errors.New(\"not authorized to sign this account\")\n\t\t\t}\n\t\t\t// Last parameter (chainID) is only relevant when making EIP155 compliant signatures.\n\t\t\t// Since we use only non EIP155 signatures, set this to zero value.\n\t\t\t// For more details, see here (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md).\n\t\t\treturn t.wallet.SignTx(account, tx, big.NewInt(0))\n\t\t},\n\t}, nil\n}",
"func DeployBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Battles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func NewChequesbooksTransactor(address bgmcommon.Address, transactor bind.ContractTransactor) (*ChequesbooksTransactor, error) {\n\tcontract, err := bindChequesbooks(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ChequesbooksTransactor{contract: contract}, nil\n}",
"func NewCardBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBattlesFilterer, error) {\n\tcontract, err := bindCardBattles(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesFilterer{contract: contract}, nil\n}",
"func NewSmartcontractTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartcontractTransactor, error) {\n\tcontract, err := bindSmartcontract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractTransactor{contract: contract}, nil\n}",
"func NewLBCTransactor(address common.Address, transactor bind.ContractTransactor) (*LBCTransactor, error) {\n\tcontract, err := bindLBC(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LBCTransactor{contract: contract}, nil\n}",
"func NewCarTransactor(address common.Address, transactor bind.ContractTransactor) (*CarTransactor, error) {\n\tcontract, err := bindCar(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarTransactor{contract: contract}, nil\n}",
"func NewBerryGettersTransactor(address common.Address, transactor bind.ContractTransactor) (*BerryGettersTransactor, error) {\n\tcontract, err := bindBerryGetters(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryGettersTransactor{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardBattlesFilterer creates a new log filterer instance of CardBattles, bound to a specific deployed contract.
|
func NewCardBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBattlesFilterer, error) {
contract, err := bindCardBattles(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &CardBattlesFilterer{contract: contract}, nil
}
|
[
"func NewBattlesFilterer(address common.Address, filterer bind.ContractFilterer) (*BattlesFilterer, error) {\n\tcontract, err := bindBattles(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesFilterer{contract: contract}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewLBCFilterer(address common.Address, filterer bind.ContractFilterer) (*LBCFilterer, error) {\n\tcontract, err := bindLBC(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LBCFilterer{contract: contract}, nil\n}",
"func newFilterBattery(filters ...Filterer) FilterBattery {\n\tret := FilterBattery{}\n\tfor _, f := range filters {\n\t\tret = append(ret, f)\n\t}\n\treturn ret\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewBorrowCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapGuardianIterator{contract: _Comptroller.contract, event: \"NewBorrowCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func NewCardBaseFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBaseFilterer, error) {\n\tcontract, err := bindCardBase(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseFilterer{contract: contract}, nil\n}",
"func NewDropkitContractFilterer(address common.Address, filterer bind.ContractFilterer) (*DropkitContractFilterer, error) {\n\tcontract, err := bindDropkitContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DropkitContractFilterer{contract: contract}, nil\n}",
"func NewCardBattlesCaller(address common.Address, caller bind.ContractCaller) (*CardBattlesCaller, error) {\n\tcontract, err := bindCardBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesCaller{contract: contract}, nil\n}",
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewClonesFilterer(address common.Address, filterer bind.ContractFilterer) (*ClonesFilterer, error) {\n\tcontract, err := bindClones(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesFilterer{contract: contract}, nil\n}",
"func NewCardBattles(address common.Address, backend bind.ContractBackend) (*CardBattles, error) {\n\tcontract, err := bindCardBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func NewComptrollerFilterer(address common.Address, filterer bind.ContractFilterer) (*ComptrollerFilterer, error) {\n\tcontract, err := bindComptroller(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerFilterer{contract: contract}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewBorrowCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapIterator{contract: _Comptroller.contract, event: \"NewBorrowCap\", logs: logs, sub: sub}, nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewSupplyCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapGuardianIterator{contract: _Comptroller.contract, event: \"NewSupplyCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func NewCarFilterer(address common.Address, filterer bind.ContractFilterer) (*CarFilterer, error) {\n\tcontract, err := bindCar(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarFilterer{contract: contract}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesNewCard)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewCollateralFactor(opts *bind.FilterOpts) (*ComptrollerNewCollateralFactorIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewCollateralFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewCollateralFactorIterator{contract: _Comptroller.contract, event: \"NewCollateralFactor\", logs: logs, sub: sub}, nil\n}",
"func NewBattlesCaller(address common.Address, caller bind.ContractCaller) (*BattlesCaller, error) {\n\tcontract, err := bindBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattlesCaller{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
bindCardBattles binds a generic wrapper to an already deployed contract.
|
func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(CardBattlesABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
|
[
"func bindBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployCardBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBattles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindDropkitContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(DropkitContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindLBC(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(LBCABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBattles(address common.Address, backend bind.ContractBackend) (*CardBattles, error) {\n\tcontract, err := bindCardBattles(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func bindClones(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ClonesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindBerryGetters(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BerryGettersABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Battles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Battles{BattlesCaller: BattlesCaller{contract: contract}, BattlesTransactor: BattlesTransactor{contract: contract}, BattlesFilterer: BattlesFilterer{contract: contract}}, nil\n}",
"func bindBank(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BankABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindBalanceSheet(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BalanceSheetABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindComptroller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ComptrollerABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBattlesCaller(address common.Address, caller bind.ContractCaller) (*CardBattlesCaller, error) {\n\tcontract, err := bindCardBattles(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesCaller{contract: contract}, nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindChequesbooks(address bgmcommon.Address, Called bind.ContractCalled, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ChequesbooksABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, Called, transactor), nil\n}",
"func bindPancakeswap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(PancakeswapABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindAirdropContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(AirdropContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindZBGCard(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ZBGCardABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindBattleQueue(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleQueueABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CardsHeldByOwner is a free data retrieval call binding the contract method 0x12c2debf. Solidity: function cardsHeldByOwner( address, uint256) constant returns(uint256)
|
func (_CardBattles *CardBattlesCaller) CardsHeldByOwner(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {
var (
ret0 = new(*big.Int)
)
out := ret0
err := _CardBattles.contract.Call(opts, out, "cardsHeldByOwner", arg0, arg1)
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) CardsHeldByOwner(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"cardsHeldByOwner\", arg0, arg1)\n\treturn *ret0, err\n}",
"func (_ZBGCard *ZBGCardCaller) TokensOwned(opts *bind.CallOpts, _owner common.Address) (struct {\n\tIndexes []*big.Int\n\tBalances []*big.Int\n}, error) {\n\tret := new(struct {\n\t\tIndexes []*big.Int\n\t\tBalances []*big.Int\n\t})\n\tout := ret\n\terr := _ZBGCard.contract.Call(opts, out, \"tokensOwned\", _owner)\n\treturn *ret, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) TokensOfOwner(opts *bind.CallOpts, _owner common.Address) ([]*big.Int, error) {\n\tvar (\n\t\tret0 = new([]*big.Int)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"tokensOfOwner\", _owner)\n\treturn *ret0, err\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_ZBGCard *ZBGCardCallerSession) TokensOwned(_owner common.Address) (struct {\n\tIndexes []*big.Int\n\tBalances []*big.Int\n}, error) {\n\treturn _ZBGCard.Contract.TokensOwned(&_ZBGCard.CallOpts, _owner)\n}",
"func (_Registry *RegistryCaller) Ownership(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Registry.contract.Call(opts, out, \"ownership\", arg0)\n\treturn *ret0, err\n}",
"func GetByOwner(stub shim.ChaincodeStubInterface, logger *shim.ChaincodeLogger, args []string) peer.Response {\n\tlogger.Info(\"Entry method: GetByOwner\")\n\tlogger.Debug(\"Received args:\", args)\n\n\t// Input sanitation\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. 1 expected\")\n\t}\n\tif args[0] == \"\" {\n\t\treturn shim.Error(\"Argument must be a non-empty string\")\n\t}\n\n\t// Mapping arg to variable\n\taccOwner := args[0]\n\n\t// Construct query string using account owner name\n\tqueryString := fmt.Sprintf(\"{\\\"selector\\\":{\\\"docType\\\":\\\"Account\\\",\\\"accountOwner\\\":\\\"%s\\\"}}\", accOwner)\n\tlogger.Debug(\"Query string:\", queryString)\n\n\t// Use package query to query couchdb and format the result\n\tqueryResults, err := query.GetQueryResultForQueryString(stub, queryString)\n\tif err != nil {\n\t\tlogger.Info(\"Exit method: GetByOwner\")\n\t\treturn shim.Error(\"Cannot get query results: \" + err.Error())\n\t}\n\n\terr = stub.SetEvent(\"get_account_by_owner\", []byte(\"Success\"))\n\tif err != nil {\n\t\tlogger.Critical(\"Failed to set event `get_account_by_owner`: \" + err.Error())\n\t\tlogger.Info(\"Exit method: GetByOwner\")\n\t\treturn shim.Error(\"Failed to set event `get_account_by_owner`: \" + err.Error())\n\t}\n\n\tlogger.Info(\"Exit method: GetByOwner\")\n\treturn shim.Success(queryResults)\n}",
"func (_MetaData *MetaDataCaller) Owner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MetaData.contract.Call(opts, out, \"owner\")\n\treturn *ret0, err\n}",
"func (_Asset *AssetCaller) Ownership(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"Ownership\")\n\treturn *ret0, err\n}",
"func (_IotCloudlab *IotCloudlabCaller) RetrieveOwner(opts *bind.CallOpts) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _IotCloudlab.contract.Call(opts, &out, \"retrieveOwner\")\n\n\tif err != nil {\n\t\treturn *new([32]byte), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)\n\n\treturn out0, err\n\n}",
"func (c *Deed) Owner() (common.Address, error) {\n\treturn c.Contract.Owner(nil)\n}",
"func InventoryHeldByCustomer(db XODB, v0 int) (int, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT public.inventory_held_by_customer($1)`\n\n\t// run query\n\tvar ret int\n\tXOLog(sqlstr, v0)\n\terr = db.QueryRow(sqlstr, v0).Scan(&ret)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn ret, nil\n}",
"func KeyOwner(address sdk.AccAddress, classID, tokenID string) []byte {\n\tkey := append(PrefixOwners, delimiter...)\n\tif address != nil {\n\t\tkey = append(key, []byte(address.String())...)\n\t\tkey = append(key, delimiter...)\n\t}\n\n\tif address != nil && len(classID) > 0 {\n\t\tkey = append(key, []byte(classID)...)\n\t\tkey = append(key, delimiter...)\n\t}\n\n\tif address != nil && len(classID) > 0 && len(tokenID) > 0 {\n\t\tkey = append(key, []byte(tokenID)...)\n\t}\n\treturn key\n}",
"func (playerView *PlayerView) VisibleHand(\n\tplayerName string) ([]card.Defined, string, error) {\n\tif playerName == playerView.playerName {\n\t\treturn nil,\n\t\t\t\"no color because of error\",\n\t\t\tfmt.Errorf(\"Player is not allowed to view own hand\")\n\t}\n\n\tplayerState, isParticipant := playerView.playerStates[playerName]\n\tif !isParticipant {\n\t\treturn nil,\n\t\t\t\"no color because of error\",\n\t\t\tfmt.Errorf(\"Player %v not found\", playerName)\n\t}\n\n\tvisibleCards, errorFromGameState := playerView.gameState.VisibleHand(playerName)\n\n\treturn visibleCards, playerState.Color(), errorFromGameState\n}",
"func (c *Card) QueryOwner() *UserQuery {\n\treturn NewCardClient(c.config).QueryOwner(c)\n}",
"func (_GlobalFTWallet *GlobalFTWalletCaller) OwnedERC20s(opts *bind.CallOpts, _owner common.Address) ([]common.Address, error) {\n\tvar out []interface{}\n\terr := _GlobalFTWallet.contract.Call(opts, &out, \"ownedERC20s\", _owner)\n\n\tif err != nil {\n\t\treturn *new([]common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)\n\n\treturn out0, err\n\n}",
"func GetOwnerKey(address sdk.AccAddress, denom string) []byte {\n\th := tmhash.New()\n\t_, err := h.Write([]byte(denom))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tbs := h.Sum(nil)\n\n\treturn append(GetOwnersKey(address), bs...)\n}",
"func (_IotCloudlab *IotCloudlabSession) RetrieveOwner() ([32]byte, error) {\n\treturn _IotCloudlab.Contract.RetrieveOwner(&_IotCloudlab.CallOpts)\n}",
"func (p *Participant) Owned() money.Reader {\n\treturn money.NewMoney(math.Abs(p.AmountPaid().Value() - p.AmountSpent().Value()))\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetNewAddress is a paid mutator transaction binding the contract method 0x71587988. Solidity: function setNewAddress(_newAddress address) returns()
|
func (_CardBattles *CardBattlesTransactor) SetNewAddress(opts *bind.TransactOpts, _newAddress common.Address) (*types.Transaction, error) {
return _CardBattles.contract.Transact(opts, "setNewAddress", _newAddress)
}
|
[
"func (_CardMinting *CardMintingTransactor) SetNewAddress(opts *bind.TransactOpts, _newAddress common.Address) (*types.Transaction, error) {\n\treturn _CardMinting.contract.Transact(opts, \"setNewAddress\", _newAddress)\n}",
"func (_MonsterCore *MonsterCoreTransactor) SetNewAddress(opts *bind.TransactOpts, _v2Address common.Address) (*types.Transaction, error) {\n\treturn _MonsterCore.contract.Transact(opts, \"setNewAddress\", _v2Address)\n}",
"func newAddress(res http.ResponseWriter, req *http.Request, _ httprouter.Params) {\n\tencoder := json.NewEncoder(res)\n\taddress, err := createWallet()\n\tif err != nil {\n\t\tencoder.Encode(jsonResponse{Status: err.Error()})\n\t\treturn\n\t}\n\twalletDB.Exec(\"INSERT INTO addresses (address) VALUES ($1);\", address)\n\tdata := map[string]interface{}{\"address\": address}\n\tencoder.Encode(jsonResponse{Status: \"OK\", Data: data})\n}",
"func newAddress(w *wallet.Wallet, account uint32, scope waddrmgr.KeyScope) (soterutil.Address, error) {\n\tvar (\n\t\taddr soterutil.Address\n\t)\n\terr := walletdb.Update(w.Database(), func(tx walletdb.ReadWriteTx) error {\n\t\taddrmgrNs := tx.ReadWriteBucket(waddrmgrNamespaceKey)\n\t\tvar err error\n\t\taddr, _, err = newWalletAddress(w, addrmgrNs, account, scope)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn addr, nil\n}",
"func SetNewRandomAddress(f NewRandomAddressFunc) {\n\tnewRandomAddress = f\n}",
"func (c *Client) CreateNewAddress() (address string, err error) {\n\tr, err := c.request(\"createnewaddress\", nil)\n\tif err = c.error(err, &r); err != nil {\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(r.Result, &address)\n\treturn\n}",
"func (d *EditCoinOwnerData) SetNewOwner(address string) (*EditCoinOwnerData, error) {\n\tbytes, err := wallet.AddressToHex(address)\n\tif err != nil {\n\t\treturn d, err\n\t}\n\tcopy(d.NewOwner[:], bytes)\n\treturn d, nil\n}",
"func newAddress(t AddressType, args ...[]byte) (*Address, error) {\n\tif len(args) == 0 {\n\t\treturn nil, ErrInvalidArgument\n\t}\n\n\tswitch t {\n\tcase AccountAddress, ContractAddress:\n\tdefault:\n\t\treturn nil, ErrInvalidArgument\n\t}\n\n\tbuffer := make([]byte, AddressLength)\n\tbuffer[AddressPaddingIndex] = Padding\n\tbuffer[AddressTypeIndex] = byte(t)\n\n\tsha := hash.Sha3256(args...)\n\tcontent := hash.Ripemd160(sha)\n\tcopy(buffer[AddressTypeIndex+1:AddressDataEnd], content)\n\n\tcs := checkSum(buffer[:AddressDataEnd])\n\tcopy(buffer[AddressDataEnd:], cs)\n\n\treturn &Address{Address: buffer}, nil\n}",
"func (b *DcrWallet) NewAddress(t lnwallet.AddressType, change bool, accountName string) (stdaddr.Address, error) {\n\n\tswitch t {\n\tcase lnwallet.PubKeyHash:\n\t\t// nop\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown address type\")\n\t}\n\n\tvar acctNb = b.account\n\tif accountName != lnwallet.DefaultAccountName {\n\t\tres, err := b.wallet.AccountNumber(context.Background(), &pb.AccountNumberRequest{AccountName: accountName})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unknown account named %s: %v\", accountName, err)\n\t\t}\n\t\tacctNb = res.AccountNumber\n\t}\n\n\tkind := pb.NextAddressRequest_BIP0044_EXTERNAL\n\tif change {\n\t\tkind = pb.NextAddressRequest_BIP0044_INTERNAL\n\t}\n\treq := &pb.NextAddressRequest{\n\t\tKind: kind,\n\t\tAccount: acctNb,\n\t\tGapPolicy: pb.NextAddressRequest_GAP_POLICY_WRAP,\n\t}\n\tresp, err := b.wallet.NextAddress(context.Background(), req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\taddr, err := stdaddr.DecodeAddress(resp.Address, b.chainParams)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn addr, nil\n}",
"func (w *Wallet) newChangeAddresses(account, n uint32) ([]cipher.Addresser, error) {\n\treturn w.newAddresses(account, bip44.ChangeChainIndex, n)\n}",
"func (s *Server) EventAddNewAddress(c context.Context, wa *pb.WatchAddress) (*pb.ReplyInfo, error) {\n\tnewMap := *s.UsersData\n\t// if newMap == nil {\n\t// \tnewMap = sync.Map{}\n\t// }\n\t_, ok := newMap.Load(wa.Address)\n\tif ok {\n\t\treturn &pb.ReplyInfo{\n\t\t\tMessage: \"err: Address already binded\",\n\t\t}, nil\n\t}\n\tnewMap.Store(strings.ToLower(wa.Address), store.AddressExtended{\n\t\tUserID: wa.UserID,\n\t\tWalletIndex: int(wa.WalletIndex),\n\t\tAddressIndex: int(wa.AddressIndex),\n\t})\n\n\t*s.UsersData = newMap\n\n\tlog.Debugf(\"EventAddNewAddress - %v\", newMap)\n\n\treturn &pb.ReplyInfo{\n\t\tMessage: \"ok\",\n\t}, nil\n\n}",
"func (c *Client) GetNewAddressEntire(label string, addressType string) (*string, error) {\n\treturn c.GetNewAddressAsync(&label, &addressType).Receive()\n}",
"func NewContractAddress(channelID string, caller Address, code []byte) (newAddr Address) {\n\t// temp := make([]byte, 32+8)\n\t// copy(temp, caller[:])\n\t// PutUint64BE(temp[32:], uint64(sequence))\n\ttemp := util.BytesCombine([]byte(channelID), caller.Bytes(), code)\n\thasher := ripemd160.New()\n\thasher.Write(temp) // does not error\n\tcopy(newAddr[:], hasher.Sum(nil))\n\treturn\n}",
"func getNewAdressBTC(label string, UID string, pwd string) string {\n\tresponse, err := http.Get(\"http://localhost:3000/merchant/\" + UID +\n\t\t\"/new_address?password=\" + pwd + \"&label=\" + label)\n\tif err != nil {\n\t\treturn \"False\"\n\t}\n\tdefer response.Body.Close()\n\tcontents, err := ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn \"False\"\n\t}\n\tvalue := gjson.Get(string(contents), \"address\")\n\treturn value.String()\n}",
"func (ipam *IPAM) GetNewAddress() (net.IP, error) {\n\tipam.mutex.Lock()\n\tfreeBlock, err := ipam.findFreeBlock()\n\tif err != nil {\n\t\tipam.mutex.Unlock()\n\t\treturn net.IP{}, fmt.Errorf(\"unable to find a free IP block: %w\", err)\n\t}\n\tnewAddress, err := freeBlock.reserveAddress(ipam.db)\n\tipam.mutex.Unlock()\n\treturn newAddress, err\n}",
"func (_Hotel_Interface *Hotel_InterfaceTransactor) EditAddress(opts *bind.TransactOpts, _lineOne string, _lineTwo string, _zip string, _country string) (*types.Transaction, error) {\n\treturn _Hotel_Interface.contract.Transact(opts, \"editAddress\", _lineOne, _lineTwo, _zip, _country)\n}",
"func (m *Website) SetAddress(value *string)() {\n m.address = value\n}",
"func (_MonsterCore *MonsterCoreCaller) NewContractAddress(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"newContractAddress\")\n\treturn *ret0, err\n}",
"func (_Hotel_Interface *Hotel_InterfaceTransactorSession) EditAddress(_lineOne string, _lineTwo string, _zip string, _country string) (*types.Transaction, error) {\n\treturn _Hotel_Interface.Contract.EditAddress(&_Hotel_Interface.TransactOpts, _lineOne, _lineTwo, _zip, _country)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetOnBattleCooldown is a paid mutator transaction binding the contract method 0x685b7a5e. Solidity: function setOnBattleCooldown(_cardID uint256) returns(bool)
|
func (_CardBattles *CardBattlesSession) SetOnBattleCooldown(_cardID *big.Int) (*types.Transaction, error) {
return _CardBattles.Contract.SetOnBattleCooldown(&_CardBattles.TransactOpts, _cardID)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) SetOnBattleCooldown(opts *bind.TransactOpts, _cardID *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"setOnBattleCooldown\", _cardID)\n}",
"func (_BattleGroups *BattleGroupsTransactor) SetGroupOnBattleCooldown(opts *bind.TransactOpts, _groupID *big.Int) (*types.Transaction, error) {\n\treturn _BattleGroups.contract.Transact(opts, \"setGroupOnBattleCooldown\", _groupID)\n}",
"func (_BattleGroups *BattleGroupsTransactorSession) SetGroupOnBattleCooldown(_groupID *big.Int) (*types.Transaction, error) {\n\treturn _BattleGroups.Contract.SetGroupOnBattleCooldown(&_BattleGroups.TransactOpts, _groupID)\n}",
"func CheckSetCooldown(conf *models.ReputationConfig, senderID int64) (bool, error) {\n\tif conf.Cooldown < 1 {\n\t\treturn true, nil\n\t}\n\n\tvar resp string\n\terr := common.RedisPool.Do(radix.FlatCmd(&resp, \"SET\", KeyCooldown(conf.GuildID, senderID), true, \"EX\", conf.Cooldown, \"NX\"))\n\tif resp != \"OK\" {\n\t\treturn false, err\n\t}\n\n\treturn true, err\n}",
"func (cs *YAGCommand) SetCooldown(client *redis.Client, userID int64) error {\n\tif cs.Cooldown < 1 {\n\t\treturn nil\n\t}\n\tnow := time.Now().Unix()\n\terr := client.Cmd(\"SET\", RKeyCommandCooldown(userID, cs.Name), now, \"EX\", cs.Cooldown).Err\n\treturn err\n}",
"func (_CardMinting *CardMintingCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _CardMinting.contract.Call(opts, out, \"BATTLE_COOLDOWN_TIME\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BATTLE_COOLDOWN_TIME\")\n\treturn *ret0, err\n}",
"func (_MonsterMinting *MonsterMintingCaller) Cooldowns(opts *bind.CallOpts, arg0 *big.Int) (uint32, error) {\n\tvar (\n\t\tret0 = new(uint32)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"cooldowns\", arg0)\n\treturn *ret0, err\n}",
"func (_MonsterCore *MonsterCoreCaller) Cooldowns(opts *bind.CallOpts, arg0 *big.Int) (uint32, error) {\n\tvar (\n\t\tret0 = new(uint32)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"cooldowns\", arg0)\n\treturn *ret0, err\n}",
"func (c *CardInstance) OnAttack(target *CardInstance) error {\n\tvar ability Ability\n\tfor _, ai := range c.AbilitiesInstances {\n\t\tif ai.Trigger == zb_enums.AbilityTrigger_Attack {\n\t\t\tswitch abilityInstance := ai.AbilityType.(type) {\n\t\t\tcase *zb_data.CardAbilityInstance_AdditionalDamageToHeavyInAttack:\n\t\t\t\tadditionalDamageToHeavyInAttack := abilityInstance.AdditionalDamageToHeavyInAttack\n\t\t\t\tab := NewAdditionalDamgeToHeavyInAttack(c, additionalDamageToHeavyInAttack, target)\n\t\t\t\tif err := ab.Apply(c.Gameplay); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase *zb_data.CardAbilityInstance_DealDamageToThisAndAdjacentUnits:\n\t\t\t\tdealDamageToThisAndAdjacentUnits := abilityInstance.DealDamageToThisAndAdjacentUnits\n\t\t\t\tability = NewDealDamageToThisAndAdjacentUnits(c, dealDamageToThisAndAdjacentUnits, target)\n\t\t\t\tif err := ability.Apply(c.Gameplay); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}",
"func (_LockContract *LockContractCaller) IsAllowedAt(opts *bind.CallOpts, bookingID *big.Int, tenant common.Address, time *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _LockContract.contract.Call(opts, out, \"isAllowedAt\", bookingID, tenant, time)\n\treturn *ret0, err\n}",
"func (_LockContract *LockContractCallerSession) IsAllowedAt(bookingID *big.Int, tenant common.Address, time *big.Int) (bool, error) {\n\treturn _LockContract.Contract.IsAllowedAt(&_LockContract.CallOpts, bookingID, tenant, time)\n}",
"func (s *ScalingPolicy) SetCooldown(v int64) *ScalingPolicy {\n\ts.Cooldown = &v\n\treturn s\n}",
"func (s *State) CanAffordBuyback() bool {\n\tif s == nil || s.Hero == nil || s.Player == nil {\n\t\treturn false\n\t}\n\n\treturn s.BuybackCost < (s.ReliableGold + s.UnreliableGoldAfterDeath())\n}",
"func (s *ExecutePolicyInput) SetHonorCooldown(v bool) *ExecutePolicyInput {\n\ts.HonorCooldown = &v\n\treturn s\n}",
"func (s *SetDesiredCapacityInput) SetHonorCooldown(v bool) *SetDesiredCapacityInput {\n\ts.HonorCooldown = &v\n\treturn s\n}",
"func (s *PutScalingPolicyInput) SetCooldown(v int64) *PutScalingPolicyInput {\n\ts.Cooldown = &v\n\treturn s\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) IsReadyForBattle(_cardID *big.Int) (bool, error) {\n\treturn _CryptoCardsCore.Contract.IsReadyForBattle(&_CryptoCardsCore.CallOpts, _cardID)\n}",
"func (_Comptroller *ComptrollerSession) MintAllowed(cToken common.Address, minter common.Address, mintAmount *big.Int) (*types.Transaction, error) {\n\treturn _Comptroller.Contract.MintAllowed(&_Comptroller.TransactOpts, cToken, minter, mintAmount)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WatchContractUpgrade is a free log subscription operation binding the contract event 0x450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa446199305. Solidity: event ContractUpgrade(newContract address)
|
func (_CardBattles *CardBattlesFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBattlesContractUpgrade) (event.Subscription, error) {
logs, sub, err := _CardBattles.contract.WatchLogs(opts, "ContractUpgrade")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(CardBattlesContractUpgrade)
if err := _CardBattles.contract.UnpackLog(event, "ContractUpgrade", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
|
[
"func (_CardBase *CardBaseFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBaseContractUpgrade) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseContractUpgrade)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"ContractUpgrade\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CardBaseContractUpgradeIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseContractUpgradeIterator{contract: _CardBase.contract, event: \"ContractUpgrade\", logs: logs, sub: sub}, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CryptoCardsCoreContractUpgradeIterator, error) {\n\n\tlogs, sub, err := _CryptoCardsCore.contract.FilterLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreContractUpgradeIterator{contract: _CryptoCardsCore.contract, event: \"ContractUpgrade\", logs: logs, sub: sub}, nil\n}",
"func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *TransparentUpgradeableProxyUpgraded, implementation []common.Address) (event.Subscription, error) {\n\n\tvar implementationRule []interface{}\n\tfor _, implementationItem := range implementation {\n\t\timplementationRule = append(implementationRule, implementationItem)\n\t}\n\n\tlogs, sub, err := _TransparentUpgradeableProxy.contract.WatchLogs(opts, \"Upgraded\", implementationRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(TransparentUpgradeableProxyUpgraded)\n\t\t\t\tif err := _TransparentUpgradeableProxy.contract.UnpackLog(event, \"Upgraded\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_MultiSigWalletFactoryContract *MultiSigWalletFactoryContractFilterer) WatchContractInstantiation(opts *bind.WatchOpts, sink chan<- *MultiSigWalletFactoryContractContractInstantiation) (event.Subscription, error) {\n\n\tlogs, sub, err := _MultiSigWalletFactoryContract.contract.WatchLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(MultiSigWalletFactoryContractContractInstantiation)\n\t\t\t\tif err := _MultiSigWalletFactoryContract.contract.UnpackLog(event, \"ContractInstantiation\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_LBC *LBCFilterer) WatchBalanceIncrease(opts *bind.WatchOpts, sink chan<- *LBCBalanceIncrease) (event.Subscription, error) {\n\n\tlogs, sub, err := _LBC.contract.WatchLogs(opts, \"BalanceIncrease\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(LBCBalanceIncrease)\n\t\t\t\tif err := _LBC.contract.UnpackLog(event, \"BalanceIncrease\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_NewsroomFactory *NewsroomFactoryFilterer) WatchContractInstantiation(opts *bind.WatchOpts, sink chan<- *NewsroomFactoryContractInstantiation) (event.Subscription, error) {\n\n\tlogs, sub, err := _NewsroomFactory.contract.WatchLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(NewsroomFactoryContractInstantiation)\n\t\t\t\tif err := _NewsroomFactory.contract.UnpackLog(event, \"ContractInstantiation\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func newAuthAccountContractsChangeFunction(\n\tfunctionType *sema.FunctionType,\n\tgauge common.MemoryGauge,\n\thandler AccountContractAdditionHandler,\n\taddressValue interpreter.AddressValue,\n\tisUpdate bool,\n) *interpreter.HostFunctionValue {\n\treturn interpreter.NewHostFunctionValue(\n\t\tgauge,\n\t\tfunctionType,\n\t\tfunc(invocation interpreter.Invocation) interpreter.Value {\n\n\t\t\tlocationRange := invocation.LocationRange\n\n\t\t\tconst requiredArgumentCount = 2\n\n\t\t\tnameValue, ok := invocation.Arguments[0].(*interpreter.StringValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tnewCodeValue, ok := invocation.Arguments[1].(*interpreter.ArrayValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tconstructorArguments := invocation.Arguments[requiredArgumentCount:]\n\t\t\tconstructorArgumentTypes := invocation.ArgumentTypes[requiredArgumentCount:]\n\n\t\t\tcode, err := interpreter.ByteArrayValueToByteSlice(invocation.Interpreter, newCodeValue, locationRange)\n\t\t\tif err != nil {\n\t\t\t\tpanic(errors.NewDefaultUserError(\"add requires the second argument to be an array\"))\n\t\t\t}\n\n\t\t\t// Get the existing code\n\n\t\t\tcontractName := nameValue.Str\n\n\t\t\tif contractName == \"\" {\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"contract name argument cannot be empty.\" +\n\t\t\t\t\t\t\"it must match the name of the deployed contract declaration or contract interface declaration\",\n\t\t\t\t))\n\t\t\t}\n\n\t\t\taddress := addressValue.ToAddress()\n\t\t\tlocation := common.NewAddressLocation(invocation.Interpreter, address, contractName)\n\n\t\t\texistingCode, err := handler.GetAccountContractCode(location)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tif isUpdate {\n\t\t\t\t// We are updating an existing contract.\n\t\t\t\t// Ensure that there's a contract/contract-interface with the given name exists already\n\n\t\t\t\tif len(existingCode) == 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot update non-existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// We are adding a new contract.\n\t\t\t\t// Ensure that no contract/contract interface with the given name exists already\n\n\t\t\t\tif len(existingCode) > 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot overwrite existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check the code\n\t\t\thandleContractUpdateError := func(err error) {\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(&InvalidContractDeploymentError{\n\t\t\t\t\tErr: err,\n\t\t\t\t\tLocationRange: locationRange,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// NOTE: do NOT use the program obtained from the host environment, as the current program.\n\t\t\t// Always re-parse and re-check the new program.\n\n\t\t\t// NOTE: *DO NOT* store the program – the new or updated program\n\t\t\t// should not be effective during the execution\n\n\t\t\tconst getAndSetProgram = false\n\n\t\t\tprogram, err := handler.ParseAndCheckProgram(\n\t\t\t\tcode,\n\t\t\t\tlocation,\n\t\t\t\tgetAndSetProgram,\n\t\t\t)\n\t\t\thandleContractUpdateError(err)\n\n\t\t\t// The code may declare exactly one contract or one contract interface.\n\n\t\t\tvar contractTypes []*sema.CompositeType\n\t\t\tvar contractInterfaceTypes []*sema.InterfaceType\n\n\t\t\tprogram.Elaboration.ForEachGlobalType(func(_ string, variable *sema.Variable) {\n\t\t\t\tswitch ty := variable.Type.(type) {\n\t\t\t\tcase *sema.CompositeType:\n\t\t\t\t\tif ty.Kind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractTypes = append(contractTypes, ty)\n\t\t\t\t\t}\n\n\t\t\t\tcase *sema.InterfaceType:\n\t\t\t\t\tif ty.CompositeKind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractInterfaceTypes = append(contractInterfaceTypes, ty)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar deployedType sema.Type\n\t\t\tvar contractType *sema.CompositeType\n\t\t\tvar contractInterfaceType *sema.InterfaceType\n\t\t\tvar declaredName string\n\t\t\tvar declarationKind common.DeclarationKind\n\n\t\t\tswitch {\n\t\t\tcase len(contractTypes) == 1 && len(contractInterfaceTypes) == 0:\n\t\t\t\tcontractType = contractTypes[0]\n\t\t\t\tdeclaredName = contractType.Identifier\n\t\t\t\tdeployedType = contractType\n\t\t\t\tdeclarationKind = common.DeclarationKindContract\n\t\t\tcase len(contractInterfaceTypes) == 1 && len(contractTypes) == 0:\n\t\t\t\tcontractInterfaceType = contractInterfaceTypes[0]\n\t\t\t\tdeclaredName = contractInterfaceType.Identifier\n\t\t\t\tdeployedType = contractInterfaceType\n\t\t\t\tdeclarationKind = common.DeclarationKindContractInterface\n\t\t\t}\n\n\t\t\tif deployedType == nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the code must declare exactly one contract or contract interface\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// The declared contract or contract interface must have the name\n\t\t\t// passed to the constructor as the first argument\n\n\t\t\tif declaredName != contractName {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the name argument must match the name of the declaration: got %q, expected %q\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t\tcontractName,\n\t\t\t\t\tdeclaredName,\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// Validate the contract update\n\n\t\t\tif isUpdate {\n\t\t\t\toldCode, err := handler.GetAccountContractCode(location)\n\t\t\t\thandleContractUpdateError(err)\n\n\t\t\t\toldProgram, err := parser.ParseProgram(\n\t\t\t\t\tgauge,\n\t\t\t\t\toldCode,\n\t\t\t\t\tparser.Config{},\n\t\t\t\t)\n\n\t\t\t\tif !ignoreUpdatedProgramParserError(err) {\n\t\t\t\t\thandleContractUpdateError(err)\n\t\t\t\t}\n\n\t\t\t\tvalidator := NewContractUpdateValidator(\n\t\t\t\t\tlocation,\n\t\t\t\t\tcontractName,\n\t\t\t\t\toldProgram,\n\t\t\t\t\tprogram.Program,\n\t\t\t\t)\n\t\t\t\terr = validator.Validate()\n\t\t\t\thandleContractUpdateError(err)\n\t\t\t}\n\n\t\t\tinter := invocation.Interpreter\n\n\t\t\terr = updateAccountContractCode(\n\t\t\t\thandler,\n\t\t\t\tlocation,\n\t\t\t\tprogram,\n\t\t\t\tcode,\n\t\t\t\tcontractType,\n\t\t\t\tconstructorArguments,\n\t\t\t\tconstructorArgumentTypes,\n\t\t\t\tupdateAccountContractCodeOptions{\n\t\t\t\t\tcreateContract: !isUpdate,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tvar eventType *sema.CompositeType\n\n\t\t\tif isUpdate {\n\t\t\t\teventType = AccountContractUpdatedEventType\n\t\t\t} else {\n\t\t\t\teventType = AccountContractAddedEventType\n\t\t\t}\n\n\t\t\tcodeHashValue := CodeToHashValue(inter, code)\n\n\t\t\thandler.EmitEvent(\n\t\t\t\tinter,\n\t\t\t\teventType,\n\t\t\t\t[]interpreter.Value{\n\t\t\t\t\taddressValue,\n\t\t\t\t\tcodeHashValue,\n\t\t\t\t\tnameValue,\n\t\t\t\t},\n\t\t\t\tlocationRange,\n\t\t\t)\n\n\t\t\treturn interpreter.NewDeployedContractValue(\n\t\t\t\tinter,\n\t\t\t\taddressValue,\n\t\t\t\tnameValue,\n\t\t\t\tnewCodeValue,\n\t\t\t)\n\t\t},\n\t)\n}",
"func (_KyberNetworkProxyV4 *KyberNetworkProxyV4Filterer) WatchEtherWithdraw(opts *bind.WatchOpts, sink chan<- *KyberNetworkProxyV4EtherWithdraw) (event.Subscription, error) {\n\n\tlogs, sub, err := _KyberNetworkProxyV4.contract.WatchLogs(opts, \"EtherWithdraw\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(KyberNetworkProxyV4EtherWithdraw)\n\t\t\t\tif err := _KyberNetworkProxyV4.contract.UnpackLog(event, \"EtherWithdraw\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (s *MarketWatch) storeContract(locationID int64, c Contract) (ContractChange, bool) {\n\tsMap := s.getContractStore(locationID)\n\tchange := ContractChange{\n\t\tContractId: c.Contract.Contract.ContractId,\n\t\tLocationId: c.Contract.Contract.StartLocationId,\n\t\tTimeChanged: time.Now().UTC(), // We know this was within 30 minutes of this time\n\t}\n\n\tv, loaded := sMap.LoadOrStore(c.Contract.Contract.ContractId, c)\n\tif loaded {\n\t\tcontract := v.(Contract)\n\t\tif len(contract.Contract.Bids) != len(c.Contract.Bids) {\n\t\t\tchange.Price = contract.Contract.Contract.Price\n\t\t\tchange.Bids = contract.Contract.Bids\n\t\t\tchange.Type_ = contract.Contract.Contract.Type_\n\t\t\tchange.DateExpired = contract.Contract.Contract.DateExpired\n\t\t\tchange.Changed = true\n\t\t}\n\t\tsMap.Store(contract.Contract.Contract.ContractId, contract)\n\t\treturn change, false\n\t}\n\treturn change, true\n}",
"func (_Oneinch *OneinchFilterer) WatchImplementationUpdated(opts *bind.WatchOpts, sink chan<- *OneinchImplementationUpdated, newImpl []common.Address) (event.Subscription, error) {\n\n\tvar newImplRule []interface{}\n\tfor _, newImplItem := range newImpl {\n\t\tnewImplRule = append(newImplRule, newImplItem)\n\t}\n\n\tlogs, sub, err := _Oneinch.contract.WatchLogs(opts, \"ImplementationUpdated\", newImplRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(OneinchImplementationUpdated)\n\t\t\t\tif err := _Oneinch.contract.UnpackLog(event, \"ImplementationUpdated\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_VorCoordinator *VorCoordinatorFilterer) WatchChangeFee(opts *bind.WatchOpts, sink chan<- *VorCoordinatorChangeFee) (event.Subscription, error) {\n\n\tlogs, sub, err := _VorCoordinator.contract.WatchLogs(opts, \"ChangeFee\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(VorCoordinatorChangeFee)\n\t\t\t\tif err := _VorCoordinator.contract.UnpackLog(event, \"ChangeFee\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_MSContract *MSContractFilterer) WatchEventClosing(opts *bind.WatchOpts, sink chan<- *MSContractEventClosing) (event.Subscription, error) {\n\n\tlogs, sub, err := _MSContract.contract.WatchLogs(opts, \"EventClosing\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(MSContractEventClosing)\n\t\t\t\tif err := _MSContract.contract.UnpackLog(event, \"EventClosing\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_BerryMaster *BerryMasterFilterer) WatchNewBerryAddress(opts *bind.WatchOpts, sink chan<- *BerryMasterNewBerryAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.WatchLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(BerryMasterNewBerryAddress)\n\t\t\t\tif err := _BerryMaster.contract.UnpackLog(event, \"NewBerryAddress\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_ILendingPool *ILendingPoolFilterer) WatchReserveDataUpdated(opts *bind.WatchOpts, sink chan<- *ILendingPoolReserveDataUpdated, reserve []common.Address) (event.Subscription, error) {\n\n\tvar reserveRule []interface{}\n\tfor _, reserveItem := range reserve {\n\t\treserveRule = append(reserveRule, reserveItem)\n\t}\n\n\tlogs, sub, err := _ILendingPool.contract.WatchLogs(opts, \"ReserveDataUpdated\", reserveRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ILendingPoolReserveDataUpdated)\n\t\t\t\tif err := _ILendingPool.contract.UnpackLog(event, \"ReserveDataUpdated\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_EthoFSController *EthoFSControllerSession) ExtendContract(HostingContractAddress common.Address, HostingContractExtensionDuration uint32) (*types.Transaction, error) {\n\treturn _EthoFSController.Contract.ExtendContract(&_EthoFSController.TransactOpts, HostingContractAddress, HostingContractExtensionDuration)\n}",
"func (_Stakinginfo *StakinginfoFilterer) WatchRewardUpdate(opts *bind.WatchOpts, sink chan<- *StakinginfoRewardUpdate) (event.Subscription, error) {\n\n\tlogs, sub, err := _Stakinginfo.contract.WatchLogs(opts, \"RewardUpdate\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(StakinginfoRewardUpdate)\n\t\t\t\tif err := _Stakinginfo.contract.UnpackLog(event, \"RewardUpdate\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func NewUpgradeContractRequest(from *account.Account, module, name string, code []byte, opts ...RequestOption) (*Request, error) {\n\tif from == nil || !from.HasContractAccount() {\n\t\treturn nil, common.ErrInvalidAccount\n\t}\n\n\tif module == \"\" || name == \"\" || len(code) == 0 {\n\t\treturn nil, common.ErrInvalidParam\n\t}\n\n\treqArgs := generateDeployArgs(nil, nil, code, module, \"\", from.GetContractAccount(), name)\n\treturn NewRequest(from, Xkernel3Module, \"\", XkernelUpgradeMethod, reqArgs, \"\", \"\", opts...)\n}",
"func (_CrossEther *CrossEtherFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *CrossEtherWithdraw) (event.Subscription, error) {\n\n\tlogs, sub, err := _CrossEther.contract.WatchLogs(opts, \"Withdraw\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CrossEtherWithdraw)\n\t\t\t\tif err := _CrossEther.contract.UnpackLog(event, \"Withdraw\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
FilterNewCard is a free log retrieval operation binding the contract event 0xc56570397f0bcf235fc72dc30f5c4d9c77206bfce1443759a8ee3a19dcd196e4. Solidity: event NewCard(owner address, cardID uint256, creationBattleID uint128, attributes uint256)
|
func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {
logs, sub, err := _CardBattles.contract.FilterLogs(opts, "NewCard")
if err != nil {
return nil, err
}
return &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: "NewCard", logs: logs, sub: sub}, nil
}
|
[
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesNewCard)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseNewCard)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewSupplyCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapIterator{contract: _Comptroller.contract, event: \"NewSupplyCap\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewSupplyCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapGuardianIterator{contract: _Comptroller.contract, event: \"NewSupplyCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewBorrowCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapIterator{contract: _Comptroller.contract, event: \"NewBorrowCap\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewBorrowCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapGuardianIterator{contract: _Comptroller.contract, event: \"NewBorrowCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func (_Pxa *PxaFilterer) FilterNewAsset(opts *bind.FilterOpts) (*PxaNewAssetIterator, error) {\n\n\tlogs, sub, err := _Pxa.contract.FilterLogs(opts, \"NewAsset\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PxaNewAssetIterator{contract: _Pxa.contract, event: \"NewAsset\", logs: logs, sub: sub}, nil\n}",
"func (_BerryMaster *BerryMasterFilterer) FilterNewBerryAddress(opts *bind.FilterOpts) (*BerryMasterNewBerryAddressIterator, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.FilterLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryMasterNewBerryAddressIterator{contract: _BerryMaster.contract, event: \"NewBerryAddress\", logs: logs, sub: sub}, nil\n}",
"func (_ParameterizerContract *ParameterizerContractFilterer) FilterNewChallenge(opts *bind.FilterOpts, propID [][32]byte, challenger []common.Address) (*ParameterizerContractNewChallengeIterator, error) {\n\n\tvar propIDRule []interface{}\n\tfor _, propIDItem := range propID {\n\t\tpropIDRule = append(propIDRule, propIDItem)\n\t}\n\n\tvar challengerRule []interface{}\n\tfor _, challengerItem := range challenger {\n\t\tchallengerRule = append(challengerRule, challengerItem)\n\t}\n\n\tlogs, sub, err := _ParameterizerContract.contract.FilterLogs(opts, \"_NewChallenge\", propIDRule, challengerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ParameterizerContractNewChallengeIterator{contract: _ParameterizerContract.contract, event: \"_NewChallenge\", logs: logs, sub: sub}, nil\n}",
"func (_Paper *PaperFilterer) FilterNewPaper(opts *bind.FilterOpts) (*PaperNewPaperIterator, error) {\n\n\tlogs, sub, err := _Paper.contract.FilterLogs(opts, \"NewPaper\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PaperNewPaperIterator{contract: _Paper.contract, event: \"NewPaper\", logs: logs, sub: sub}, nil\n}",
"func (_BattleGroups *BattleGroupsFilterer) FilterNewBattleGroup(opts *bind.FilterOpts) (*BattleGroupsNewBattleGroupIterator, error) {\n\n\tlogs, sub, err := _BattleGroups.contract.FilterLogs(opts, \"NewBattleGroup\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattleGroupsNewBattleGroupIterator{contract: _BattleGroups.contract, event: \"NewBattleGroup\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewCloseFactor(opts *bind.FilterOpts) (*ComptrollerNewCloseFactorIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewCloseFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewCloseFactorIterator{contract: _Comptroller.contract, event: \"NewCloseFactor\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCapGuardian(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCapGuardian) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCapGuardian)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCapGuardian\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCap(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCap, cToken []common.Address) (event.Subscription, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCap)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCap\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) ParseNewSupplyCap(log types.Log) (*ComptrollerNewSupplyCap, error) {\n\tevent := new(ComptrollerNewSupplyCap)\n\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCap\", log); err != nil {\n\t\treturn nil, err\n\t}\n\tevent.Raw = log\n\treturn event, nil\n}",
"func (_LivroVisitas *LivroVisitasFilterer) FilterNewVisitor(opts *bind.FilterOpts) (*LivroVisitasNewVisitorIterator, error) {\n\n\tlogs, sub, err := _LivroVisitas.contract.FilterLogs(opts, \"NewVisitor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LivroVisitasNewVisitorIterator{contract: _LivroVisitas.contract, event: \"NewVisitor\", logs: logs, sub: sub}, nil\n}",
"func (q *Query) NewFilter(fn FilterFunc) *Filter {\n done := make(chan bool)\n q.done = append(q.done, done)\n f := &Filter{\n in: make(chan *blob.Blob),\n fn: fn,\n out: q.result,\n done: done,\n skip: q.skip,\n }\n q.filters = append(q.filters, f)\n return f\n}",
"func newCaptureFilter(opts FilterOptions) (*captureFilter, error) {\n\tif opts == nil {\n\t\treturn &captureFilter{CaptureFilterOptions: DefaultCaptureFilterOptions()}, nil\n\t}\n\n\tvar capOpts *CaptureFilterOptions\n\tswitch opts.(type) {\n\tcase *CaptureFilterOptions:\n\t\tcapOpts = opts.(*CaptureFilterOptions)\n\t\tbreak\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Need CaptureFilterOptions\")\n\t}\n\n\treturn &captureFilter{CaptureFilterOptions: capOpts}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WatchNewCard is a free log subscription operation binding the contract event 0xc56570397f0bcf235fc72dc30f5c4d9c77206bfce1443759a8ee3a19dcd196e4. Solidity: event NewCard(owner address, cardID uint256, creationBattleID uint128, attributes uint256)
|
func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {
logs, sub, err := _CardBattles.contract.WatchLogs(opts, "NewCard")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(CardBattlesNewCard)
if err := _CardBattles.contract.UnpackLog(event, "NewCard", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
|
[
"func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseNewCard)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCap(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCap, cToken []common.Address) (event.Subscription, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCap)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCap\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewSupplyCapGuardian(opts *bind.WatchOpts, sink chan<- *ComptrollerNewSupplyCapGuardian) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewSupplyCapGuardian)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewSupplyCapGuardian\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewBorrowCap(opts *bind.WatchOpts, sink chan<- *ComptrollerNewBorrowCap, cToken []common.Address) (event.Subscription, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewBorrowCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewBorrowCap)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewBorrowCap\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_BerryMaster *BerryMasterFilterer) WatchNewBerryAddress(opts *bind.WatchOpts, sink chan<- *BerryMasterNewBerryAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.WatchLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(BerryMasterNewBerryAddress)\n\t\t\t\tif err := _BerryMaster.contract.UnpackLog(event, \"NewBerryAddress\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"createCard\", _owner, _attributes)\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewBorrowCapGuardian(opts *bind.WatchOpts, sink chan<- *ComptrollerNewBorrowCapGuardian) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewBorrowCapGuardian)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewBorrowCapGuardian\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCap(opts *bind.FilterOpts, cToken []common.Address) (*ComptrollerNewSupplyCapIterator, error) {\n\n\tvar cTokenRule []interface{}\n\tfor _, cTokenItem := range cToken {\n\t\tcTokenRule = append(cTokenRule, cTokenItem)\n\t}\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCap\", cTokenRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapIterator{contract: _Comptroller.contract, event: \"NewSupplyCap\", logs: logs, sub: sub}, nil\n}",
"func (_Pxa *PxaFilterer) WatchNewAsset(opts *bind.WatchOpts, sink chan<- *PxaNewAsset) (event.Subscription, error) {\n\n\tlogs, sub, err := _Pxa.contract.WatchLogs(opts, \"NewAsset\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(PxaNewAsset)\n\t\t\t\tif err := _Pxa.contract.UnpackLog(event, \"NewAsset\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (wts *WTServer) SendNewWatchNewChannel(newChan *channeldb.OpenChannel) error {\n\tmsg := NewWatchNewChannelMessage(newChan)\n\treturn wts.SendToPeers(msg)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)\n}",
"func (s *csServer) Create(ctx context.Context, c *cs.Card) (*cs.Card, error) {\n\n\ttx, err := s.db.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuid, err := tx.CreateCard(c)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\ttx.Rollback()\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\tc.Id = uid\n\n\tlog.Printf(\"created card: %+v\\n\", c)\n\treturn c, nil\n}",
"func (_Comptroller *ComptrollerFilterer) WatchNewCloseFactor(opts *bind.WatchOpts, sink chan<- *ComptrollerNewCloseFactor) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comptroller.contract.WatchLogs(opts, \"NewCloseFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ComptrollerNewCloseFactor)\n\t\t\t\tif err := _Comptroller.contract.UnpackLog(event, \"NewCloseFactor\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_Paper *PaperFilterer) WatchNewPaper(opts *bind.WatchOpts, sink chan<- *PaperNewPaper) (event.Subscription, error) {\n\n\tlogs, sub, err := _Paper.contract.WatchLogs(opts, \"NewPaper\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(PaperNewPaper)\n\t\t\t\tif err := _Paper.contract.UnpackLog(event, \"NewPaper\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_ParameterizerContract *ParameterizerContractFilterer) WatchNewChallenge(opts *bind.WatchOpts, sink chan<- *ParameterizerContractNewChallenge, propID [][32]byte, challenger []common.Address) (event.Subscription, error) {\n\n\tvar propIDRule []interface{}\n\tfor _, propIDItem := range propID {\n\t\tpropIDRule = append(propIDRule, propIDItem)\n\t}\n\n\tvar challengerRule []interface{}\n\tfor _, challengerItem := range challenger {\n\t\tchallengerRule = append(challengerRule, challengerItem)\n\t}\n\n\tlogs, sub, err := _ParameterizerContract.contract.WatchLogs(opts, \"_NewChallenge\", propIDRule, challengerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ParameterizerContractNewChallenge)\n\t\t\t\tif err := _ParameterizerContract.contract.UnpackLog(event, \"_NewChallenge\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (s *Service) createCardHandler(w http.ResponseWriter, r *http.Request) {\n\t// Get the authenticated user from the request context\n\tauthenticatedUser, err := accounts.GetAuthenticatedUser(r)\n\tif err != nil {\n\t\tresponse.UnauthorizedError(w, err.Error())\n\t\treturn\n\t}\n\n\t// Request body cannot be nil\n\tif r.Body == nil {\n\t\tresponse.Error(w, \"Request body cannot be nil\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Read the request body\n\tpayload, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tresponse.Error(w, \"Error reading request body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Unmarshal the request body into the request prototype\n\tcardRequest := new(CardRequest)\n\tif err := json.Unmarshal(payload, cardRequest); err != nil {\n\t\tlogger.ERROR.Printf(\"Failed to unmarshal card request: %s\", payload)\n\t\tresponse.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Create a new card\n\tcard, err := s.createCard(authenticatedUser, cardRequest)\n\tif err != nil {\n\t\tlogger.ERROR.Printf(\"Create card error: %s\", err)\n\t\tresponse.Error(w, err.Error(), getErrStatusCode(err))\n\t\treturn\n\t}\n\n\t// Create response\n\tcardResponse, err := NewCardResponse(card)\n\tif err != nil {\n\t\tresponse.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// Set Location header to the newly created resource\n\tw.Header().Set(\"Location\", fmt.Sprintf(\"/v1/cards/%d\", card.ID))\n\t// Write JSON response\n\tresponse.WriteJSON(w, cardResponse, http.StatusCreated)\n}",
"func (m *MoonpayCustomer) CreateCard(tokenid uuid.UUID) (card Card, err error) {\n\ttype data struct {\n\t\tTokenID uuid.UUID `json:\"tokenId\"`\n\t}\n\tresp, err := req.Post(m.url(\"/cards\"), m.authHeader(), req.BodyJSON(data{tokenid}))\n\tif err := m.handleError(resp, err); err != nil {\n\t\treturn card, err\n\t}\n\n\terr = resp.ToJSON(&card)\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DeployCardMinting deploys a new Ethereum contract, binding an instance of CardMinting to it.
|
func DeployCardMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardMinting, error) {
parsed, err := abi.JSON(strings.NewReader(CardMintingABI))
if err != nil {
return common.Address{}, nil, nil, err
}
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardMintingBin), backend)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil
}
|
[
"func DeployMonsterMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MonsterMinting, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MonsterMintingABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MonsterMintingBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &MonsterMinting{MonsterMintingCaller: MonsterMintingCaller{contract: contract}, MonsterMintingTransactor: MonsterMintingTransactor{contract: contract}, MonsterMintingFilterer: MonsterMintingFilterer{contract: contract}}, nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardMinting(address common.Address, backend bind.ContractBackend) (*CardMinting, error) {\n\tcontract, err := bindCardMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func (c *Contract) Deploy(account *Account) {\n\tif err := keos.Client.WalletUnlock(keos.Wallet, keos.WalletPassword); err != nil {\n\t\tif !strings.Contains(err.Error(), \"Already unlocked\") {\n\t\t\tlogrus.Fatalln(err)\n\t\t}\n\t}\n\n\tpathParts := strings.Split(strings.TrimRight(c.Path, \"/\"), \"/\")\n\twasmName := fmt.Sprintf(\"%s.wasm\", pathParts[len(pathParts)-1])\n\tabiName := fmt.Sprintf(\"%s.abi\", pathParts[len(pathParts)-1])\n\n\tc.Account = account\n\tfmt.Print(c.Account.Name)\n\n\tsetCode, err := system.NewSetCode(\n\t\teosgo.AccountName(c.Account.Name),\n\t\tfmt.Sprintf(\"%s/%s\", c.Path, wasmName),\n\t)\n\tif err != nil {\n\t\tnodeos.PushError(err)\n\t\treturn\n\t}\n\n\tsetAbi, err := system.NewSetABI(\n\t\teosgo.AccountName(c.Account.Name),\n\t\tfmt.Sprintf(\"%s/%s\", c.Path, abiName),\n\t)\n\tif err != nil {\n\t\tnodeos.PushError(err)\n\t\treturn\n\t}\n\n\tif _, err = nodeos.Client.SignPushActions(\n\t\tsetCode,\n\t\tsetAbi,\n\t); err != nil {\n\t\tnodeos.PushError(err)\n\t}\n\n\treturn\n}",
"func DeployCardBase(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBase, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBaseBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func (nc *NeoVMContract) DeployNeoVMSmartContract(\r\n\tgasPrice,\r\n\tgasLimit uint64,\r\n\tsinger *Account,\r\n\tneedStorage bool,\r\n\tcode,\r\n\tname,\r\n\tversion,\r\n\tauthor,\r\n\temail,\r\n\tdesc string) (common.Uint256, error) {\r\n\r\n\tinvokeCode, err := hex.DecodeString(code)\r\n\tif err != nil {\r\n\t\treturn common.UINT256_EMPTY, fmt.Errorf(\"code hex decode error:%s\", err)\r\n\t}\r\n\ttx := nc.NewDeployNeoVMCodeTransaction(gasPrice, gasLimit, &sdkcom.SmartContract{\r\n\t\tCode: invokeCode,\r\n\t\tNeedStorage: needStorage,\r\n\t\tName: name,\r\n\t\tVersion: version,\r\n\t\tAuthor: author,\r\n\t\tEmail: email,\r\n\t\tDescription: desc,\r\n\t})\r\n\terr = nc.ontSdk.SignToTransaction(tx, singer)\r\n\tif err != nil {\r\n\t\treturn common.Uint256{}, err\r\n\t}\r\n\ttxHash, err := nc.ontSdk.SendTransaction(tx)\r\n\tif err != nil {\r\n\t\treturn common.Uint256{}, fmt.Errorf(\"SendRawTransaction error:%s\", err)\r\n\t}\r\n\treturn txHash, nil\r\n}",
"func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func DeployCardBattles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBattles, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBattlesBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBattles{CardBattlesCaller: CardBattlesCaller{contract: contract}, CardBattlesTransactor: CardBattlesTransactor{contract: contract}, CardBattlesFilterer: CardBattlesFilterer{contract: contract}}, nil\n}",
"func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func TestVMKeeper_DeployModule(t *testing.T) {\n\tconfig := sdk.GetConfig()\n\tdnodeConfig.InitBechPrefixes(config)\n\n\tinput := newTestInput(false)\n\n\t// launch docker\n\tstopContainer := startDVMContainer(t, input.dsPort)\n\tdefer stopContainer()\n\n\t// create accounts.\n\taddr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address())\n\tacc1 := input.ak.NewAccountWithAddress(input.ctx, addr1)\n\n\tinput.ak.SetAccount(input.ctx, acc1)\n\n\tgs := getGenesis(t)\n\tinput.vk.InitGenesis(input.ctx, gs)\n\tinput.vk.SetDSContext(input.ctx)\n\tinput.vk.StartDSServer(input.ctx)\n\ttime.Sleep(2 * time.Second)\n\n\tbytecodeModule, err := vm_client.Compile(*vmCompiler, &compiler_grpc.SourceFiles{\n\t\tUnits: []*compiler_grpc.CompilationUnit{\n\t\t\t{\n\t\t\t\tText: mathModule,\n\t\t\t\tName: \"MathModule\",\n\t\t\t},\n\t\t},\n\t\tAddress: common_vm.Bech32ToLibra(addr1),\n\t})\n\trequire.NoErrorf(t, err, \"can't get code for math module: %v\", err)\n\trequire.Len(t, bytecodeModule, 1)\n\n\tmsg := types.NewMsgDeployModule(addr1, []types.Contract{bytecodeModule[0].ByteCode})\n\terr = msg.ValidateBasic()\n\trequire.NoErrorf(t, err, \"can't validate err: %v\", err)\n\n\tctx, writeCtx := input.ctx.CacheContext()\n\terr = input.vk.DeployContract(ctx, msg)\n\trequire.NoErrorf(t, err, \"can't deploy contract: %v\", err)\n\n\tevents := ctx.EventManager().Events()\n\tcheckNoEventErrors(events, t)\n\n\twriteCtx()\n\n\tbytecodeScript, err := vm_client.Compile(*vmCompiler, &compiler_grpc.SourceFiles{\n\t\tUnits: []*compiler_grpc.CompilationUnit{\n\t\t\t{\n\t\t\t\tText: strings.Replace(mathScript, \"{{sender}}\", addr1.String(), 1),\n\t\t\t\tName: \"MathScript\",\n\t\t\t},\n\t\t},\n\t\tAddress: common_vm.Bech32ToLibra(addr1),\n\t})\n\trequire.NoErrorf(t, err, \"can't compiler script for math module: %v\", err)\n\trequire.Len(t, bytecodeScript, 1)\n\n\tvar args []types.ScriptArg\n\t{\n\t\targ, err := vm_client.NewU64ScriptArg(\"10\")\n\t\trequire.NoError(t, err)\n\t\targs = append(args, arg)\n\t}\n\t{\n\t\targ, err := vm_client.NewU64ScriptArg(\"100\")\n\t\trequire.NoError(t, err)\n\t\targs = append(args, arg)\n\t}\n\n\tctx, _ = input.ctx.CacheContext()\n\tmsgScript := types.NewMsgExecuteScript(addr1, bytecodeScript[0].ByteCode, args)\n\terr = input.vk.ExecuteScript(ctx, msgScript)\n\trequire.NoError(t, err)\n\n\tevents = ctx.EventManager().Events()\n\tcheckNoEventErrors(events, t)\n\n\tcheckEventsContainsEvery(t, events, newKeepEvents())\n\tvmEvent := events[2]\n\trequire.Equal(t, vmEvent.Type, types.EventTypeMoveEvent, \"script after execution doesn't contain event with amount\")\n\trequire.Len(t, vmEvent.Attributes, 4)\n\t// sender\n\t{\n\t\tattrIdx := 0\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventSender)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, types.StringifySenderAddress(addr1))\n\t}\n\t// source\n\t{\n\t\tattrIdx := 1\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventSource)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, types.GetEventSourceAttribute(nil))\n\t}\n\t// type\n\t{\n\t\tattrIdx := 2\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventType)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, types.StringifyEventTypePanic(sdk.NewInfiniteGasMeter(), &vm_grpc.LcsTag{TypeTag: vm_grpc.LcsType_LcsU64}))\n\t}\n\t// data\n\t{\n\t\tattrIdx := 3\n\t\tuintBz := make([]byte, 8)\n\t\tbinary.LittleEndian.PutUint64(uintBz, uint64(110))\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventData)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, hex.EncodeToString(uintBz))\n\t}\n}",
"func (f *FastTestTokenContract) DeployContract(\n\tauth *bind.TransactOpts,\n\tclient eth_rpc_client.IEthClient,\n) error {\n\taddress, tx, instance, err := DeployFastTestToken(auth, client)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.Address = address\n\tf.LastTx = tx\n\tf.Instance = instance\n\treturn nil\n}",
"func (op *OpenGo) DeployEthereumScaffold(ctx context.Context, scaffold EthereumScaffold) (EthereumScaffold, error) {\n\top.baseURL.Path = \"/api/ethereum-scaffolds/doDeploy\"\n\tscaffoldJSON, _ := json.Marshal(scaffold)\n\tresponse, err := op.SendRequest(ctx, \"POST\", scaffoldJSON)\n\n\tif err != nil {\n\t\treturn EthereumScaffold{}, fmt.Errorf(\"The HTTP request failed with error %s\\n\", err)\n\t}\n\tdata, _ := ioutil.ReadAll(response.Body)\n\tjson.Unmarshal(data, scaffold)\n\treturn scaffold, nil\n}",
"func deployStakingContract(t *testing.T, b *emulator.Blockchain, IDTableAccountKey *flow.AccountKey, IDTableSigner crypto.Signer, env templates.Environment, latest bool) (flow.Address, flow.Address) {\n\n\t// create the public key array for the staking and fees account\n\tpublicKeys := make([]cadence.Value, 1)\n\tpublicKeys[0] = bytesToCadenceArray(IDTableAccountKey.Encode())\n\tcadencePublicKeys := cadence.NewArray(publicKeys)\n\n\t// Get the code byte-array for the fees contract\n\tFeesCode := contracts.TestFlowFees(emulatorFTAddress, emulatorFlowTokenAddress)\n\n\t// Deploy the fees contract\n\tfeesAddr, err := b.CreateAccount([]*flow.AccountKey{IDTableAccountKey}, []sdktemplates.Contract{\n\t\t{\n\t\t\tName: \"FlowFees\",\n\t\t\tSource: string(FeesCode),\n\t\t},\n\t})\n\tif !assert.NoError(t, err) {\n\t\tt.Log(err.Error())\n\t}\n\t_, err = b.CommitBlock()\n\tassert.NoError(t, err)\n\n\tenv.FlowFeesAddress = feesAddr.Hex()\n\n\t// Get the code byte-array for the staking contract\n\tIDTableCode := contracts.FlowIDTableStaking(emulatorFTAddress, emulatorFlowTokenAddress, feesAddr.String(), latest)\n\tcadenceCode := bytesToCadenceArray(IDTableCode)\n\n\t// Create the deployment transaction that transfers a FlowToken minter\n\t// to the new account and deploys the IDTableStaking contract\n\ttx := createTxWithTemplateAndAuthorizer(b,\n\t\ttemplates.GenerateTransferMinterAndDeployScript(env),\n\t\tb.ServiceKey().Address)\n\n\t// Add the keys argument, contract name, and code\n\ttx.AddRawArgument(jsoncdc.MustEncode(cadencePublicKeys))\n\ttx.AddRawArgument(jsoncdc.MustEncode(CadenceString(\"FlowIDTableStaking\")))\n\ttx.AddRawArgument(jsoncdc.MustEncode(cadenceCode))\n\n\t// Set the weekly payount amount and delegator cut percentage\n\t_ = tx.AddArgument(CadenceUFix64(\"1250000.0\"))\n\t_ = tx.AddArgument(CadenceUFix64(\"0.08\"))\n\n\t// Submit the deployment transaction\n\tsignAndSubmit(\n\t\tt, b, tx,\n\t\t[]flow.Address{b.ServiceKey().Address},\n\t\t[]crypto.Signer{b.ServiceKey().Signer()},\n\t\tfalse,\n\t)\n\n\t// Query the AccountCreated event to get the deployed address of the staking contract\n\tvar idTableAddress flow.Address\n\tvar i uint64\n\ti = 0\n\tfor i < 1000 {\n\t\tresults, _ := b.GetEventsByHeight(i, \"flow.AccountCreated\")\n\n\t\tfor _, event := range results {\n\t\t\tif event.Type == flow.EventAccountCreated {\n\t\t\t\tidTableAddress = flow.Address(event.Value.Fields[0].(cadence.Address))\n\t\t\t}\n\t\t}\n\t\ti = i + 1\n\t}\n\n\t// Transfer the fees admin to the staking contract account\n\ttx = flow.NewTransaction().\n\t\tSetScript(templates.GenerateTransferFeesAdminScript(env)).\n\t\tSetGasLimit(9999).\n\t\tSetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).\n\t\tSetPayer(b.ServiceKey().Address).\n\t\tAddAuthorizer(feesAddr).\n\t\tAddAuthorizer(idTableAddress)\n\n\tsignAndSubmit(\n\t\tt, b, tx,\n\t\t[]flow.Address{b.ServiceKey().Address, feesAddr, idTableAddress},\n\t\t[]crypto.Signer{b.ServiceKey().Signer(), IDTableSigner, IDTableSigner},\n\t\tfalse,\n\t)\n\n\treturn idTableAddress, feesAddr\n}",
"func DeployMSContract(auth *bind.TransactOpts, backend bind.ContractBackend, _libSig common.Address, _addressAlice common.Address, _addressBob common.Address) (common.Address, *types.Transaction, *MSContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MSContractABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MSContractBin), backend, _libSig, _addressAlice, _addressBob)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &MSContract{MSContractCaller: MSContractCaller{contract: contract}, MSContractTransactor: MSContractTransactor{contract: contract}, MSContractFilterer: MSContractFilterer{contract: contract}}, nil\n}",
"func (_CardMinting *CardMintingTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {\n\treturn _CardMinting.contract.Transact(opts, \"transfer\", _to, _cardId)\n}",
"func DeployBerryMaster(auth *bind.TransactOpts, backend bind.ContractBackend, _berryContract common.Address) (common.Address, *types.Transaction, *BerryMaster, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BerryMasterABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BerryMasterBin), backend, _berryContract)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BerryMaster{BerryMasterCaller: BerryMasterCaller{contract: contract}, BerryMasterTransactor: BerryMasterTransactor{contract: contract}, BerryMasterFilterer: BerryMasterFilterer{contract: contract}}, nil\n}",
"func deployContract(ctx iscp.Sandbox) (dict.Dict, error) {\n\tctx.Log().Debugf(\"root.deployContract.begin\")\n\tif !isAuthorizedToDeploy(ctx) {\n\t\treturn nil, fmt.Errorf(\"root.deployContract: deploy not permitted for: %s\", ctx.Caller())\n\t}\n\tparams := kvdecoder.New(ctx.Params(), ctx.Log())\n\ta := assert.NewAssert(ctx.Log())\n\n\tprogHash := params.MustGetHashValue(ParamProgramHash)\n\tdescription := params.MustGetString(ParamDescription, \"N/A\")\n\tname := params.MustGetString(ParamName)\n\ta.Require(name != \"\", \"wrong name\")\n\n\t// pass to init function all params not consumed so far\n\tinitParams := dict.New()\n\tfor key, value := range ctx.Params() {\n\t\tif key != ParamProgramHash && key != ParamName && key != ParamDescription {\n\t\t\tinitParams.Set(key, value)\n\t\t}\n\t}\n\t// calls to loads VM from binary to check if it loads successfully\n\terr := ctx.DeployContract(progHash, \"\", \"\", nil)\n\ta.Require(err == nil, \"root.deployContract.fail 1: %v\", err)\n\n\t// VM loaded successfully. Storing contract in the registry and calling constructor\n\tmustStoreContractRecord(ctx, &ContractRecord{\n\t\tProgramHash: progHash,\n\t\tDescription: description,\n\t\tName: name,\n\t\tCreator: ctx.Caller(),\n\t}, a)\n\t_, err = ctx.Call(iscp.Hn(name), iscp.EntryPointInit, initParams, nil)\n\ta.RequireNoError(err)\n\n\tctx.Event(fmt.Sprintf(\"[deploy] name: %s hname: %s, progHash: %s, dscr: '%s'\",\n\t\tname, iscp.Hn(name), progHash.String(), description))\n\treturn nil, nil\n}",
"func NewCardMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*CardMintingTransactor, error) {\n\tcontract, err := bindCardMinting(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingTransactor{contract: contract}, nil\n}",
"func (_SchellingCoin *SchellingCoinTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SchellingCoin.contract.Transact(opts, \"mint\", account, amount)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardMinting creates a new instance of CardMinting, bound to a specific deployed contract.
|
func NewCardMinting(address common.Address, backend bind.ContractBackend) (*CardMinting, error) {
contract, err := bindCardMinting(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil
}
|
[
"func NewCardMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*CardMintingTransactor, error) {\n\tcontract, err := bindCardMinting(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingTransactor{contract: contract}, nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployCardMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardMinting, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardMintingBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func NewCardMintingCaller(address common.Address, caller bind.ContractCaller) (*CardMintingCaller, error) {\n\tcontract, err := bindCardMinting(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingCaller{contract: contract}, nil\n}",
"func NewMonsterMinting(address common.Address, backend bind.ContractBackend) (*MonsterMinting, error) {\n\tcontract, err := bindMonsterMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterMinting{MonsterMintingCaller: MonsterMintingCaller{contract: contract}, MonsterMintingTransactor: MonsterMintingTransactor{contract: contract}, MonsterMintingFilterer: MonsterMintingFilterer{contract: contract}}, nil\n}",
"func NewCardMintingFilterer(address common.Address, filterer bind.ContractFilterer) (*CardMintingFilterer, error) {\n\tcontract, err := bindCardMinting(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingFilterer{contract: contract}, nil\n}",
"func newAMCP(name string) *ekscontrolplanev1.AWSManagedControlPlane {\n\tgeneratedName := fmt.Sprintf(\"%s-%s\", name, util.RandomString(5))\n\treturn &ekscontrolplanev1.AWSManagedControlPlane{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"AWSManagedControlPlane\",\n\t\t\tAPIVersion: ekscontrolplanev1.GroupVersion.String(),\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: generatedName,\n\t\t\tNamespace: \"default\",\n\t\t},\n\t\tSpec: ekscontrolplanev1.AWSManagedControlPlaneSpec{\n\t\t\tEKSClusterName: generatedName,\n\t\t},\n\t}\n}",
"func newMinter(w *Wallet) *Minter {\n\treturn &Minter{\n\t\twallet: w,\n\t}\n}",
"func NewMintingPlugin(genesisMintCondition types.UnlockConditionProxy, minterDefinitionTransactionVersion, coinCreationTransactionVersion types.TransactionVersion, opts *PluginOptions) *Plugin {\n\tp := &Plugin{\n\t\tgenesisMintCondition: genesisMintCondition,\n\t\tminterDefinitionTransactionVersion: minterDefinitionTransactionVersion,\n\t\tcoinCreationTransactionVersion: coinCreationTransactionVersion,\n\t\trequireMinerFees: opts != nil && opts.RequireMinerFees,\n\t}\n\tvar legacyEncoding bool\n\tif opts != nil {\n\t\tlegacyEncoding = opts.UseLegacySiaEncoding\n\t\tif opts.CoinDestructionTransactionVersion > 0 {\n\t\t\ttypes.RegisterTransactionVersion(opts.CoinDestructionTransactionVersion, CoinDestructionTransactionController{\n\t\t\t\tMintingBaseTransactionController: MintingBaseTransactionController{\n\t\t\t\t\tUseLegacySiaEncoding: legacyEncoding,\n\t\t\t\t},\n\t\t\t\tTransactionVersion: opts.CoinDestructionTransactionVersion,\n\t\t\t})\n\t\t\tp.coinDestructionTransactionVersion = &opts.CoinDestructionTransactionVersion\n\t\t}\n\t}\n\ttypes.RegisterTransactionVersion(minterDefinitionTransactionVersion, MinterDefinitionTransactionController{\n\t\tMintingMinerFeeBaseTransactionController: MintingMinerFeeBaseTransactionController{\n\t\t\tMintingBaseTransactionController: MintingBaseTransactionController{\n\t\t\t\tUseLegacySiaEncoding: legacyEncoding,\n\t\t\t},\n\t\t\tRequireMinerFees: p.requireMinerFees,\n\t\t},\n\t\tMintConditionGetter: p,\n\t\tTransactionVersion: minterDefinitionTransactionVersion,\n\t})\n\ttypes.RegisterTransactionVersion(coinCreationTransactionVersion, CoinCreationTransactionController{\n\t\tMintingMinerFeeBaseTransactionController: MintingMinerFeeBaseTransactionController{\n\t\t\tMintingBaseTransactionController: MintingBaseTransactionController{\n\t\t\t\tUseLegacySiaEncoding: legacyEncoding,\n\t\t\t},\n\t\t\tRequireMinerFees: p.requireMinerFees,\n\t\t},\n\t\tMintConditionGetter: p,\n\t\tTransactionVersion: coinCreationTransactionVersion,\n\t})\n\tif legacyEncoding {\n\t\tp.binMarshal = siabin.Marshal\n\t\tp.binUnmarshal = siabin.Unmarshal\n\t} else {\n\t\tp.binMarshal = rivbin.Marshal\n\t\tp.binUnmarshal = rivbin.Unmarshal\n\t}\n\treturn p\n}",
"func (_IPairedErc20 *IPairedErc20Transactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IPairedErc20.contract.Transact(opts, \"mint\", account, amount)\n}",
"func (_SchellingCoin *SchellingCoinTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SchellingCoin.contract.Transact(opts, \"mint\", account, amount)\n}",
"func newMinion(name string, gruDumpCh chan<- *minionDumps) *minion {\n\treturn &minion{\n\t\tname: name,\n\t\tmu: &sync.RWMutex{},\n\t\tpayloadCh: make(chan *minionPayload),\n\t\tgruDumpCh: gruDumpCh,\n\t}\n}",
"func bindMonsterMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MonsterMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCard(suit Suit, rank Rank) Card {\n\treturn Card{suit: suit, rank: rank}\n}",
"func NewCard(in string) Card {\n\t//Check that the color indicator is in the list of CardColors\n\tvalidColor := false\n\tfor _, v := range CardColors {\n\t\tif string(in[0]) == v {\n\t\t\tvalidColor = true\n\t\t\tbreak //stop searching\n\t\t}\n\t}\n\t//If its not then stop.\n\tif !validColor {\n\t\tpanic(\"Tried to make a card with an invalid color.\")\n\t}\n\t//Everything seems fine(value errors handled in valToNum), make the card...\n\treturn Card{Col: string(in[0]), Val: string(in[1]), ValNum: valToNum(string(in[1]))}\n}",
"func NewMonsterMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*MonsterMintingTransactor, error) {\n\tcontract, err := bindMonsterMinting(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterMintingTransactor{contract: contract}, nil\n}",
"func NewMockATM(ctrl *gomock.Controller) *MockATM {\n\tmock := &MockATM{ctrl: ctrl}\n\tmock.recorder = &MockATMMockRecorder{mock}\n\treturn mock\n}",
"func (_PancakePair *PancakePairTransactor) Mint(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) {\n\treturn _PancakePair.contract.Transact(opts, \"mint\", to)\n}",
"func (_Bridge *BridgeTransactor) Mint(opts *bind.TransactOpts, transactionId []byte, receiver common.Address, amount *big.Int, txCost *big.Int, signatures [][]byte) (*types.Transaction, error) {\n\treturn _Bridge.contract.Transact(opts, \"mint\", transactionId, receiver, amount, txCost, signatures)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardMintingCaller creates a new readonly instance of CardMinting, bound to a specific deployed contract.
|
func NewCardMintingCaller(address common.Address, caller bind.ContractCaller) (*CardMintingCaller, error) {
contract, err := bindCardMinting(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &CardMintingCaller{contract: contract}, nil
}
|
[
"func NewCardMinting(address common.Address, backend bind.ContractBackend) (*CardMinting, error) {\n\tcontract, err := bindCardMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewMonsterMintingCaller(address common.Address, caller bind.ContractCaller) (*MonsterMintingCaller, error) {\n\tcontract, err := bindMonsterMinting(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterMintingCaller{contract: contract}, nil\n}",
"func NewCardMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*CardMintingTransactor, error) {\n\tcontract, err := bindCardMinting(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingTransactor{contract: contract}, nil\n}",
"func NewCardMintingFilterer(address common.Address, filterer bind.ContractFilterer) (*CardMintingFilterer, error) {\n\tcontract, err := bindCardMinting(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingFilterer{contract: contract}, nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func DeployCardMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardMinting, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardMintingBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func NewMSContractCaller(address common.Address, caller bind.ContractCaller) (*MSContractCaller, error) {\n\tcontract, err := bindMSContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MSContractCaller{contract: contract}, nil\n}",
"func NewPermissioningCaller(address common.Address, caller bind.ContractCaller) (*PermissioningCaller, error) {\n\tcontract, err := bindPermissioning(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PermissioningCaller{contract: contract}, nil\n}",
"func newMinter(w *Wallet) *Minter {\n\treturn &Minter{\n\t\twallet: w,\n\t}\n}",
"func NewSwapMiningCaller(address common.Address, caller bind.ContractCaller) (*SwapMiningCaller, error) {\n\tcontract, err := bindSwapMining(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SwapMiningCaller{contract: contract}, nil\n}",
"func NewSmartcontractCaller(address common.Address, caller bind.ContractCaller) (*SmartcontractCaller, error) {\n\tcontract, err := bindSmartcontract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractCaller{contract: contract}, nil\n}",
"func NewClonesCaller(address common.Address, caller bind.ContractCaller) (*ClonesCaller, error) {\n\tcontract, err := bindClones(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesCaller{contract: contract}, nil\n}",
"func (_IPairedErc20 *IPairedErc20Transactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IPairedErc20.contract.Transact(opts, \"mint\", account, amount)\n}",
"func NewBerryMasterCaller(address common.Address, caller bind.ContractCaller) (*BerryMasterCaller, error) {\n\tcontract, err := bindBerryMaster(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryMasterCaller{contract: contract}, nil\n}",
"func NewFMintRewardsDistributionCaller(address common.Address, caller bind.ContractCaller) (*FMintRewardsDistributionCaller, error) {\n\tcontract, err := bindFMintRewardsDistribution(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &FMintRewardsDistributionCaller{contract: contract}, nil\n}",
"func newFabric() fabric {\n\treturn fabric{\n\t\tclaims: make(map[coord]int),\n\t}\n}",
"func bindMonsterMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MonsterMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_SchellingCoin *SchellingCoinTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SchellingCoin.contract.Transact(opts, \"mint\", account, amount)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardMintingTransactor creates a new writeonly instance of CardMinting, bound to a specific deployed contract.
|
func NewCardMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*CardMintingTransactor, error) {
contract, err := bindCardMinting(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &CardMintingTransactor{contract: contract}, nil
}
|
[
"func NewCardMinting(address common.Address, backend bind.ContractBackend) (*CardMinting, error) {\n\tcontract, err := bindCardMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func NewMonsterMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*MonsterMintingTransactor, error) {\n\tcontract, err := bindMonsterMinting(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterMintingTransactor{contract: contract}, nil\n}",
"func (_IPairedErc20 *IPairedErc20Transactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IPairedErc20.contract.Transact(opts, \"mint\", account, amount)\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardMintingCaller(address common.Address, caller bind.ContractCaller) (*CardMintingCaller, error) {\n\tcontract, err := bindCardMinting(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingCaller{contract: contract}, nil\n}",
"func DeployCardMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardMinting, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardMintingBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func (_SchellingCoin *SchellingCoinTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SchellingCoin.contract.Transact(opts, \"mint\", account, amount)\n}",
"func (_Comptroller *ComptrollerSession) MintAllowed(cToken common.Address, minter common.Address, mintAmount *big.Int) (*types.Transaction, error) {\n\treturn _Comptroller.Contract.MintAllowed(&_Comptroller.TransactOpts, cToken, minter, mintAmount)\n}",
"func NewMonsterMinting(address common.Address, backend bind.ContractBackend) (*MonsterMinting, error) {\n\tcontract, err := bindMonsterMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterMinting{MonsterMintingCaller: MonsterMintingCaller{contract: contract}, MonsterMintingTransactor: MonsterMintingTransactor{contract: contract}, MonsterMintingFilterer: MonsterMintingFilterer{contract: contract}}, nil\n}",
"func (_PancakePair *PancakePairTransactor) Mint(opts *bind.TransactOpts, to common.Address) (*types.Transaction, error) {\n\treturn _PancakePair.contract.Transact(opts, \"mint\", to)\n}",
"func (_LivepeerToken *LivepeerTokenTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _LivepeerToken.contract.Transact(opts, \"mint\", _to, _amount)\n}",
"func (_NFToken *NFTokenTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _tokenId *big.Int, _uri string) (*types.Transaction, error) {\n\treturn _NFToken.contract.Transact(opts, \"mint\", _to, _tokenId, _uri)\n}",
"func NewCardBaseTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBaseTransactor, error) {\n\tcontract, err := bindCardBase(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseTransactor{contract: contract}, nil\n}",
"func NewCardMintingFilterer(address common.Address, filterer bind.ContractFilterer) (*CardMintingFilterer, error) {\n\tcontract, err := bindCardMinting(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingFilterer{contract: contract}, nil\n}",
"func (_Bridge *BridgeTransactor) Mint(opts *bind.TransactOpts, transactionId []byte, receiver common.Address, amount *big.Int, txCost *big.Int, signatures [][]byte) (*types.Transaction, error) {\n\treturn _Bridge.contract.Transact(opts, \"mint\", transactionId, receiver, amount, txCost, signatures)\n}",
"func newMinter(w *Wallet) *Minter {\n\treturn &Minter{\n\t\twallet: w,\n\t}\n}",
"func NewSmartcontractTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartcontractTransactor, error) {\n\tcontract, err := bindSmartcontract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractTransactor{contract: contract}, nil\n}",
"func NewMSContractTransactor(address common.Address, transactor bind.ContractTransactor) (*MSContractTransactor, error) {\n\tcontract, err := bindMSContract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MSContractTransactor{contract: contract}, nil\n}",
"func (_Pxa *PxaTransactor) Mint(opts *bind.TransactOpts, _hash [32]byte, _price *big.Int, _weight *big.Int, _data string) (*types.Transaction, error) {\n\treturn _Pxa.contract.Transact(opts, \"mint\", _hash, _price, _weight, _data)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardMintingFilterer creates a new log filterer instance of CardMinting, bound to a specific deployed contract.
|
func NewCardMintingFilterer(address common.Address, filterer bind.ContractFilterer) (*CardMintingFilterer, error) {
contract, err := bindCardMinting(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &CardMintingFilterer{contract: contract}, nil
}
|
[
"func NewMonsterMintingFilterer(address common.Address, filterer bind.ContractFilterer) (*MonsterMintingFilterer, error) {\n\tcontract, err := bindMonsterMinting(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterMintingFilterer{contract: contract}, nil\n}",
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewCardMinting(address common.Address, backend bind.ContractBackend) (*CardMinting, error) {\n\tcontract, err := bindCardMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func NewCardMintingCaller(address common.Address, caller bind.ContractCaller) (*CardMintingCaller, error) {\n\tcontract, err := bindCardMinting(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingCaller{contract: contract}, nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewMSContractFilterer(address common.Address, filterer bind.ContractFilterer) (*MSContractFilterer, error) {\n\tcontract, err := bindMSContract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MSContractFilterer{contract: contract}, nil\n}",
"func (_ZBGCard *ZBGCardFilterer) FilterTokenMinted(opts *bind.FilterOpts) (*ZBGCardTokenMintedIterator, error) {\n\n\tlogs, sub, err := _ZBGCard.contract.FilterLogs(opts, \"TokenMinted\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ZBGCardTokenMintedIterator{contract: _ZBGCard.contract, event: \"TokenMinted\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesNewCard)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseNewCard)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func NewCardBaseFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBaseFilterer, error) {\n\tcontract, err := bindCardBase(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseFilterer{contract: contract}, nil\n}",
"func NewCardMintingTransactor(address common.Address, transactor bind.ContractTransactor) (*CardMintingTransactor, error) {\n\tcontract, err := bindCardMinting(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingTransactor{contract: contract}, nil\n}",
"func NewBerryMasterFilterer(address common.Address, filterer bind.ContractFilterer) (*BerryMasterFilterer, error) {\n\tcontract, err := bindBerryMaster(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryMasterFilterer{contract: contract}, nil\n}",
"func NewFilter(chain *core.BlockChain) func(id ID) error {\n\treturn newFilter(\n\t\tchain.Config(),\n\t\tchain.Genesis().Hash(),\n\t\tfunc() uint64 {\n\t\t\treturn chain.CurrentHeader().Number.Uint64()\n\t\t},\n\t)\n}",
"func NewIncmodemockFilterer(address common.Address, filterer bind.ContractFilterer) (*IncmodemockFilterer, error) {\n\tcontract, err := bindIncmodemock(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &IncmodemockFilterer{contract: contract}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewSupplyCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewSupplyCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewSupplyCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewSupplyCapGuardianIterator{contract: _Comptroller.contract, event: \"NewSupplyCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func NewKillCordFilterer(address common.Address, filterer bind.ContractFilterer) (*KillCordFilterer, error) {\n\tcontract, err := bindKillCord(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &KillCordFilterer{contract: contract}, nil\n}",
"func NewSmartcontractFilterer(address common.Address, filterer bind.ContractFilterer) (*SmartcontractFilterer, error) {\n\tcontract, err := bindSmartcontract(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractFilterer{contract: contract}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewCollateralFactor(opts *bind.FilterOpts) (*ComptrollerNewCollateralFactorIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewCollateralFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewCollateralFactorIterator{contract: _Comptroller.contract, event: \"NewCollateralFactor\", logs: logs, sub: sub}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
bindCardMinting binds a generic wrapper to an already deployed contract.
|
func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(CardMintingABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
|
[
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindMonsterMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MonsterMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployCardMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardMinting, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardMintingBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindDropkitContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(DropkitContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindPinStorage(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(PinStorageABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindBank(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BankABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindClones(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ClonesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindSmartcontract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(SmartcontractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardMinting(address common.Address, backend bind.ContractBackend) (*CardMinting, error) {\n\tcontract, err := bindCardMinting(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func (c *Container) Bind(i interface{}) {\n iv := reflect.ValueOf(i)\n if iv.Kind() != reflect.Ptr {\n panic(\"Container: invalid type, need pointer\")\n }\n\n // initialize binding\n rt := iv.Elem().Type()\n item := bindItem{zero: reflect.Zero(rt), cmIdx: -1, imIdx: -1}\n item.pool.New = func() interface{} { return reflect.New(rt) }\n\n // get binding info\n if bind, ok := i.(IBind); ok {\n item.info = bind.GetBindInfo(i)\n }\n\n // get method index\n it := iv.Type()\n nm := it.NumMethod()\n for i := 0; i < nm; i++ {\n switch it.Method(i).Name {\n case ConstructMethod:\n item.cmIdx = i\n case InitMethod:\n item.imIdx = i\n }\n }\n\n // get class name\n pkgPath := rt.PkgPath()\n\n if index := strings.Index(pkgPath, \"/\"+ControllerWeb); index >= 0 {\n pkgPath = pkgPath[index+1:]\n }\n\n if index := strings.Index(pkgPath, \"/\"+ControllerCmd); index >= 0 {\n pkgPath = pkgPath[index+1:]\n }\n\n name := pkgPath + \"/\" + rt.Name()\n\n if len(name) > VendorLength && name[:VendorLength] == VendorPrefix {\n name = name[VendorLength:]\n }\n\n c.items[name] = &item\n}",
"func bindBerryMaster(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BerryMasterABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindComptroller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ComptrollerABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (serviceBroker *ServiceBroker) Bind(ctx context.Context, instanceID, bindingID string, details brokerapi.BindDetails, asyncAllowed bool) (brokerapi.Binding, error) {\n\tvar binding brokerapi.Binding\n\tlog.Println(\"Bind a new Service\")\n\n\terr := cf.Bind(serviceBroker.Host, details.BindResource.AppGuid, details.BindResource.SpaceGuid, serviceBroker.Config.CloudFoundry.Username, serviceBroker.Config.CloudFoundry.Password, serviceBroker.Config.DNS.Domain)\n\tif err != nil {\n\t\t//return binding, err\n\t\tlog.Printf(\"Error: %s\", err)\n\t\treturn binding, nil\n\t}\n\n\treturn binding, nil\n}",
"func bindMortal(address bgmcommon.Address, Called bind.ContractCalled, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MortalABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, Called, transactor), nil\n}",
"func bindMSContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MSContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindIotCloudlab(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(IotCloudlabABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BATTLECOOLDOWNTIME is a free data retrieval call binding the contract method 0x9db02257. Solidity: function BATTLE_COOLDOWN_TIME() constant returns(uint64)
|
func (_CardMinting *CardMintingCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {
var (
ret0 = new(uint64)
)
out := ret0
err := _CardMinting.contract.Call(opts, out, "BATTLE_COOLDOWN_TIME")
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BATTLE_COOLDOWN_TIME\")\n\treturn *ret0, err\n}",
"func (wb *BenderCC) ChargingTime() (time.Duration, error) {\n\tif wb.legacy {\n\t\tb, err := wb.conn.ReadHoldingRegisters(bendRegChargingDurationLegacy, 1)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\treturn time.Duration(binary.BigEndian.Uint16(b)) * time.Second, nil\n\t}\n\n\tb, err := wb.conn.ReadHoldingRegisters(bendRegChargingDuration, 2)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn time.Duration(binary.BigEndian.Uint32(b)) * time.Second, nil\n}",
"func (ht *HeadTracker) backfillTimeBudget() time.Duration {\n\treturn time.Duration(7 * float64(ht.config.BlockTime) / 10)\n}",
"func (s *Status) BusyTime() int64 {\n\treturn s.pStatus.busyTime // Busy_time\n}",
"func (_OrgsData *OrgsDataCaller) GetTime(opts *bind.CallOpts, uuid [16]byte) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _OrgsData.contract.Call(opts, out, \"getTime\", uuid)\n\treturn *ret0, err\n}",
"func (_OrgsData *OrgsDataCallerSession) GetTime(uuid [16]byte) (*big.Int, error) {\n\treturn _OrgsData.Contract.GetTime(&_OrgsData.CallOpts, uuid)\n}",
"func (m *ResponseStatus) GetTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {\n val, err := m.GetBackingStore().Get(\"time\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)\n }\n return nil\n}",
"func (_Oasis *Oasis) GetTime(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _Oasis.Call(opts, out, \"getTime\")\n\treturn *ret0, err\n}",
"func (b *ConstantBackOff) GetElapsedTime() time.Duration {\n\treturn time.Since(b.startTime)\n}",
"func getCacheTimePercentile(lastHealthTimes map[tc.CacheName]time.Duration, percentile float64) time.Duration {\n\ttimes := make([]time.Duration, 0, len(lastHealthTimes))\n\tfor _, t := range lastHealthTimes {\n\t\ttimes = append(times, t)\n\t}\n\tsort.Sort(Durations(times))\n\n\tn := int(float64(len(lastHealthTimes)) * percentile)\n\n\treturn times[n]\n}",
"func (wb *WebastoNext) ChargingTime() (time.Duration, error) {\n\tb, err := wb.conn.ReadHoldingRegisters(tqRegChargingTime, 2)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn time.Duration(binary.BigEndian.Uint32(b)) * time.Second, nil\n}",
"func (r *ResetPolicy) GetTimeToBlockInMinutes() int {\n\tif r == nil || r.TimeToBlockInMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *r.TimeToBlockInMinutes\n}",
"func genUnbondingTime(r *rand.Rand) (ubdTime time.Duration) {\n\treturn time.Duration(simulation.RandIntBetween(r, 60, 60*60*24*3*2)) * time.Second\n}",
"func BootTime() time.Time {\n\treturn btime\n}",
"func (p *Process) GetRemainingBurstTime() BurstTime {\n\treturn p.remainingbt\n}",
"func (w *ImpressionCountWorker) FailureTime() int64 { return 1 }",
"func (chainAPI *ChainAPI) BlockTime() time.Duration {\n\treturn chainAPI.chain.config.BlockTime()\n}",
"func (this *Winner) TimeRemaining() float64 {\n\treturn this.totalTime - this.time\n}",
"func (this *Countdown) TimeRemaining() float64 {\n\treturn this.totalTime - this.time\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CardIndexToOwner is a free data retrieval call binding the contract method 0x78d0df50. Solidity: function cardIndexToOwner( uint256) constant returns(address)
|
func (_CardMinting *CardMintingCaller) CardIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
var (
ret0 = new(common.Address)
)
out := ret0
err := _CardMinting.contract.Call(opts, out, "cardIndexToOwner", arg0)
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) CardIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"cardIndexToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (_MonsterCore *MonsterCoreCaller) MonsterIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"monsterIndexToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (_MonsterMinting *MonsterMintingCaller) MonsterIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"monsterIndexToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (_IotCloudlab *IotCloudlabCaller) RetrieveOwner(opts *bind.CallOpts) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _IotCloudlab.contract.Call(opts, &out, \"retrieveOwner\")\n\n\tif err != nil {\n\t\treturn *new([32]byte), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)\n\n\treturn out0, err\n\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) OwnerAddress(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"ownerAddress\")\n\treturn *ret0, err\n}",
"func (_MetaData *MetaDataCaller) Owner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MetaData.contract.Call(opts, out, \"owner\")\n\treturn *ret0, err\n}",
"func (_Paper *PaperCaller) PaperToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Paper.contract.Call(opts, out, \"paperToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (r *Allowance) GetBalanceForOwner() uint {\n\tvar args [0]interface{}\n\n\tvar argsSerialized []byte\n\n\terr := proxyctx.Current.Serialize(args, &argsSerialized)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tres, err := proxyctx.Current.RouteCall(r.Reference, true, \"GetBalanceForOwner\", argsSerialized)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tret := [1]interface{}{}\n\tvar ret0 uint\n\tret[0] = &ret0\n\n\terr = proxyctx.Current.Deserialize(res, &ret)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn ret0\n}",
"func (_PaymentRecords *PaymentRecordsCaller) GetPaymentOwner(opts *bind.CallOpts, originalOwner common.Address, messageIndex *big.Int) (common.Address, error) {\n\tvar out []interface{}\n\terr := _PaymentRecords.contract.Call(opts, &out, \"getPaymentOwner\", originalOwner, messageIndex)\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}",
"func (_GlobalInbox *GlobalInboxCaller) GetPaymentOwner(opts *bind.CallOpts, originalOwner common.Address, messageIndex *big.Int) (common.Address, error) {\n\tvar out []interface{}\n\terr := _GlobalInbox.contract.Call(opts, &out, \"getPaymentOwner\", originalOwner, messageIndex)\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}",
"func (_NFToken *NFTokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _NFToken.Contract.OwnerOf(&_NFToken.CallOpts, _tokenId)\n}",
"func (_IotCloudlab *IotCloudlabSession) RetrieveOwner() ([32]byte, error) {\n\treturn _IotCloudlab.Contract.RetrieveOwner(&_IotCloudlab.CallOpts)\n}",
"func (_Bank *BankTransactor) TransferOwner(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bank.contract.Transact(opts, \"transferOwner\", newOwner)\n}",
"func (_Oasis *Oasis) GetOwner(opts *bind.CallOpts, id *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Oasis.Call(opts, out, \"getOwner\", id)\n\treturn *ret0, err\n}",
"func (_BalanceSheet *BalanceSheetCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BalanceSheet.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (_BurnableToken *BurnableTokenCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BurnableToken.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (_Paper *PaperSession) PaperToOwner(arg0 *big.Int) (common.Address, error) {\n\treturn _Paper.Contract.PaperToOwner(&_Paper.CallOpts, arg0)\n}",
"func (_Bank *BankTransactorSession) TransferOwner(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bank.Contract.TransferOwner(&_Bank.TransactOpts, newOwner)\n}",
"func (_Token *TokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _Token.Contract.OwnerOf(&_Token.CallOpts, _tokenId)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RequireCardExists is a free data retrieval call binding the contract method 0x30259720. Solidity: function requireCardExists(cardID uint256) constant returns()
|
func (_CardMinting *CardMintingCaller) RequireCardExists(opts *bind.CallOpts, cardID *big.Int) error {
var ()
out := &[]interface{}{}
err := _CardMinting.contract.Call(opts, out, "requireCardExists", cardID)
return err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) RequireCardExists(opts *bind.CallOpts, cardID *big.Int) error {\n\tvar ()\n\tout := &[]interface{}{}\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"requireCardExists\", cardID)\n\treturn err\n}",
"func (c *Client) HasCard() (existingCards bool, returnErr error) {\n\tif c.StripeUser == nil {\n\t\treturn\n\t}\n\tif err := c.get(meURL, true, c); err != nil {\n\t\treturnErr = errors.Wrap(err, \"error updating stripe details\")\n\t}\n\texistingCards = len(c.StripeUser.Cards) != 0\n\treturn\n}",
"func (o *DeductLoyaltyPointsEffectProps) HasCardIdentifier() bool {\n\tif o != nil && o.CardIdentifier != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}",
"func (_NFToken *NFTokenCaller) Exists(opts *bind.CallOpts, _tokenId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _NFToken.contract.Call(opts, out, \"exists\", _tokenId)\n\treturn *ret0, err\n}",
"func (c *Client) GetCard(cardNo string, pin string) (*Card, *Response, error) {\n\tcard := &Card{}\n\tresponse := &Response{}\n\tvar err error\n\tencryptedPin, err := encryptPinWithPublicKey(pin, c.publicKey)\n\tif err != nil {\n\t\treturn card, response, err\n\t}\n\n\tco := colly.NewCollector()\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblMembershipNumber\", func(e *colly.HTMLElement) {\n\t\tcard.CardNo = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblAccountNumber\", func(e *colly.HTMLElement) {\n\t\tcard.AccountNo = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblcardvalue\", func(e *colly.HTMLElement) {\n\t\tcard.LoadsToDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblpurchasestodate\", func(e *colly.HTMLElement) {\n\t\tcard.PurchasesToDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblavailablebalance\", func(e *colly.HTMLElement) {\n\t\tcard.AvailableBalance = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblCardPurchasedDate\", func(e *colly.HTMLElement) {\n\t\tcard.PurchasedDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblCardExpiryDate\", func(e *colly.HTMLElement) {\n\t\tcard.ExpiryDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#htmltdErrorDescription\", func(e *colly.HTMLElement) {\n\t\terr = errors.New(e.Text)\n\t\tresponse.StatusCode = http.StatusUnauthorized\n\t})\n\n\tco.OnHTML(\".content-error h3\", func(e *colly.HTMLElement) {\n\t\terr = errors.New(\"internal server error\")\n\t\tresponse.StatusCode = http.StatusInternalServerError\n\t})\n\n\tco.OnHTML(\"#dgPointsStatement tbody\", func(e *colly.HTMLElement) {\n\t\te.ForEach(\"tr\", func(i int, el *colly.HTMLElement) {\n\t\t\t// skip title row\n\t\t\tif i == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttransaction := Transaction{\n\t\t\t\tDate: strings.TrimSpace(el.ChildText(\"td:nth-of-type(1)\")),\n\t\t\t\tDetails: strings.TrimSpace(el.ChildText(\"td:nth-of-type(2)\")),\n\t\t\t\tDescription: strings.TrimSpace(el.ChildText(\"td:nth-of-type(3)\")),\n\t\t\t\tAmount: strings.TrimSpace(el.ChildText(\"td:nth-of-type(4)\")),\n\t\t\t\tBalance: strings.TrimSpace(el.ChildText(\"td:nth-of-type(5)\")),\n\t\t\t}\n\t\t\tcard.Transactions = append(card.Transactions, transaction)\n\t\t})\n\t})\n\n\tco.OnResponse(func(r *colly.Response) {\n\t\tresponse = &Response{Response: r}\n\t})\n\n\tco.OnError(func(r *colly.Response, e error) {\n\t\terr = e\n\t\tresponse.Response = r\n\t})\n\n\tbody[\"txtCardNumber\"] = cardNo\n\tbody[\"hdnrequest\"] = fmt.Sprintf(\"%x\", encryptedPin)\n\tco.Post(c.BaseURL.String(), body)\n\treturn card, response, err\n}",
"func (_RootChain *RootChainCaller) ChallengeExists(opts *bind.CallOptsWithNumber, uid *big.Int, challengeTx []byte) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _RootChain.contract.CallWithNumber(opts, out, \"challengeExists\", uid, challengeTx)\n\treturn *ret0, err\n}",
"func (_Accountregistry *AccountregistryCaller) Exists(opts *bind.CallOpts, pubkeyID *big.Int, pubkey [4]*big.Int, witness [31][32]byte) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _Accountregistry.contract.Call(opts, out, \"exists\", pubkeyID, pubkey, witness)\n\treturn *ret0, err\n}",
"func (_CivilTCRContract *CivilTCRContractCaller) ChallengeExists(opts *bind.CallOpts, listingAddress common.Address) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _CivilTCRContract.contract.Call(opts, out, \"challengeExists\", listingAddress)\n\treturn *ret0, err\n}",
"func (lc *cachedLayerService) Exists(dgst digest.Digest) (bool, error) {\n\tctxu.GetLogger(lc.ctx).Debugf(\"(*cachedLayerService).Exists(%q)\", dgst)\n\tnow := time.Now()\n\tdefer func() {\n\t\t// TODO(stevvooe): Replace this with a decent context-based metrics solution\n\t\tctxu.GetLoggerWithField(lc.ctx, \"blob.exists.duration\", time.Since(now)).\n\t\t\tInfof(\"(*cachedLayerService).Exists(%q)\", dgst)\n\t}()\n\n\tatomic.AddUint64(&layerInfoCacheMetrics.Exists.Requests, 1)\n\tavailable, err := lc.cache.Contains(lc.ctx, lc.repository.Name(), dgst)\n\tif err != nil {\n\t\tctxu.GetLogger(lc.ctx).Errorf(\"error checking availability of %v@%v: %v\", lc.repository.Name(), dgst, err)\n\t\tgoto fallback\n\t}\n\n\tif available {\n\t\tatomic.AddUint64(&layerInfoCacheMetrics.Exists.Hits, 1)\n\t\treturn true, nil\n\t}\n\nfallback:\n\tatomic.AddUint64(&layerInfoCacheMetrics.Exists.Misses, 1)\n\texists, err := lc.LayerService.Exists(dgst)\n\tif err != nil {\n\t\treturn exists, err\n\t}\n\n\tif exists {\n\t\t// we can only cache this if the existence is positive.\n\t\tif err := lc.cache.Add(lc.ctx, lc.repository.Name(), dgst); err != nil {\n\t\t\tctxu.GetLogger(lc.ctx).Errorf(\"error adding %v@%v to cache: %v\", lc.repository.Name(), dgst, err)\n\t\t}\n\t}\n\n\treturn exists, err\n}",
"func (_NFToken *NFTokenCallerSession) Exists(_tokenId *big.Int) (bool, error) {\n\treturn _NFToken.Contract.Exists(&_NFToken.CallOpts, _tokenId)\n}",
"func (m *DeviceTokenMockup) Exist(deviceID string, tokenID string) (*bool, derrors.Error) {\n\tm.Lock()\n\tdefer m.Unlock()\n\t_, ok := m.data[m.generateID(deviceID, tokenID)]\n\treturn &ok, nil\n}",
"func (_Accountregistry *AccountregistryCallerSession) Exists(pubkeyID *big.Int, pubkey [4]*big.Int, witness [31][32]byte) (bool, error) {\n\treturn _Accountregistry.Contract.Exists(&_Accountregistry.CallOpts, pubkeyID, pubkey, witness)\n}",
"func (client *HearthstoneAPI) SearchCard(id string) *Card {\n\tsearch := client.newCardSearch(id)\n\n\tif output, ok := client.execute(&search).(Card); ok {\n\t\tif output.Error.Status != 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\tif output.Collectible == 1 {\n\t\t\treturn &output\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (_Node *NodeCaller) RecordExists(opts *bind.CallOpts, digest [32]byte) (bool, error) {\n\tvar out []interface{}\n\terr := _Node.contract.Call(opts, &out, \"recordExists\", digest)\n\n\tif err != nil {\n\t\treturn *new(bool), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(bool)).(*bool)\n\n\treturn out0, err\n\n}",
"func (o *DeductLoyaltyPointsEffectProps) GetCardIdentifierOk() (string, bool) {\n\tif o == nil || o.CardIdentifier == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.CardIdentifier, true\n}",
"func (bankRepo *BankGormRepo) BankExists(acc string) bool {\n\tbank := entity.Bank{}\n\terrs := bankRepo.conn.Find(&bank, \"account_no=?\", acc).GetErrors()\n\tif len(errs) > 0 {\n\t\treturn false\n\t}\n\treturn true\n}",
"func (_Node *NodeCallerSession) RecordExists(digest [32]byte) (bool, error) {\n\treturn _Node.Contract.RecordExists(&_Node.CallOpts, digest)\n}",
"func CheckCard(card *models.Card) (exists bool, err error) {\n\n\tquery := `SELECT EXISTS(\n\t\tSELECT\n\t\t\t(1)\n\t\tFROM\n\t\t\twords\n\t\tWHERE\n\t\t\tid = ` + strconv.Itoa(card.ID) + ` and\n\t\t\tword = '` + card.Word + `' and\n\t\t\tmeaning = '` + card.Meaning + `');`\n\n\trows, err := db.Query(query)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfor rows.Next() {\n\t\terr = rows.Scan(&exists)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) IsReadyForBattle(opts *bind.CallOpts, _cardID *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"isReadyForBattle\", _cardID)\n\treturn *ret0, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateGen0Card is a paid mutator transaction binding the contract method 0x45812958. Solidity: function createGen0Card() returns(newCardID uint256)
|
func (_CardMinting *CardMintingSession) CreateGen0Card() (*types.Transaction, error) {
return _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)
}
|
[
"func (_CardMinting *CardMintingTransactorSession) CreateGen0Card() (*types.Transaction, error) {\n\treturn _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)\n}",
"func CreateChargeId() string {\n return \"1TESTAGQ2G0H1tnT\" + GetRandomString(8)\n}",
"func (_MonsterCore *MonsterCoreSession) CreateGen0Auction(_genes *big.Int) (*types.Transaction, error) {\n\treturn _MonsterCore.Contract.CreateGen0Auction(&_MonsterCore.TransactOpts, _genes)\n}",
"func (_MonsterCore *MonsterCoreTransactorSession) CreateGen0Auction(_genes *big.Int) (*types.Transaction, error) {\n\treturn _MonsterCore.Contract.CreateGen0Auction(&_MonsterCore.TransactOpts, _genes)\n}",
"func (_MonsterCore *MonsterCoreCallerSession) Gen0CreatedCount() (*big.Int, error) {\n\treturn _MonsterCore.Contract.Gen0CreatedCount(&_MonsterCore.CallOpts)\n}",
"func (_MonsterCore *MonsterCoreCaller) Gen0CreatedCount(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"gen0CreatedCount\")\n\treturn *ret0, err\n}",
"func (_Token *TokenCaller) CreateZeroXOrder(opts *bind.CallOpts, _type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\tret := new(struct {\n\t\tZeroXOrder IExchangeOrder\n\t\tOrderHash [32]byte\n\t})\n\tout := ret\n\terr := _Token.contract.Call(opts, out, \"createZeroXOrder\", _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n\treturn *ret, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"createCard\", _owner, _attributes)\n}",
"func (c TokenContract) Create(issuer string, maxSupply string) {\n\tc.PushAction(\n\t\t\"create\",\n\t\tmap[string]interface{}{\n\t\t\t\"issuer\": issuer,\n\t\t\t\"maximum_supply\": maxSupply,\n\t\t},\n\t\t&Permission{\n\t\t\tActor: c.Account.Name,\n\t\t\tLevel: \"active\",\n\t\t},\n\t)\n}",
"func (_Token *TokenCallerSession) CreateZeroXOrderFor(_maker common.Address, _type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\treturn _Token.Contract.CreateZeroXOrderFor(&_Token.CallOpts, _maker, _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n}",
"func (_Token *TokenCallerSession) CreateZeroXOrder(_type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\treturn _Token.Contract.CreateZeroXOrder(&_Token.CallOpts, _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)\n}",
"func (c CardType) Generate() string {\n\trand.Seed(time.Now().Unix())\n\n\tlength := c.Length[rand.Intn(len(c.Length))]\n\tprefix := c.Prefix[rand.Intn(len(c.Prefix))]\n\n\tcard := prefix\n\trandomNumberLength := length - (len(prefix) + 1)\n\tfor i := 0; i < randomNumberLength; i++ {\n\t\trand := rand.Intn(10)\n\t\tcard += strconv.Itoa(rand)\n\t}\n\n\t// Generates last digit according to Luhn algorithm\n\tsum := 0\n\tfor i := 0; i < len(card); i++ {\n\t\tdigit, _ := strconv.Atoi((string(card[i])))\n\n\t\tif i%2 == 0 {\n\t\t\tdigit = digit * 2\n\n\t\t\tif digit > 9 {\n\t\t\t\tdigit = (digit / 10) + (digit % 10)\n\t\t\t}\n\t\t}\n\n\t\tsum += digit\n\t}\n\n\tmod := sum % 10\n\tif mod == 0 {\n\t\treturn card + strconv.Itoa(0)\n\t}\n\n\treturn card + strconv.Itoa(10-mod)\n}",
"func (_MonsterMinting *MonsterMintingCaller) GEN0CREATIONLIMIT(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"GEN0_CREATION_LIMIT\")\n\treturn *ret0, err\n}",
"func (_Token *TokenSession) CreateZeroXOrderFor(_maker common.Address, _type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\treturn _Token.Contract.CreateZeroXOrderFor(&_Token.CallOpts, _maker, _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n}",
"func Zero() UUID {\n\treturn UUID{ustr: \"\"}\n}",
"func (_MonsterCore *MonsterCoreCaller) GEN0CREATIONLIMIT(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"GEN0_CREATION_LIMIT\")\n\treturn *ret0, err\n}",
"func (g *Game) GenerateNextCard() int {\n\n\tif g.CountCards() == 0 {\n\t\tg.RestockDeck()\n\t}\n\n\tnum := RandomNumber()\n\n\tif g.Cards[num] == 0 {\n\t\tg.GenerateNextCard()\n\t}\n\n\treturn num\n\n}",
"func (_FMintRewardsDistribution *FMintRewardsDistributionTransactor) Initialize0(opts *bind.TransactOpts, sender common.Address) (*types.Transaction, error) {\n\treturn _FMintRewardsDistribution.contract.Transact(opts, \"initialize0\", sender)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateGen0Card is a paid mutator transaction binding the contract method 0x45812958. Solidity: function createGen0Card() returns(newCardID uint256)
|
func (_CardMinting *CardMintingTransactorSession) CreateGen0Card() (*types.Transaction, error) {
return _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)
}
|
[
"func (_CardMinting *CardMintingSession) CreateGen0Card() (*types.Transaction, error) {\n\treturn _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)\n}",
"func CreateChargeId() string {\n return \"1TESTAGQ2G0H1tnT\" + GetRandomString(8)\n}",
"func (_MonsterCore *MonsterCoreSession) CreateGen0Auction(_genes *big.Int) (*types.Transaction, error) {\n\treturn _MonsterCore.Contract.CreateGen0Auction(&_MonsterCore.TransactOpts, _genes)\n}",
"func (_MonsterCore *MonsterCoreTransactorSession) CreateGen0Auction(_genes *big.Int) (*types.Transaction, error) {\n\treturn _MonsterCore.Contract.CreateGen0Auction(&_MonsterCore.TransactOpts, _genes)\n}",
"func (_MonsterCore *MonsterCoreCallerSession) Gen0CreatedCount() (*big.Int, error) {\n\treturn _MonsterCore.Contract.Gen0CreatedCount(&_MonsterCore.CallOpts)\n}",
"func (_MonsterCore *MonsterCoreCaller) Gen0CreatedCount(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"gen0CreatedCount\")\n\treturn *ret0, err\n}",
"func (_Token *TokenCaller) CreateZeroXOrder(opts *bind.CallOpts, _type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\tret := new(struct {\n\t\tZeroXOrder IExchangeOrder\n\t\tOrderHash [32]byte\n\t})\n\tout := ret\n\terr := _Token.contract.Call(opts, out, \"createZeroXOrder\", _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n\treturn *ret, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"createCard\", _owner, _attributes)\n}",
"func (c TokenContract) Create(issuer string, maxSupply string) {\n\tc.PushAction(\n\t\t\"create\",\n\t\tmap[string]interface{}{\n\t\t\t\"issuer\": issuer,\n\t\t\t\"maximum_supply\": maxSupply,\n\t\t},\n\t\t&Permission{\n\t\t\tActor: c.Account.Name,\n\t\t\tLevel: \"active\",\n\t\t},\n\t)\n}",
"func (_Token *TokenCallerSession) CreateZeroXOrderFor(_maker common.Address, _type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\treturn _Token.Contract.CreateZeroXOrderFor(&_Token.CallOpts, _maker, _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n}",
"func (_Token *TokenCallerSession) CreateZeroXOrder(_type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\treturn _Token.Contract.CreateZeroXOrder(&_Token.CallOpts, _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)\n}",
"func (c CardType) Generate() string {\n\trand.Seed(time.Now().Unix())\n\n\tlength := c.Length[rand.Intn(len(c.Length))]\n\tprefix := c.Prefix[rand.Intn(len(c.Prefix))]\n\n\tcard := prefix\n\trandomNumberLength := length - (len(prefix) + 1)\n\tfor i := 0; i < randomNumberLength; i++ {\n\t\trand := rand.Intn(10)\n\t\tcard += strconv.Itoa(rand)\n\t}\n\n\t// Generates last digit according to Luhn algorithm\n\tsum := 0\n\tfor i := 0; i < len(card); i++ {\n\t\tdigit, _ := strconv.Atoi((string(card[i])))\n\n\t\tif i%2 == 0 {\n\t\t\tdigit = digit * 2\n\n\t\t\tif digit > 9 {\n\t\t\t\tdigit = (digit / 10) + (digit % 10)\n\t\t\t}\n\t\t}\n\n\t\tsum += digit\n\t}\n\n\tmod := sum % 10\n\tif mod == 0 {\n\t\treturn card + strconv.Itoa(0)\n\t}\n\n\treturn card + strconv.Itoa(10-mod)\n}",
"func (_MonsterMinting *MonsterMintingCaller) GEN0CREATIONLIMIT(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"GEN0_CREATION_LIMIT\")\n\treturn *ret0, err\n}",
"func (_Token *TokenSession) CreateZeroXOrderFor(_maker common.Address, _type uint8, _attoshares *big.Int, _price *big.Int, _market common.Address, _outcome uint8, _expirationTimeSeconds *big.Int, _salt *big.Int) (struct {\n\tZeroXOrder IExchangeOrder\n\tOrderHash [32]byte\n}, error) {\n\treturn _Token.Contract.CreateZeroXOrderFor(&_Token.CallOpts, _maker, _type, _attoshares, _price, _market, _outcome, _expirationTimeSeconds, _salt)\n}",
"func Zero() UUID {\n\treturn UUID{ustr: \"\"}\n}",
"func (_MonsterCore *MonsterCoreCaller) GEN0CREATIONLIMIT(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"GEN0_CREATION_LIMIT\")\n\treturn *ret0, err\n}",
"func (g *Game) GenerateNextCard() int {\n\n\tif g.CountCards() == 0 {\n\t\tg.RestockDeck()\n\t}\n\n\tnum := RandomNumber()\n\n\tif g.Cards[num] == 0 {\n\t\tg.GenerateNextCard()\n\t}\n\n\treturn num\n\n}",
"func (_FMintRewardsDistribution *FMintRewardsDistributionTransactor) Initialize0(opts *bind.TransactOpts, sender common.Address) (*types.Transaction, error) {\n\treturn _FMintRewardsDistribution.contract.Transact(opts, \"initialize0\", sender)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetNewAddress is a paid mutator transaction binding the contract method 0x71587988. Solidity: function setNewAddress(_newAddress address) returns()
|
func (_CardMinting *CardMintingTransactor) SetNewAddress(opts *bind.TransactOpts, _newAddress common.Address) (*types.Transaction, error) {
return _CardMinting.contract.Transact(opts, "setNewAddress", _newAddress)
}
|
[
"func (_CardBattles *CardBattlesTransactor) SetNewAddress(opts *bind.TransactOpts, _newAddress common.Address) (*types.Transaction, error) {\n\treturn _CardBattles.contract.Transact(opts, \"setNewAddress\", _newAddress)\n}",
"func (_MonsterCore *MonsterCoreTransactor) SetNewAddress(opts *bind.TransactOpts, _v2Address common.Address) (*types.Transaction, error) {\n\treturn _MonsterCore.contract.Transact(opts, \"setNewAddress\", _v2Address)\n}",
"func newAddress(res http.ResponseWriter, req *http.Request, _ httprouter.Params) {\n\tencoder := json.NewEncoder(res)\n\taddress, err := createWallet()\n\tif err != nil {\n\t\tencoder.Encode(jsonResponse{Status: err.Error()})\n\t\treturn\n\t}\n\twalletDB.Exec(\"INSERT INTO addresses (address) VALUES ($1);\", address)\n\tdata := map[string]interface{}{\"address\": address}\n\tencoder.Encode(jsonResponse{Status: \"OK\", Data: data})\n}",
"func newAddress(w *wallet.Wallet, account uint32, scope waddrmgr.KeyScope) (soterutil.Address, error) {\n\tvar (\n\t\taddr soterutil.Address\n\t)\n\terr := walletdb.Update(w.Database(), func(tx walletdb.ReadWriteTx) error {\n\t\taddrmgrNs := tx.ReadWriteBucket(waddrmgrNamespaceKey)\n\t\tvar err error\n\t\taddr, _, err = newWalletAddress(w, addrmgrNs, account, scope)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn addr, nil\n}",
"func SetNewRandomAddress(f NewRandomAddressFunc) {\n\tnewRandomAddress = f\n}",
"func (c *Client) CreateNewAddress() (address string, err error) {\n\tr, err := c.request(\"createnewaddress\", nil)\n\tif err = c.error(err, &r); err != nil {\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(r.Result, &address)\n\treturn\n}",
"func (d *EditCoinOwnerData) SetNewOwner(address string) (*EditCoinOwnerData, error) {\n\tbytes, err := wallet.AddressToHex(address)\n\tif err != nil {\n\t\treturn d, err\n\t}\n\tcopy(d.NewOwner[:], bytes)\n\treturn d, nil\n}",
"func newAddress(t AddressType, args ...[]byte) (*Address, error) {\n\tif len(args) == 0 {\n\t\treturn nil, ErrInvalidArgument\n\t}\n\n\tswitch t {\n\tcase AccountAddress, ContractAddress:\n\tdefault:\n\t\treturn nil, ErrInvalidArgument\n\t}\n\n\tbuffer := make([]byte, AddressLength)\n\tbuffer[AddressPaddingIndex] = Padding\n\tbuffer[AddressTypeIndex] = byte(t)\n\n\tsha := hash.Sha3256(args...)\n\tcontent := hash.Ripemd160(sha)\n\tcopy(buffer[AddressTypeIndex+1:AddressDataEnd], content)\n\n\tcs := checkSum(buffer[:AddressDataEnd])\n\tcopy(buffer[AddressDataEnd:], cs)\n\n\treturn &Address{Address: buffer}, nil\n}",
"func (b *DcrWallet) NewAddress(t lnwallet.AddressType, change bool, accountName string) (stdaddr.Address, error) {\n\n\tswitch t {\n\tcase lnwallet.PubKeyHash:\n\t\t// nop\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown address type\")\n\t}\n\n\tvar acctNb = b.account\n\tif accountName != lnwallet.DefaultAccountName {\n\t\tres, err := b.wallet.AccountNumber(context.Background(), &pb.AccountNumberRequest{AccountName: accountName})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unknown account named %s: %v\", accountName, err)\n\t\t}\n\t\tacctNb = res.AccountNumber\n\t}\n\n\tkind := pb.NextAddressRequest_BIP0044_EXTERNAL\n\tif change {\n\t\tkind = pb.NextAddressRequest_BIP0044_INTERNAL\n\t}\n\treq := &pb.NextAddressRequest{\n\t\tKind: kind,\n\t\tAccount: acctNb,\n\t\tGapPolicy: pb.NextAddressRequest_GAP_POLICY_WRAP,\n\t}\n\tresp, err := b.wallet.NextAddress(context.Background(), req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\taddr, err := stdaddr.DecodeAddress(resp.Address, b.chainParams)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn addr, nil\n}",
"func (w *Wallet) newChangeAddresses(account, n uint32) ([]cipher.Addresser, error) {\n\treturn w.newAddresses(account, bip44.ChangeChainIndex, n)\n}",
"func (s *Server) EventAddNewAddress(c context.Context, wa *pb.WatchAddress) (*pb.ReplyInfo, error) {\n\tnewMap := *s.UsersData\n\t// if newMap == nil {\n\t// \tnewMap = sync.Map{}\n\t// }\n\t_, ok := newMap.Load(wa.Address)\n\tif ok {\n\t\treturn &pb.ReplyInfo{\n\t\t\tMessage: \"err: Address already binded\",\n\t\t}, nil\n\t}\n\tnewMap.Store(strings.ToLower(wa.Address), store.AddressExtended{\n\t\tUserID: wa.UserID,\n\t\tWalletIndex: int(wa.WalletIndex),\n\t\tAddressIndex: int(wa.AddressIndex),\n\t})\n\n\t*s.UsersData = newMap\n\n\tlog.Debugf(\"EventAddNewAddress - %v\", newMap)\n\n\treturn &pb.ReplyInfo{\n\t\tMessage: \"ok\",\n\t}, nil\n\n}",
"func (c *Client) GetNewAddressEntire(label string, addressType string) (*string, error) {\n\treturn c.GetNewAddressAsync(&label, &addressType).Receive()\n}",
"func NewContractAddress(channelID string, caller Address, code []byte) (newAddr Address) {\n\t// temp := make([]byte, 32+8)\n\t// copy(temp, caller[:])\n\t// PutUint64BE(temp[32:], uint64(sequence))\n\ttemp := util.BytesCombine([]byte(channelID), caller.Bytes(), code)\n\thasher := ripemd160.New()\n\thasher.Write(temp) // does not error\n\tcopy(newAddr[:], hasher.Sum(nil))\n\treturn\n}",
"func getNewAdressBTC(label string, UID string, pwd string) string {\n\tresponse, err := http.Get(\"http://localhost:3000/merchant/\" + UID +\n\t\t\"/new_address?password=\" + pwd + \"&label=\" + label)\n\tif err != nil {\n\t\treturn \"False\"\n\t}\n\tdefer response.Body.Close()\n\tcontents, err := ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn \"False\"\n\t}\n\tvalue := gjson.Get(string(contents), \"address\")\n\treturn value.String()\n}",
"func (ipam *IPAM) GetNewAddress() (net.IP, error) {\n\tipam.mutex.Lock()\n\tfreeBlock, err := ipam.findFreeBlock()\n\tif err != nil {\n\t\tipam.mutex.Unlock()\n\t\treturn net.IP{}, fmt.Errorf(\"unable to find a free IP block: %w\", err)\n\t}\n\tnewAddress, err := freeBlock.reserveAddress(ipam.db)\n\tipam.mutex.Unlock()\n\treturn newAddress, err\n}",
"func (_Hotel_Interface *Hotel_InterfaceTransactor) EditAddress(opts *bind.TransactOpts, _lineOne string, _lineTwo string, _zip string, _country string) (*types.Transaction, error) {\n\treturn _Hotel_Interface.contract.Transact(opts, \"editAddress\", _lineOne, _lineTwo, _zip, _country)\n}",
"func (m *Website) SetAddress(value *string)() {\n m.address = value\n}",
"func (_MonsterCore *MonsterCoreCaller) NewContractAddress(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"newContractAddress\")\n\treturn *ret0, err\n}",
"func (_Hotel_Interface *Hotel_InterfaceTransactorSession) EditAddress(_lineOne string, _lineTwo string, _zip string, _country string) (*types.Transaction, error) {\n\treturn _Hotel_Interface.Contract.EditAddress(&_Hotel_Interface.TransactOpts, _lineOne, _lineTwo, _zip, _country)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. Solidity: function transfer(_to address, _cardId uint256) returns()
|
func (_CardMinting *CardMintingTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {
return _CardMinting.contract.Transact(opts, "transfer", _to, _cardId)
}
|
[
"func (_CardOwnership *CardOwnershipTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {\n\treturn _CardOwnership.contract.Transact(opts, \"transfer\", _to, _cardId)\n}",
"func (_CanDelegate *CanDelegateTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.contract.Transact(opts, \"transfer\", to, value)\n}",
"func (_CanDelegate *CanDelegateTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.Contract.Transfer(&_CanDelegate.TransactOpts, to, value)\n}",
"func (_RepTok *RepTokTransactor) Transfer(opts *bind.TransactOpts, _recipient common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _RepTok.contract.Transact(opts, \"transfer\", _recipient, _amount)\n}",
"func (_LivepeerToken *LivepeerTokenTransactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _LivepeerToken.contract.Transact(opts, \"transfer\", recipient, amount)\n}",
"func (_RepTok *RepTokTransactorSession) Transfer(_recipient common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _RepTok.Contract.Transfer(&_RepTok.TransactOpts, _recipient, _amount)\n}",
"func (_Dai *DaiTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) {\n\treturn _Dai.contract.Transact(opts, \"transfer\", dst, wad)\n}",
"func (sdk *SDK) Transfer(amount string, from Member, to Member) (string, error) {\n\tuserConfig, err := requester.CreateUserConfig(from.GetReference(), from.GetPrivateKey(), from.GetPublicKey())\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to create user config for request\")\n\t}\n\tresponse, err := sdk.DoRequest(\n\t\tsdk.publicAPIURLs,\n\t\tuserConfig,\n\t\t\"member.transfer\",\n\t\tmap[string]interface{}{\"amount\": amount, \"toMemberReference\": to.GetReference()},\n\t)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"request was failed \")\n\t}\n\n\treturn response.TraceID, nil\n}",
"func (_Dai *DaiTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) {\n\treturn _Dai.Contract.Transfer(&_Dai.TransactOpts, dst, wad)\n}",
"func Transfer(db vm.StateDB, sender, recipient meta.AccountID, amount *big.Int, code int) {\n\tdb.Transfer(&sender, &recipient, amount, code)\n}",
"func (t *AccountTransferChaincode) transfer(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar userA, userB string\n\tvar amtA, amtB, amt int\n\tvar err error\n\n\tuserA = args[0]\n\t// args[1] parameter\n\tamt, _ = strconv.Atoi(args[1])\n\tuserB = args[2]\n\n\tif len(args) != 3 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 3\")\n\t}\n\n\t// userA\n\tamtABytes, err := stub.GetState(userA)\n\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get state\")\n\t}\n\t// convert\n\tamtA, _ = strconv.Atoi(string(amtABytes))\n\n\t// userB\n\tamtBBytes, err := stub.GetState(userB)\n\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get state\")\n\t}\n\n\tamtB, _ = strconv.Atoi(string(amtBBytes))\n\n\tamtA = amtA - amt\n\tamtB = amtB + amt\n\n\tfmt.Printf(\"user %s amount = %d, user %s amount = %d\\n\", userA, amtA, userB, amtB)\n\n\t// Write the state back to the ledger\n\terr = stub.PutState(userA, []byte(strconv.Itoa(amtA)))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\terr = stub.PutState(userB, []byte(strconv.Itoa(amtB)))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(nil)\n}",
"func (p *Portfolio) Transfer(a IAssetReadOnly, units float64) {\n\tp.ModifyPositions(a, units)\n}",
"func (_CanDelegate *CanDelegateTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.Contract.TransferFrom(&_CanDelegate.TransactOpts, from, to, value)\n}",
"func (r *Wallet) TransferAsImmutable(toWallet reference.Global, amount uint32) error {\n\tvar args [2]interface{}\n\targs[0] = toWallet\n\targs[1] = amount\n\n\tvar argsSerialized []byte\n\n\tret := make([]interface{}, 1)\n\tvar ret0 *foundation.Error\n\tret[0] = &ret0\n\n\tvar ph = r.ProxyHelper\n\n\terr := ph.Serialize(args, &argsSerialized)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tres, err := ph.CallMethod(\n\t\tr.Reference, XXX_isolation.CallIntolerable, XXX_isolation.CallValidated, false, \"Transfer\", argsSerialized, ClassReference)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresultContainer := foundation.Result{\n\t\tReturns: ret,\n\t}\n\terr = ph.Deserialize(res, &resultContainer)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resultContainer.Error != nil {\n\t\terr = resultContainer.Error\n\t\treturn err\n\t}\n\tif ret0 != nil {\n\t\treturn ret0\n\t}\n\treturn nil\n}",
"func (_CanDelegate *CanDelegateTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.contract.Transact(opts, \"transferFrom\", from, to, value)\n}",
"func transferValue(\n\tunitName string,\n\tsnapshot *avl.Tree,\n\tfrom, to AccountID,\n\tamount uint64,\n\tsrcRead func(*avl.Tree, AccountID) (uint64, bool), srcWrite func(*avl.Tree, AccountID, uint64),\n\tdstRead func(*avl.Tree, AccountID) (uint64, bool), dstWrite func(*avl.Tree, AccountID, uint64),\n) error {\n\tsenderValue, _ := srcRead(snapshot, from)\n\n\tif senderValue < amount {\n\t\treturn errors.Errorf(\"transfer_value: %x tried send %d %s to %x, but only has %d %s\",\n\t\t\tfrom, amount, unitName, to, senderValue, unitName)\n\t}\n\n\tsenderValue -= amount\n\tsrcWrite(snapshot, from, senderValue)\n\n\trecipientValue, _ := dstRead(snapshot, to)\n\trecipientValue += amount\n\tdstWrite(snapshot, to, recipientValue)\n\n\treturn nil\n}",
"func (r *API) Transfer(token common.Address, amount *big.Int, target common.Address, secret common.Hash, timeout time.Duration, isDirectTransfer bool, data string, routeInfo []pfsproxy.FindPathResponse) (result *utils.AsyncResult, err error) {\n\tresult, err = r.TransferInternal(token, amount, target, secret, isDirectTransfer, data, routeInfo)\n\tif err != nil {\n\t\treturn\n\t}\n\tif timeout > 0 {\n\t\ttimeoutCh := time.After(timeout)\n\t\tselect {\n\t\tcase <-timeoutCh:\n\t\t\treturn result, rerr.ErrTransferTimeout\n\t\tcase err = <-result.Result:\n\t\t}\n\t} else {\n\t\terr = <-result.Result\n\t}\n\treturn result, err\n}",
"func (bitmark *Bitmark) Transfer(arguments *transactionrecord.BitmarkTransferCountersigned, reply *TransferReply) error {\n\tif err := ratelimit.Limit(bitmark.Limiter); nil != err {\n\t\treturn err\n\t}\n\n\tlog := bitmark.Log\n\ttransfer := transactionrecord.BitmarkTransfer(arguments)\n\n\tlog.Infof(\"Bitmark.Transfer: %+v\", transfer)\n\n\tif nil == arguments || nil == arguments.Owner {\n\t\treturn fault.InvalidItem\n\t}\n\n\tif !bitmark.IsNormalMode(mode.Normal) {\n\t\treturn fault.NotAvailableDuringSynchronise\n\t}\n\n\tif arguments.Owner.IsTesting() != bitmark.IsTestingChain() {\n\t\treturn fault.WrongNetworkForPublicKey\n\t}\n\n\t// for unratified transfers\n\tif 0 == len(arguments.Countersignature) {\n\t\ttransfer = &transactionrecord.BitmarkTransferUnratified{\n\t\t\tLink: arguments.Link,\n\t\t\tEscrow: arguments.Escrow,\n\t\t\tOwner: arguments.Owner,\n\t\t\tSignature: arguments.Signature,\n\t\t}\n\t}\n\n\t// save transfer/check for duplicate\n\tstored, duplicate, err := bitmark.Rsvr.StoreTransfer(transfer)\n\n\tif nil != err {\n\t\treturn err\n\t}\n\n\t// only first result needs to be considered\n\tpayId := stored.Id\n\ttxId := stored.TxId\n\tbitmarkId := stored.IssueTxId\n\tpackedTransfer := stored.Packed\n\n\tlog.Debugf(\"id: %v\", txId)\n\treply.TxId = txId\n\treply.BitmarkId = bitmarkId\n\treply.PayId = payId\n\treply.Payments = make(map[string]transactionrecord.PaymentAlternative)\n\n\tfor _, payment := range stored.Payments {\n\t\tc := payment[0].Currency.String()\n\t\treply.Payments[c] = payment\n\t}\n\n\t// announce transaction block to other peers\n\tif !duplicate {\n\t\tmessagebus.Bus.Broadcast.Send(\"transfer\", packedTransfer)\n\t}\n\n\treturn nil\n}",
"func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {\r\n\tctx := sdk.UnwrapSDKContext(goCtx)\r\n\r\n\tsender, err := sdk.AccAddressFromBech32(msg.Sender)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\tif err := k.SendTransfer(\r\n\t\tctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp,\r\n\t); err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\tk.Logger(ctx).Info(\"IBC fungible token transfer\", \"token\", msg.Token.Denom, \"amount\", msg.Token.Amount.String(), \"sender\", msg.Sender, \"receiver\", msg.Receiver)\r\n\r\n\tctx.EventManager().EmitEvents(sdk.Events{\r\n\t\tsdk.NewEvent(\r\n\t\t\ttypes.EventTypeTransfer,\r\n\t\t\tsdk.NewAttribute(sdk.AttributeKeySender, msg.Sender),\r\n\t\t\tsdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver),\r\n\t\t),\r\n\t\tsdk.NewEvent(\r\n\t\t\tsdk.EventTypeMessage,\r\n\t\t\tsdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName),\r\n\t\t),\r\n\t})\r\n\r\n\treturn &types.MsgTransferResponse{}, nil\r\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DeployCardOwnership deploys a new Ethereum contract, binding an instance of CardOwnership to it.
|
func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {
parsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))
if err != nil {
return common.Address{}, nil, nil, err
}
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil
}
|
[
"func DeployOwned(authPtr *bind.TransactOpts, backend bind.ContractBackended) (bgmcommon.Address, *types.Transaction, *Owned, error) {\n\tparsed, err := abi.JSON(strings.NewReader(OwnedABI))\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, bgmcommon.FromHex(OwnedBin), backend)\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Owned{OwnedCalled: OwnedCalled{contract: contract}, OwnedTransactor: OwnedTransactor{contract: contract}}, nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_ValidatorWalletCreator *ValidatorWalletCreatorTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _ValidatorWalletCreator.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func (_TrueUSD *TrueUSDTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _TrueUSD.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func (t *Token) TransferOwnership(stub shim.ChaincodeStubInterface,\n\targs []string,\n\tgetOwner func(shim.ChaincodeStubInterface) (string, error),\n) error {\n\tcallerID, err := GetCallerID(stub)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttokenOwnerID, err := getOwner(stub)\n\tif err := CheckCallerIsOwner(callerID, tokenOwnerID); err != nil {\n\t\treturn err\n\t}\n\n\tnewOwnerID := args[0]\n\n\terr = stub.PutState(\"owner\", []byte(newOwnerID))\n\treturn err\n}",
"func NewCardOwnership(address common.Address, backend bind.ContractBackend) (*CardOwnership, error) {\n\tcontract, err := bindCardOwnership(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func (c *Contract) Deploy(account *Account) {\n\tif err := keos.Client.WalletUnlock(keos.Wallet, keos.WalletPassword); err != nil {\n\t\tif !strings.Contains(err.Error(), \"Already unlocked\") {\n\t\t\tlogrus.Fatalln(err)\n\t\t}\n\t}\n\n\tpathParts := strings.Split(strings.TrimRight(c.Path, \"/\"), \"/\")\n\twasmName := fmt.Sprintf(\"%s.wasm\", pathParts[len(pathParts)-1])\n\tabiName := fmt.Sprintf(\"%s.abi\", pathParts[len(pathParts)-1])\n\n\tc.Account = account\n\tfmt.Print(c.Account.Name)\n\n\tsetCode, err := system.NewSetCode(\n\t\teosgo.AccountName(c.Account.Name),\n\t\tfmt.Sprintf(\"%s/%s\", c.Path, wasmName),\n\t)\n\tif err != nil {\n\t\tnodeos.PushError(err)\n\t\treturn\n\t}\n\n\tsetAbi, err := system.NewSetABI(\n\t\teosgo.AccountName(c.Account.Name),\n\t\tfmt.Sprintf(\"%s/%s\", c.Path, abiName),\n\t)\n\tif err != nil {\n\t\tnodeos.PushError(err)\n\t\treturn\n\t}\n\n\tif _, err = nodeos.Client.SignPushActions(\n\t\tsetCode,\n\t\tsetAbi,\n\t); err != nil {\n\t\tnodeos.PushError(err)\n\t}\n\n\treturn\n}",
"func (_CardOwnership *CardOwnershipTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {\n\treturn _CardOwnership.contract.Transact(opts, \"transfer\", _to, _cardId)\n}",
"func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func (_Registry *RegistryTransactor) AssignOwnership(opts *bind.TransactOpts, owner common.Address, property common.Address) (*types.Transaction, error) {\n\treturn _Registry.contract.Transact(opts, \"assignOwnership\", owner, property)\n}",
"func (_Wrapper *WrapperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Wrapper.contract.Transact(opts, \"acceptOwnership\")\n}",
"func (nc *NeoVMContract) DeployNeoVMSmartContract(\r\n\tgasPrice,\r\n\tgasLimit uint64,\r\n\tsinger *Account,\r\n\tneedStorage bool,\r\n\tcode,\r\n\tname,\r\n\tversion,\r\n\tauthor,\r\n\temail,\r\n\tdesc string) (common.Uint256, error) {\r\n\r\n\tinvokeCode, err := hex.DecodeString(code)\r\n\tif err != nil {\r\n\t\treturn common.UINT256_EMPTY, fmt.Errorf(\"code hex decode error:%s\", err)\r\n\t}\r\n\ttx := nc.NewDeployNeoVMCodeTransaction(gasPrice, gasLimit, &sdkcom.SmartContract{\r\n\t\tCode: invokeCode,\r\n\t\tNeedStorage: needStorage,\r\n\t\tName: name,\r\n\t\tVersion: version,\r\n\t\tAuthor: author,\r\n\t\tEmail: email,\r\n\t\tDescription: desc,\r\n\t})\r\n\terr = nc.ontSdk.SignToTransaction(tx, singer)\r\n\tif err != nil {\r\n\t\treturn common.Uint256{}, err\r\n\t}\r\n\ttxHash, err := nc.ontSdk.SendTransaction(tx)\r\n\tif err != nil {\r\n\t\treturn common.Uint256{}, fmt.Errorf(\"SendRawTransaction error:%s\", err)\r\n\t}\r\n\treturn txHash, nil\r\n}",
"func DeployCar(auth *bind.TransactOpts, backend bind.ContractBackend, inManufature [32]byte) (common.Address, *types.Transaction, *Car, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CarABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CarBin), backend, inManufature)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Car{CarCaller: CarCaller{contract: contract}, CarTransactor: CarTransactor{contract: contract}, CarFilterer: CarFilterer{contract: contract}}, nil\n}",
"func DeployCardBase(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBase, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBaseBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func (_Berry *BerryTransactor) ProposeOwnership(opts *bind.TransactOpts, _pendingOwner common.Address) (*types.Transaction, error) {\n\treturn _Berry.contract.Transact(opts, \"proposeOwnership\", _pendingOwner)\n}",
"func DeployCardMinting(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardMinting, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardMintingBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardMinting{CardMintingCaller: CardMintingCaller{contract: contract}, CardMintingTransactor: CardMintingTransactor{contract: contract}, CardMintingFilterer: CardMintingFilterer{contract: contract}}, nil\n}",
"func DeployAsset(auth *bind.TransactOpts, backend bind.ContractBackend, _initalSupply uint64, _initialName string, _initialSymbol string, _initialOwnership string, _initialAddress string, _initialOwnerSocialMedia string, _initialProofOfTitle string) (common.Address, *types.Transaction, *Asset, error) {\n\tparsed, err := abi.JSON(strings.NewReader(AssetABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(AssetBin), backend, _initalSupply, _initialName, _initialSymbol, _initialOwnership, _initialAddress, _initialOwnerSocialMedia, _initialProofOfTitle)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Asset{AssetCaller: AssetCaller{contract: contract}, AssetTransactor: AssetTransactor{contract: contract}, AssetFilterer: AssetFilterer{contract: contract}}, nil\n}",
"func (transfer *BlockOwnerTransfer) Pack(address *account.Account) (Packed, error) {\n\tif nil == address || address.IsZero() {\n\t\treturn nil, fault.InvalidOwnerOrRegistrant\n\t}\n\n\terr := transfer.check(address.IsTesting())\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\n\tpackedPayments, err := transfer.Payments.Pack(address.IsTesting())\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\n\ttestnet := address.IsTesting()\n\n\t// concatenate bytes\n\tmessage := createPacked(BlockOwnerTransferTag)\n\tmessage.appendBytes(transfer.Link[:])\n\t_, err = message.appendEscrow(transfer.Escrow, testnet)\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\tmessage.appendUint64(transfer.Version)\n\tmessage.appendBytes(packedPayments)\n\tmessage.appendAccount(transfer.Owner)\n\n\t// signature\n\terr = address.CheckSignature(message, transfer.Signature)\n\tif nil != err {\n\t\treturn message, err\n\t}\n\tmessage.appendBytes(transfer.Signature)\n\n\terr = transfer.Owner.CheckSignature(message, transfer.Countersignature)\n\tif nil != err {\n\t\treturn message, err\n\t}\n\n\t// Countersignature Last\n\treturn *message.appendBytes(transfer.Countersignature), nil\n}",
"func (op *OpenGo) DeployEthereumScaffold(ctx context.Context, scaffold EthereumScaffold) (EthereumScaffold, error) {\n\top.baseURL.Path = \"/api/ethereum-scaffolds/doDeploy\"\n\tscaffoldJSON, _ := json.Marshal(scaffold)\n\tresponse, err := op.SendRequest(ctx, \"POST\", scaffoldJSON)\n\n\tif err != nil {\n\t\treturn EthereumScaffold{}, fmt.Errorf(\"The HTTP request failed with error %s\\n\", err)\n\t}\n\tdata, _ := ioutil.ReadAll(response.Body)\n\tjson.Unmarshal(data, scaffold)\n\treturn scaffold, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardOwnership creates a new instance of CardOwnership, bound to a specific deployed contract.
|
func NewCardOwnership(address common.Address, backend bind.ContractBackend) (*CardOwnership, error) {
contract, err := bindCardOwnership(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil
}
|
[
"func NewOwnership(username, groupname string) Ownership {\n\treturn Ownership{\n\t\tUid: lookupUid(username),\n\t\tGid: lookupGid(groupname),\n\t}\n}",
"func NewOwned(address bgmcommon.Address, backend bind.ContractBackended) (*Owned, error) {\n\tcontract, err := bindOwned(address, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Owned{OwnedCalled: OwnedCalled{contract: contract}, OwnedTransactor: OwnedTransactor{contract: contract}}, nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardOwnershipCaller(address common.Address, caller bind.ContractCaller) (*CardOwnershipCaller, error) {\n\tcontract, err := bindCardOwnership(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnershipCaller{contract: contract}, nil\n}",
"func NewCardOwnershipTransactor(address common.Address, transactor bind.ContractTransactor) (*CardOwnershipTransactor, error) {\n\tcontract, err := bindCardOwnership(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnershipTransactor{contract: contract}, nil\n}",
"func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func NewCard(suit Suit, rank Rank) Card {\n\treturn Card{suit: suit, rank: rank}\n}",
"func TestNewOwnership(t *testing.T) {\n\townership := NewOwnership(\"test1\", \"group0\", \"\", \"\", &data, testLog)\n\tassert.EqualValues(t, 1001, ownership.UID)\n\tassert.EqualValues(t, 2000, ownership.GID)\n\n\townership = NewOwnership(\"test2\", \"group2\", \"\", \"\", &data, testLog)\n\tassert.EqualValues(t, 1002, ownership.UID)\n\tassert.EqualValues(t, 2002, ownership.GID)\n}",
"func NewCard(rank, suit, color string, rv, sv int, up bool) Card {\n\treturn Card{\n\t\tRank: rank,\n\t\tSuit: suit,\n\t\tColor: color,\n\t\tRvalue: rv,\n\t\tSvalue: sv,\n\t\tFaceup: up,\n\t}\n}",
"func (_ValidatorWalletCreator *ValidatorWalletCreatorTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _ValidatorWalletCreator.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"createCard\", _owner, _attributes)\n}",
"func (_TrueUSD *TrueUSDTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _TrueUSD.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)\n}",
"func (a *DefaultApiService) FundOwnership(ctx _context.Context) ApiFundOwnershipRequest {\n\treturn ApiFundOwnershipRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func (client *Client) acceptOwnershipCreateRequest(ctx context.Context, subscriptionID string, body AcceptOwnershipRequest, options *ClientBeginAcceptOwnershipOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership\"\n\tif subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-10-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, body)\n}",
"func (_Wrapper *WrapperCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Wrapper.contract.Call(opts, out, \"newOwner\")\n\treturn *ret0, err\n}",
"func NewOwnedTransactor(address bgmcommon.Address, transactor bind.ContractTransactor) (*OwnedTransactor, error) {\n\tcontract, err := bindOwned(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedTransactor{contract: contract}, nil\n}",
"func (_Registry *RegistryCaller) Ownership(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Registry.contract.Call(opts, out, \"ownership\", arg0)\n\treturn *ret0, err\n}",
"func NewVCard(fn string, ln string, addr *Address) *VCard {\n\treturn &VCard{fn, ln, addr, \"1/1/3\", \"photo2\"}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardOwnershipCaller creates a new readonly instance of CardOwnership, bound to a specific deployed contract.
|
func NewCardOwnershipCaller(address common.Address, caller bind.ContractCaller) (*CardOwnershipCaller, error) {
contract, err := bindCardOwnership(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &CardOwnershipCaller{contract: contract}, nil
}
|
[
"func NewCardOwnership(address common.Address, backend bind.ContractBackend) (*CardOwnership, error) {\n\tcontract, err := bindCardOwnership(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func (_Wrapper *WrapperCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Wrapper.contract.Call(opts, out, \"newOwner\")\n\treturn *ret0, err\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewOwned(address bgmcommon.Address, backend bind.ContractBackended) (*Owned, error) {\n\tcontract, err := bindOwned(address, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Owned{OwnedCalled: OwnedCalled{contract: contract}, OwnedTransactor: OwnedTransactor{contract: contract}}, nil\n}",
"func NewOwnership(username, groupname string) Ownership {\n\treturn Ownership{\n\t\tUid: lookupUid(username),\n\t\tGid: lookupGid(groupname),\n\t}\n}",
"func (_Registry *RegistryCaller) Ownership(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Registry.contract.Call(opts, out, \"ownership\", arg0)\n\treturn *ret0, err\n}",
"func (_Asset *AssetCaller) Ownership(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"Ownership\")\n\treturn *ret0, err\n}",
"func (_ValidatorWalletCreator *ValidatorWalletCreatorTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _ValidatorWalletCreator.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func NewContractAccessControlCaller(address common.Address, caller bind.ContractCaller) (*ContractAccessControlCaller, error) {\n\tcontract, err := bindContractAccessControl(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractAccessControlCaller{contract: contract}, nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func NewRBACCaller(address common.Address, caller bind.ContractCaller) (*RBACCaller, error) {\n\tcontract, err := bindRBAC(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RBACCaller{contract: contract}, nil\n}",
"func NewOwnedCalled(address bgmcommon.Address, Called bind.ContractCalled) (*OwnedCalled, error) {\n\tcontract, err := bindOwned(address, Called, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedCalled{contract: contract}, nil\n}",
"func (a *DefaultApiService) FundOwnership(ctx _context.Context) ApiFundOwnershipRequest {\n\treturn ApiFundOwnershipRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func TestNewOwnership(t *testing.T) {\n\townership := NewOwnership(\"test1\", \"group0\", \"\", \"\", &data, testLog)\n\tassert.EqualValues(t, 1001, ownership.UID)\n\tassert.EqualValues(t, 2000, ownership.GID)\n\n\townership = NewOwnership(\"test2\", \"group2\", \"\", \"\", &data, testLog)\n\tassert.EqualValues(t, 1002, ownership.UID)\n\tassert.EqualValues(t, 2002, ownership.GID)\n}",
"func NewAssetCaller(address common.Address, caller bind.ContractCaller) (*AssetCaller, error) {\n\tcontract, err := bindAsset(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AssetCaller{contract: contract}, nil\n}",
"func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func (_Incmodemock *IncmodemockCaller) NewVault(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Incmodemock.contract.Call(opts, out, \"newVault\")\n\treturn *ret0, err\n}",
"func NewRegistrarContractCaller(address common.Address, caller bind.ContractCaller) (*RegistrarContractCaller, error) {\n\tcontract, err := bindRegistrarContract(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RegistrarContractCaller{contract: contract}, nil\n}",
"func NewCardOwnershipTransactor(address common.Address, transactor bind.ContractTransactor) (*CardOwnershipTransactor, error) {\n\tcontract, err := bindCardOwnership(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnershipTransactor{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardOwnershipTransactor creates a new writeonly instance of CardOwnership, bound to a specific deployed contract.
|
func NewCardOwnershipTransactor(address common.Address, transactor bind.ContractTransactor) (*CardOwnershipTransactor, error) {
contract, err := bindCardOwnership(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &CardOwnershipTransactor{contract: contract}, nil
}
|
[
"func (_ValidatorWalletCreator *ValidatorWalletCreatorTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _ValidatorWalletCreator.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func NewCardOwnership(address common.Address, backend bind.ContractBackend) (*CardOwnership, error) {\n\tcontract, err := bindCardOwnership(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func NewOwnedTransactor(address bgmcommon.Address, transactor bind.ContractTransactor) (*OwnedTransactor, error) {\n\tcontract, err := bindOwned(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OwnedTransactor{contract: contract}, nil\n}",
"func (_TrueUSD *TrueUSDTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _TrueUSD.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func NewOwnership(username, groupname string) Ownership {\n\treturn Ownership{\n\t\tUid: lookupUid(username),\n\t\tGid: lookupGid(groupname),\n\t}\n}",
"func (t *Token) TransferOwnership(stub shim.ChaincodeStubInterface,\n\targs []string,\n\tgetOwner func(shim.ChaincodeStubInterface) (string, error),\n) error {\n\tcallerID, err := GetCallerID(stub)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttokenOwnerID, err := getOwner(stub)\n\tif err := CheckCallerIsOwner(callerID, tokenOwnerID); err != nil {\n\t\treturn err\n\t}\n\n\tnewOwnerID := args[0]\n\n\terr = stub.PutState(\"owner\", []byte(newOwnerID))\n\treturn err\n}",
"func (_Registry *RegistryTransactor) AssignOwnership(opts *bind.TransactOpts, owner common.Address, property common.Address) (*types.Transaction, error) {\n\treturn _Registry.contract.Transact(opts, \"assignOwnership\", owner, property)\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardOwnershipCaller(address common.Address, caller bind.ContractCaller) (*CardOwnershipCaller, error) {\n\tcontract, err := bindCardOwnership(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnershipCaller{contract: contract}, nil\n}",
"func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func (_Wrapper *WrapperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Wrapper.contract.Transact(opts, \"acceptOwnership\")\n}",
"func NewCarTransactor(address common.Address, transactor bind.ContractTransactor) (*CarTransactor, error) {\n\tcontract, err := bindCar(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarTransactor{contract: contract}, nil\n}",
"func (_Berry *BerryTransactor) ProposeOwnership(opts *bind.TransactOpts, _pendingOwner common.Address) (*types.Transaction, error) {\n\treturn _Berry.contract.Transact(opts, \"proposeOwnership\", _pendingOwner)\n}",
"func NewSmartcontractTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartcontractTransactor, error) {\n\tcontract, err := bindSmartcontract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractTransactor{contract: contract}, nil\n}",
"func (_CardOwnership *CardOwnershipTransactor) SetOwner(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _CardOwnership.contract.Transact(opts, \"setOwner\", _newOwner)\n}",
"func NewCardBaseTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBaseTransactor, error) {\n\tcontract, err := bindCardBase(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseTransactor{contract: contract}, nil\n}",
"func (_CardOwnership *CardOwnershipTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {\n\treturn _CardOwnership.contract.Transact(opts, \"transfer\", _to, _cardId)\n}",
"func NewOwned(address bgmcommon.Address, backend bind.ContractBackended) (*Owned, error) {\n\tcontract, err := bindOwned(address, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Owned{OwnedCalled: OwnedCalled{contract: contract}, OwnedTransactor: OwnedTransactor{contract: contract}}, nil\n}",
"func NewBalanceSheetTransactor(address common.Address, transactor bind.ContractTransactor) (*BalanceSheetTransactor, error) {\n\tcontract, err := bindBalanceSheet(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BalanceSheetTransactor{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCardOwnershipFilterer creates a new log filterer instance of CardOwnership, bound to a specific deployed contract.
|
func NewCardOwnershipFilterer(address common.Address, filterer bind.ContractFilterer) (*CardOwnershipFilterer, error) {
contract, err := bindCardOwnership(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &CardOwnershipFilterer{contract: contract}, nil
}
|
[
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewCardOwnershipCaller(address common.Address, caller bind.ContractCaller) (*CardOwnershipCaller, error) {\n\tcontract, err := bindCardOwnership(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnershipCaller{contract: contract}, nil\n}",
"func (_NFToken *NFTokenFilterer) FilterOwnershipRenounced(opts *bind.FilterOpts, previousOwner []common.Address) (*NFTokenOwnershipRenouncedIterator, error) {\n\n\tvar previousOwnerRule []interface{}\n\tfor _, previousOwnerItem := range previousOwner {\n\t\tpreviousOwnerRule = append(previousOwnerRule, previousOwnerItem)\n\t}\n\n\tlogs, sub, err := _NFToken.contract.FilterLogs(opts, \"OwnershipRenounced\", previousOwnerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &NFTokenOwnershipRenouncedIterator{contract: _NFToken.contract, event: \"OwnershipRenounced\", logs: logs, sub: sub}, nil\n}",
"func (_Token *TokenFilterer) FilterOwnershipRenounced(opts *bind.FilterOpts, previousOwner []common.Address) (*TokenOwnershipRenouncedIterator, error) {\n\n\tvar previousOwnerRule []interface{}\n\tfor _, previousOwnerItem := range previousOwner {\n\t\tpreviousOwnerRule = append(previousOwnerRule, previousOwnerItem)\n\t}\n\n\tlogs, sub, err := _Token.contract.FilterLogs(opts, \"OwnershipRenounced\", previousOwnerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TokenOwnershipRenouncedIterator{contract: _Token.contract, event: \"OwnershipRenounced\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewBorrowCapGuardian(opts *bind.FilterOpts) (*ComptrollerNewBorrowCapGuardianIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewBorrowCapGuardian\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewBorrowCapGuardianIterator{contract: _Comptroller.contract, event: \"NewBorrowCapGuardian\", logs: logs, sub: sub}, nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardOwnership(address common.Address, backend bind.ContractBackend) (*CardOwnership, error) {\n\tcontract, err := bindCardOwnership(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func (_Contract *ContractFilterer) WatchOwnershipRenounced(opts *bind.WatchOpts, sink chan<- *ContractOwnershipRenounced, previousOwner []common.Address) (event.Subscription, error) {\n\n\tvar previousOwnerRule []interface{}\n\tfor _, previousOwnerItem := range previousOwner {\n\t\tpreviousOwnerRule = append(previousOwnerRule, previousOwnerItem)\n\t}\n\n\tlogs, sub, err := _Contract.contract.WatchLogs(opts, \"OwnershipRenounced\", previousOwnerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(ContractOwnershipRenounced)\n\t\t\t\tif err := _Contract.contract.UnpackLog(event, \"OwnershipRenounced\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func newContainerFilter(whitelist, blacklist []string) (*containerFilter, error) {\n\tiwl, nwl, err := parseFilters(whitelist)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tibl, nbl, err := parseFilters(blacklist)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &containerFilter{\n\t\tEnabled: len(whitelist) > 0 || len(blacklist) > 0,\n\t\tImageWhitelist: iwl,\n\t\tNameWhitelist: nwl,\n\t\tImageBlacklist: ibl,\n\t\tNameBlacklist: nbl,\n\t}, nil\n}",
"func (_CardBase *CardBaseFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBaseNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseNewCard)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func NewCardBaseFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBaseFilterer, error) {\n\tcontract, err := bindCardBase(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseFilterer{contract: contract}, nil\n}",
"func NewClonesFilterer(address common.Address, filterer bind.ContractFilterer) (*ClonesFilterer, error) {\n\tcontract, err := bindClones(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesFilterer{contract: contract}, nil\n}",
"func newCaptureFilter(opts FilterOptions) (*captureFilter, error) {\n\tif opts == nil {\n\t\treturn &captureFilter{CaptureFilterOptions: DefaultCaptureFilterOptions()}, nil\n\t}\n\n\tvar capOpts *CaptureFilterOptions\n\tswitch opts.(type) {\n\tcase *CaptureFilterOptions:\n\t\tcapOpts = opts.(*CaptureFilterOptions)\n\t\tbreak\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Need CaptureFilterOptions\")\n\t}\n\n\treturn &captureFilter{CaptureFilterOptions: capOpts}, nil\n}",
"func (_NFToken *NFTokenFilterer) WatchOwnershipRenounced(opts *bind.WatchOpts, sink chan<- *NFTokenOwnershipRenounced, previousOwner []common.Address) (event.Subscription, error) {\n\n\tvar previousOwnerRule []interface{}\n\tfor _, previousOwnerItem := range previousOwner {\n\t\tpreviousOwnerRule = append(previousOwnerRule, previousOwnerItem)\n\t}\n\n\tlogs, sub, err := _NFToken.contract.WatchLogs(opts, \"OwnershipRenounced\", previousOwnerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(NFTokenOwnershipRenounced)\n\t\t\t\tif err := _NFToken.contract.UnpackLog(event, \"OwnershipRenounced\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func NewCarFilterer(address common.Address, filterer bind.ContractFilterer) (*CarFilterer, error) {\n\tcontract, err := bindCar(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarFilterer{contract: contract}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchNewCard(opts *bind.WatchOpts, sink chan<- *CardBattlesNewCard) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesNewCard)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"NewCard\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func NewCardMintingFilterer(address common.Address, filterer bind.ContractFilterer) (*CardMintingFilterer, error) {\n\tcontract, err := bindCardMinting(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardMintingFilterer{contract: contract}, nil\n}",
"func (_Wrapper *WrapperFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, _from []common.Address, _to []common.Address) (*WrapperOwnershipTransferredIterator, error) {\n\n\tvar _fromRule []interface{}\n\tfor _, _fromItem := range _from {\n\t\t_fromRule = append(_fromRule, _fromItem)\n\t}\n\tvar _toRule []interface{}\n\tfor _, _toItem := range _to {\n\t\t_toRule = append(_toRule, _toItem)\n\t}\n\n\tlogs, sub, err := _Wrapper.contract.FilterLogs(opts, \"OwnershipTransferred\", _fromRule, _toRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &WrapperOwnershipTransferredIterator{contract: _Wrapper.contract, event: \"OwnershipTransferred\", logs: logs, sub: sub}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
bindCardOwnership binds a generic wrapper to an already deployed contract.
|
func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
|
[
"func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func bindOwned(address bgmcommon.Address, Called bind.ContractCalled, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(OwnedABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, Called, transactor), nil\n}",
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_TrueUSD *TrueUSDTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _TrueUSD.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func (_Registry *RegistryCaller) Ownership(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Registry.contract.Call(opts, out, \"ownership\", arg0)\n\treturn *ret0, err\n}",
"func (_Wrapper *WrapperTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Wrapper.contract.Transact(opts, \"acceptOwnership\")\n}",
"func (_ValidatorWalletCreator *ValidatorWalletCreatorTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _ValidatorWalletCreator.contract.Transact(opts, \"transferOwnership\", newOwner)\n}",
"func bindBank(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BankABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (t *Token) TransferOwnership(stub shim.ChaincodeStubInterface,\n\targs []string,\n\tgetOwner func(shim.ChaincodeStubInterface) (string, error),\n) error {\n\tcallerID, err := GetCallerID(stub)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttokenOwnerID, err := getOwner(stub)\n\tif err := CheckCallerIsOwner(callerID, tokenOwnerID); err != nil {\n\t\treturn err\n\t}\n\n\tnewOwnerID := args[0]\n\n\terr = stub.PutState(\"owner\", []byte(newOwnerID))\n\treturn err\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployOwned(authPtr *bind.TransactOpts, backend bind.ContractBackended) (bgmcommon.Address, *types.Transaction, *Owned, error) {\n\tparsed, err := abi.JSON(strings.NewReader(OwnedABI))\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, bgmcommon.FromHex(OwnedBin), backend)\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Owned{OwnedCalled: OwnedCalled{contract: contract}, OwnedTransactor: OwnedTransactor{contract: contract}}, nil\n}",
"func bindDropkitContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(DropkitContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindContractAccessControl(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardOwnership(address common.Address, backend bind.ContractBackend) (*CardOwnership, error) {\n\tcontract, err := bindCardOwnership(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func bindEthvault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, ) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(EthvaultABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, nil), nil\n}",
"func bindSmartcontract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(SmartcontractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindPinStorage(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(PinStorageABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetOwner is a paid mutator transaction binding the contract method 0x13af4035. Solidity: function setOwner(_newOwner address) returns()
|
func (_CardOwnership *CardOwnershipTransactor) SetOwner(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {
return _CardOwnership.contract.Transact(opts, "setOwner", _newOwner)
}
|
[
"func (c *Deed) SetOwner(opts *bind.TransactOpts, address common.Address) (*types.Transaction, error) {\n\treturn c.Contract.SetOwner(opts, address)\n}",
"func (_Dai *DaiTransactor) SetOwner(opts *bind.TransactOpts, owner_ common.Address) (*types.Transaction, error) {\n\treturn _Dai.contract.Transact(opts, \"setOwner\", owner_)\n}",
"func (t *Token) SetOwner(newOwner types.Address) {\n\n\t// update the old owner and new owner's balance\n\toldAcct := t.smc.Helper().AccountHelper().AccountOf(t.tk.Owner)\n\toldOwnerBalance := oldAcct.Balance()\n\toldAcct.(*Account).SetBalanceOfToken(t.Address(), bn.N(0))\n\n\tnewAcct := t.smc.Helper().AccountHelper().AccountOf(newOwner)\n\tnewOwnerBalance := newAcct.Balance().Add(oldOwnerBalance)\n\tnewAcct.(*Account).SetBalanceOfToken(t.Address(), newOwnerBalance)\n\n\t// dirty mc and set new token data\n\tt.tk.Owner = newOwner\n\tkeyOfToken := std.KeyOfToken(t.Address())\n\tsdkimpl.McInst.Dirty(keyOfToken)\n\tt.smc.(*sdkimpl.SmartContract).LlState().McSet(keyOfToken, &t.tk)\n\n\t// fire event of setOwner\n\tt.smc.Helper().ReceiptHelper().Emit(\n\t\tstd.SetOwner{\n\t\t\tContractAddr: t.smc.Message().Contract().Address(),\n\t\t\tNewOwner: newOwner,\n\t\t},\n\t)\n\t// fire event of transfer\n\tt.smc.Helper().ReceiptHelper().Emit(\n\t\tstd.Transfer{\n\t\t\tToken: t.Address(),\n\t\t\tFrom: oldAcct.Address(),\n\t\t\tTo: newOwner,\n\t\t\tValue: oldOwnerBalance,\n\t\t},\n\t)\n}",
"func (c *Coffee) SetOwner(owner string) error {\n\tif c.HasOwner() {\n\t\treturn errors.New(\"coffee already has a owner\")\n\t}\n\n\tc.Owner = owner\n\treturn nil\n}",
"func (_Issuer *IssuerTransactor) ChangeOwner(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Issuer.contract.Transact(opts, \"changeOwner\", newOwner)\n}",
"func (ac *AlertCreate) SetOwner(m *Machine) *AlertCreate {\n\treturn ac.SetOwnerID(m.ID)\n}",
"func (eu *EventUpdate) SetOwner(a *Alert) *EventUpdate {\n\treturn eu.SetOwnerID(a.ID)\n}",
"func (idc *ItemDescriptionCreate) SetOwner(i *Item) *ItemDescriptionCreate {\n\treturn idc.SetOwnerID(i.ID)\n}",
"func (_CrossEther *CrossEtherTransactor) OwnerSetErc20Addr(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) {\n\treturn _CrossEther.contract.Transact(opts, \"ownerSetErc20Addr\", addr)\n}",
"func (d *EditCoinOwnerData) SetNewOwner(address string) (*EditCoinOwnerData, error) {\n\tbytes, err := wallet.AddressToHex(address)\n\tif err != nil {\n\t\treturn d, err\n\t}\n\tcopy(d.NewOwner[:], bytes)\n\treturn d, nil\n}",
"func (tc *ToyCreate) SetOwner(p *Pet) *ToyCreate {\n\treturn tc.SetOwnerID(p.ID)\n}",
"func (o *UploadAppValuesParams) SetOwner(owner *string) {\n\to.Owner = owner\n}",
"func (o *Repository) SetOwner(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error {\n\tvar err error\n\tif insert {\n\t\tif err = related.Insert(ctx, exec, boil.Infer()); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to insert into foreign table\")\n\t\t}\n\t}\n\n\tupdateQuery := fmt.Sprintf(\n\t\t\"UPDATE \\\"repositories\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, []string{\"owner_id\"}),\n\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 2, repositoryPrimaryKeyColumns),\n\t)\n\tvalues := []interface{}{related.ID, o.ID}\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, updateQuery)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tif _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil {\n\t\treturn errors.Wrap(err, \"failed to update local table\")\n\t}\n\n\to.OwnerID = related.ID\n\tif o.R == nil {\n\t\to.R = &repositoryR{\n\t\t\tOwner: related,\n\t\t}\n\t} else {\n\t\to.R.Owner = related\n\t}\n\n\tif related.R == nil {\n\t\trelated.R = &userR{\n\t\t\tOwnerRepositories: RepositorySlice{o},\n\t\t}\n\t} else {\n\t\trelated.R.OwnerRepositories = append(related.R.OwnerRepositories, o)\n\t}\n\n\treturn nil\n}",
"func (s *SmartContract) ChangeOwner(ctx contractapi.TransactionContextInterface, id string, newOwner string) error {\n\tcar, err := s.QueryCar(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcar.Owner = newOwner\n\tcarJSON, err := json.Marshal(car)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ctx.GetStub().PutState(id, carJSON)\n}",
"func (_MetaData *MetaDataCaller) Owner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MetaData.contract.Call(opts, out, \"owner\")\n\treturn *ret0, err\n}",
"func (a *V2PolicyApiService) SetPolicyOwner(ctx _context.Context, id string, setPolicyOwnerModel SetPolicyOwnerModel) (SuccessResultPolicy, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPut\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue SuccessResultPolicy\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/v2/policy/policy/{id}/owner\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"id\"+\"}\", _neturl.QueryEscape(fmt.Sprintf(\"%v\", id)), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = &setPolicyOwnerModel\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 200 {\n\t\t\tvar v SuccessResultPolicy\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}",
"func (b *Build) SetOwner(clientset *client.ConfigSet, owner metav1.OwnerReference) error {\n\tbuild, err := clientset.Build.BuildV1alpha1().Builds(b.Namespace).Get(b.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tbuild.SetOwnerReferences([]metav1.OwnerReference{owner})\n\t_, err = clientset.Build.BuildV1alpha1().Builds(b.Namespace).Update(build)\n\treturn err\n}",
"func (_CrossEther *CrossEtherSession) OwnerSetErc20Addr(addr common.Address) (*types.Transaction, error) {\n\treturn _CrossEther.Contract.OwnerSetErc20Addr(&_CrossEther.TransactOpts, addr)\n}",
"func (_Bank *BankTransactor) TransferOwner(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bank.contract.Transact(opts, \"transferOwner\", newOwner)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. Solidity: function transfer(_to address, _cardId uint256) returns()
|
func (_CardOwnership *CardOwnershipTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {
return _CardOwnership.contract.Transact(opts, "transfer", _to, _cardId)
}
|
[
"func (_CardMinting *CardMintingTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _cardId *big.Int) (*types.Transaction, error) {\n\treturn _CardMinting.contract.Transact(opts, \"transfer\", _to, _cardId)\n}",
"func (_CanDelegate *CanDelegateTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.contract.Transact(opts, \"transfer\", to, value)\n}",
"func (_CanDelegate *CanDelegateTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.Contract.Transfer(&_CanDelegate.TransactOpts, to, value)\n}",
"func (_RepTok *RepTokTransactor) Transfer(opts *bind.TransactOpts, _recipient common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _RepTok.contract.Transact(opts, \"transfer\", _recipient, _amount)\n}",
"func (_LivepeerToken *LivepeerTokenTransactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _LivepeerToken.contract.Transact(opts, \"transfer\", recipient, amount)\n}",
"func (_RepTok *RepTokTransactorSession) Transfer(_recipient common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _RepTok.Contract.Transfer(&_RepTok.TransactOpts, _recipient, _amount)\n}",
"func (_Dai *DaiTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) {\n\treturn _Dai.contract.Transact(opts, \"transfer\", dst, wad)\n}",
"func (sdk *SDK) Transfer(amount string, from Member, to Member) (string, error) {\n\tuserConfig, err := requester.CreateUserConfig(from.GetReference(), from.GetPrivateKey(), from.GetPublicKey())\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to create user config for request\")\n\t}\n\tresponse, err := sdk.DoRequest(\n\t\tsdk.publicAPIURLs,\n\t\tuserConfig,\n\t\t\"member.transfer\",\n\t\tmap[string]interface{}{\"amount\": amount, \"toMemberReference\": to.GetReference()},\n\t)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"request was failed \")\n\t}\n\n\treturn response.TraceID, nil\n}",
"func (_Dai *DaiTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) {\n\treturn _Dai.Contract.Transfer(&_Dai.TransactOpts, dst, wad)\n}",
"func Transfer(db vm.StateDB, sender, recipient meta.AccountID, amount *big.Int, code int) {\n\tdb.Transfer(&sender, &recipient, amount, code)\n}",
"func (t *AccountTransferChaincode) transfer(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar userA, userB string\n\tvar amtA, amtB, amt int\n\tvar err error\n\n\tuserA = args[0]\n\t// args[1] parameter\n\tamt, _ = strconv.Atoi(args[1])\n\tuserB = args[2]\n\n\tif len(args) != 3 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 3\")\n\t}\n\n\t// userA\n\tamtABytes, err := stub.GetState(userA)\n\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get state\")\n\t}\n\t// convert\n\tamtA, _ = strconv.Atoi(string(amtABytes))\n\n\t// userB\n\tamtBBytes, err := stub.GetState(userB)\n\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get state\")\n\t}\n\n\tamtB, _ = strconv.Atoi(string(amtBBytes))\n\n\tamtA = amtA - amt\n\tamtB = amtB + amt\n\n\tfmt.Printf(\"user %s amount = %d, user %s amount = %d\\n\", userA, amtA, userB, amtB)\n\n\t// Write the state back to the ledger\n\terr = stub.PutState(userA, []byte(strconv.Itoa(amtA)))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\terr = stub.PutState(userB, []byte(strconv.Itoa(amtB)))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(nil)\n}",
"func (p *Portfolio) Transfer(a IAssetReadOnly, units float64) {\n\tp.ModifyPositions(a, units)\n}",
"func (_CanDelegate *CanDelegateTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.Contract.TransferFrom(&_CanDelegate.TransactOpts, from, to, value)\n}",
"func (r *Wallet) TransferAsImmutable(toWallet reference.Global, amount uint32) error {\n\tvar args [2]interface{}\n\targs[0] = toWallet\n\targs[1] = amount\n\n\tvar argsSerialized []byte\n\n\tret := make([]interface{}, 1)\n\tvar ret0 *foundation.Error\n\tret[0] = &ret0\n\n\tvar ph = r.ProxyHelper\n\n\terr := ph.Serialize(args, &argsSerialized)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tres, err := ph.CallMethod(\n\t\tr.Reference, XXX_isolation.CallIntolerable, XXX_isolation.CallValidated, false, \"Transfer\", argsSerialized, ClassReference)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresultContainer := foundation.Result{\n\t\tReturns: ret,\n\t}\n\terr = ph.Deserialize(res, &resultContainer)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resultContainer.Error != nil {\n\t\terr = resultContainer.Error\n\t\treturn err\n\t}\n\tif ret0 != nil {\n\t\treturn ret0\n\t}\n\treturn nil\n}",
"func (_CanDelegate *CanDelegateTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _CanDelegate.contract.Transact(opts, \"transferFrom\", from, to, value)\n}",
"func transferValue(\n\tunitName string,\n\tsnapshot *avl.Tree,\n\tfrom, to AccountID,\n\tamount uint64,\n\tsrcRead func(*avl.Tree, AccountID) (uint64, bool), srcWrite func(*avl.Tree, AccountID, uint64),\n\tdstRead func(*avl.Tree, AccountID) (uint64, bool), dstWrite func(*avl.Tree, AccountID, uint64),\n) error {\n\tsenderValue, _ := srcRead(snapshot, from)\n\n\tif senderValue < amount {\n\t\treturn errors.Errorf(\"transfer_value: %x tried send %d %s to %x, but only has %d %s\",\n\t\t\tfrom, amount, unitName, to, senderValue, unitName)\n\t}\n\n\tsenderValue -= amount\n\tsrcWrite(snapshot, from, senderValue)\n\n\trecipientValue, _ := dstRead(snapshot, to)\n\trecipientValue += amount\n\tdstWrite(snapshot, to, recipientValue)\n\n\treturn nil\n}",
"func (r *API) Transfer(token common.Address, amount *big.Int, target common.Address, secret common.Hash, timeout time.Duration, isDirectTransfer bool, data string, routeInfo []pfsproxy.FindPathResponse) (result *utils.AsyncResult, err error) {\n\tresult, err = r.TransferInternal(token, amount, target, secret, isDirectTransfer, data, routeInfo)\n\tif err != nil {\n\t\treturn\n\t}\n\tif timeout > 0 {\n\t\ttimeoutCh := time.After(timeout)\n\t\tselect {\n\t\tcase <-timeoutCh:\n\t\t\treturn result, rerr.ErrTransferTimeout\n\t\tcase err = <-result.Result:\n\t\t}\n\t} else {\n\t\terr = <-result.Result\n\t}\n\treturn result, err\n}",
"func (bitmark *Bitmark) Transfer(arguments *transactionrecord.BitmarkTransferCountersigned, reply *TransferReply) error {\n\tif err := ratelimit.Limit(bitmark.Limiter); nil != err {\n\t\treturn err\n\t}\n\n\tlog := bitmark.Log\n\ttransfer := transactionrecord.BitmarkTransfer(arguments)\n\n\tlog.Infof(\"Bitmark.Transfer: %+v\", transfer)\n\n\tif nil == arguments || nil == arguments.Owner {\n\t\treturn fault.InvalidItem\n\t}\n\n\tif !bitmark.IsNormalMode(mode.Normal) {\n\t\treturn fault.NotAvailableDuringSynchronise\n\t}\n\n\tif arguments.Owner.IsTesting() != bitmark.IsTestingChain() {\n\t\treturn fault.WrongNetworkForPublicKey\n\t}\n\n\t// for unratified transfers\n\tif 0 == len(arguments.Countersignature) {\n\t\ttransfer = &transactionrecord.BitmarkTransferUnratified{\n\t\t\tLink: arguments.Link,\n\t\t\tEscrow: arguments.Escrow,\n\t\t\tOwner: arguments.Owner,\n\t\t\tSignature: arguments.Signature,\n\t\t}\n\t}\n\n\t// save transfer/check for duplicate\n\tstored, duplicate, err := bitmark.Rsvr.StoreTransfer(transfer)\n\n\tif nil != err {\n\t\treturn err\n\t}\n\n\t// only first result needs to be considered\n\tpayId := stored.Id\n\ttxId := stored.TxId\n\tbitmarkId := stored.IssueTxId\n\tpackedTransfer := stored.Packed\n\n\tlog.Debugf(\"id: %v\", txId)\n\treply.TxId = txId\n\treply.BitmarkId = bitmarkId\n\treply.PayId = payId\n\treply.Payments = make(map[string]transactionrecord.PaymentAlternative)\n\n\tfor _, payment := range stored.Payments {\n\t\tc := payment[0].Currency.String()\n\t\treply.Payments[c] = payment\n\t}\n\n\t// announce transaction block to other peers\n\tif !duplicate {\n\t\tmessagebus.Bus.Broadcast.Send(\"transfer\", packedTransfer)\n\t}\n\n\treturn nil\n}",
"func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {\r\n\tctx := sdk.UnwrapSDKContext(goCtx)\r\n\r\n\tsender, err := sdk.AccAddressFromBech32(msg.Sender)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\tif err := k.SendTransfer(\r\n\t\tctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp,\r\n\t); err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\tk.Logger(ctx).Info(\"IBC fungible token transfer\", \"token\", msg.Token.Denom, \"amount\", msg.Token.Amount.String(), \"sender\", msg.Sender, \"receiver\", msg.Receiver)\r\n\r\n\tctx.EventManager().EmitEvents(sdk.Events{\r\n\t\tsdk.NewEvent(\r\n\t\t\ttypes.EventTypeTransfer,\r\n\t\t\tsdk.NewAttribute(sdk.AttributeKeySender, msg.Sender),\r\n\t\t\tsdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver),\r\n\t\t),\r\n\t\tsdk.NewEvent(\r\n\t\t\tsdk.EventTypeMessage,\r\n\t\t\tsdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName),\r\n\t\t),\r\n\t})\r\n\r\n\treturn &types.MsgTransferResponse{}, nil\r\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DeployContractAccessControl deploys a new Ethereum contract, binding an instance of ContractAccessControl to it.
|
func DeployContractAccessControl(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ContractAccessControl, error) {
parsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))
if err != nil {
return common.Address{}, nil, nil, err
}
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ContractAccessControlBin), backend)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, &ContractAccessControl{ContractAccessControlCaller: ContractAccessControlCaller{contract: contract}, ContractAccessControlTransactor: ContractAccessControlTransactor{contract: contract}, ContractAccessControlFilterer: ContractAccessControlFilterer{contract: contract}}, nil
}
|
[
"func (f *FastTestTokenContract) DeployContract(\n\tauth *bind.TransactOpts,\n\tclient eth_rpc_client.IEthClient,\n) error {\n\taddress, tx, instance, err := DeployFastTestToken(auth, client)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.Address = address\n\tf.LastTx = tx\n\tf.Instance = instance\n\treturn nil\n}",
"func (c *Contract) Deploy(account *Account) {\n\tif err := keos.Client.WalletUnlock(keos.Wallet, keos.WalletPassword); err != nil {\n\t\tif !strings.Contains(err.Error(), \"Already unlocked\") {\n\t\t\tlogrus.Fatalln(err)\n\t\t}\n\t}\n\n\tpathParts := strings.Split(strings.TrimRight(c.Path, \"/\"), \"/\")\n\twasmName := fmt.Sprintf(\"%s.wasm\", pathParts[len(pathParts)-1])\n\tabiName := fmt.Sprintf(\"%s.abi\", pathParts[len(pathParts)-1])\n\n\tc.Account = account\n\tfmt.Print(c.Account.Name)\n\n\tsetCode, err := system.NewSetCode(\n\t\teosgo.AccountName(c.Account.Name),\n\t\tfmt.Sprintf(\"%s/%s\", c.Path, wasmName),\n\t)\n\tif err != nil {\n\t\tnodeos.PushError(err)\n\t\treturn\n\t}\n\n\tsetAbi, err := system.NewSetABI(\n\t\teosgo.AccountName(c.Account.Name),\n\t\tfmt.Sprintf(\"%s/%s\", c.Path, abiName),\n\t)\n\tif err != nil {\n\t\tnodeos.PushError(err)\n\t\treturn\n\t}\n\n\tif _, err = nodeos.Client.SignPushActions(\n\t\tsetCode,\n\t\tsetAbi,\n\t); err != nil {\n\t\tnodeos.PushError(err)\n\t}\n\n\treturn\n}",
"func bindContractAccessControl(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func deployContract(ctx iscp.Sandbox) (dict.Dict, error) {\n\tctx.Log().Debugf(\"root.deployContract.begin\")\n\tif !isAuthorizedToDeploy(ctx) {\n\t\treturn nil, fmt.Errorf(\"root.deployContract: deploy not permitted for: %s\", ctx.Caller())\n\t}\n\tparams := kvdecoder.New(ctx.Params(), ctx.Log())\n\ta := assert.NewAssert(ctx.Log())\n\n\tprogHash := params.MustGetHashValue(ParamProgramHash)\n\tdescription := params.MustGetString(ParamDescription, \"N/A\")\n\tname := params.MustGetString(ParamName)\n\ta.Require(name != \"\", \"wrong name\")\n\n\t// pass to init function all params not consumed so far\n\tinitParams := dict.New()\n\tfor key, value := range ctx.Params() {\n\t\tif key != ParamProgramHash && key != ParamName && key != ParamDescription {\n\t\t\tinitParams.Set(key, value)\n\t\t}\n\t}\n\t// calls to loads VM from binary to check if it loads successfully\n\terr := ctx.DeployContract(progHash, \"\", \"\", nil)\n\ta.Require(err == nil, \"root.deployContract.fail 1: %v\", err)\n\n\t// VM loaded successfully. Storing contract in the registry and calling constructor\n\tmustStoreContractRecord(ctx, &ContractRecord{\n\t\tProgramHash: progHash,\n\t\tDescription: description,\n\t\tName: name,\n\t\tCreator: ctx.Caller(),\n\t}, a)\n\t_, err = ctx.Call(iscp.Hn(name), iscp.EntryPointInit, initParams, nil)\n\ta.RequireNoError(err)\n\n\tctx.Event(fmt.Sprintf(\"[deploy] name: %s hname: %s, progHash: %s, dscr: '%s'\",\n\t\tname, iscp.Hn(name), progHash.String(), description))\n\treturn nil, nil\n}",
"func deployContractTransaction(address flow.Address, name string, code []byte) *flow.Transaction {\n\tcadenceName := cadence.NewString(name)\n\tcadenceCode := bytesToCadenceArray(code)\n\n\treturn flow.NewTransaction().\n\t\tSetScript([]byte(deployContractTemplate)).\n\t\tAddRawArgument(jsoncdc.MustEncode(cadenceName)).\n\t\tAddRawArgument(jsoncdc.MustEncode(cadenceCode)).\n\t\tAddAuthorizer(address)\n}",
"func DeployContract(ctx context.Context, client Client, privateKeyHex string, binHex, abiJSON string, params ...interface{}) (*Transaction, error) {\n\tif len(privateKeyHex) > 2 && privateKeyHex[:2] == \"0x\" {\n\t\tprivateKeyHex = privateKeyHex[2:]\n\t}\n\tprivateKey, err := crypto.HexToECDSA(privateKeyHex)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid private key: %v\", err)\n\t}\n\n\tgasPrice, err := client.GetGasPrice(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot get gas price: %v\", err)\n\t}\n\n\tpublicKey := privateKey.Public()\n\tpublicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)\n\tif !ok {\n\t\treturn nil, errors.New(\"error casting public key to ECDSA\")\n\t}\n\n\tfromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)\n\tnonce, err := client.GetPendingTransactionCount(ctx, fromAddress)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot get nonce: %v\", err)\n\t}\n\tbinData, err := hexutil.Decode(binHex)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot decode contract data: %v\", err)\n\t}\n\tif len(params) > 0 {\n\t\tabiData, err := abi.JSON(strings.NewReader(abiJSON))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse ABI: %v\", err)\n\t\t}\n\t\targs2, err := ConvertArguments(abiData.Constructor, params)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tinput, err := abiData.Pack(\"\", args2...)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot pack parameters: %v\", err)\n\t\t}\n\t\tbinData = append(binData, input...)\n\t}\n\t//TODO try to use web3.Transaction only; can't sign currently\n\ttx := types.NewContractCreation(nonce, big.NewInt(0), 2000000, gasPrice, binData)\n\tsignedTx, err := types.SignTx(tx, types.HomesteadSigner{}, privateKey)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot sign transaction: %v\", err)\n\t}\n\traw, err := rlp.EncodeToBytes(signedTx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = client.SendRawTransaction(ctx, raw)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot send transaction: %v\", err)\n\t}\n\n\treturn convertTx(signedTx, fromAddress), nil\n}",
"func DeployContracts(auth *bind.TransactOpts, backend bind.ContractBackend, _owners []common.Address, _required *big.Int) (common.Address, *types.Transaction, *Contracts, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ContractsABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ContractsBin), backend, _owners, _required)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Contracts{ContractsCaller: ContractsCaller{contract: contract}, ContractsTransactor: ContractsTransactor{contract: contract}, ContractsFilterer: ContractsFilterer{contract: contract}}, nil\n}",
"func (i *FlowIntegration) deployContract(conn protocol.Conn, args ...interface{}) (interface{}, error) {\n\n\terr := server.CheckCommandArgumentCount(args, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\turi, ok := args[0].(string)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid URI argument: %#+v\", args[0])\n\t}\n\n\tdoc, ok := i.server.GetDocument(protocol.DocumentUri(uri))\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"could not find document for URI %s\", uri)\n\t}\n\n\tfile := parseFileFromURI(uri)\n\n\tname, ok := args[1].(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"invalid name argument\")\n\t}\n\n\tconn.ShowMessage(&protocol.ShowMessageParams{\n\t\tType: protocol.Info,\n\t\tMessage: fmt.Sprintf(\"Deploying contract %s (%s) to account 0x%s\", name, file, i.activeAddress.Hex()),\n\t})\n\n\tcode := []byte(doc.Text)\n\ttx := deployContractTransaction(i.activeAddress, name, code)\n\n\t_, err = i.sendTransactionHelper(conn, i.activeAddress, tx)\n\treturn nil, err\n}",
"func (c *contractDeployerFacade) DeployContract() error {\n\tfmt.Println(\"Starting contract deployer process.\")\n\tcontract := cc.Contract{\n\t\tIContract: consts.ContractNamesDict[c.contractType],\n\t}\n\terr := contract.DeployContract(\n\t\tc.contractArgs,\n\t\tc.auth,\n\t\tc.ethClient.EthClient)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(\"Successfully completed contract deployer process.\")\n\treturn nil\n}",
"func (_Testproxyfactory *TestproxyfactoryTransactorSession) DeployProxyContract(admin common.Address, initializerData []byte) (*types.Transaction, error) {\n\treturn _Testproxyfactory.Contract.DeployProxyContract(&_Testproxyfactory.TransactOpts, admin, initializerData)\n}",
"func (_Testproxyfactory *TestproxyfactorySession) DeployProxyContract(admin common.Address, initializerData []byte) (*types.Transaction, error) {\n\treturn _Testproxyfactory.Contract.DeployProxyContract(&_Testproxyfactory.TransactOpts, admin, initializerData)\n}",
"func Deploy(script, manifest []byte) *Contract {\n\treturn neogointernal.CallWithToken(Hash, \"deploy\",\n\t\tint(contract.States|contract.AllowNotify), script, manifest).(*Contract)\n}",
"func DeployAirdropContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *AirdropContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(AirdropContractABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(AirdropContractBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &AirdropContract{AirdropContractCaller: AirdropContractCaller{contract: contract}, AirdropContractTransactor: AirdropContractTransactor{contract: contract}, AirdropContractFilterer: AirdropContractFilterer{contract: contract}}, nil\n}",
"func (c *WasmContract) DeployWasmContract(args map[string]string, codepath string, runtime string) (string, error) {\n\t// preExe\n\tpreSelectUTXOResponse, err := c.PreDeployWasmContract(args, codepath, runtime)\n\tif err != nil {\n\t\tlog.Printf(\"DeployWasmContract preExe failed, err: %v\", err)\n\t\treturn \"\", err\n\t}\n\t// post\n\treturn c.PostWasmContract(preSelectUTXOResponse)\n}",
"func DeployCivilTCRContract(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address, plcr common.Address, param common.Address, govt common.Address) (common.Address, *types.Transaction, *CivilTCRContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CivilTCRContractABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CivilTCRContractBin), backend, token, plcr, param, govt)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CivilTCRContract{CivilTCRContractCaller: CivilTCRContractCaller{contract: contract}, CivilTCRContractTransactor: CivilTCRContractTransactor{contract: contract}, CivilTCRContractFilterer: CivilTCRContractFilterer{contract: contract}}, nil\n}",
"func NewContractDeployerFacade(\n\tprivateKey string,\n\trpc string,\n\tcontractArgs []string,\n\tcontractType string,\n\tgasLimit int,\n\tgasPrice int,\n) (*contractDeployerFacade, error) {\n\tfmt.Println(\"Starting account and blockchain connection process.\")\n\t// Process the private key from the flag\n\tuserAccount, err := ethacc.CreateAccount(privateKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Successfully accessed account for Public Key: %s\\n\",\n\t\tuserAccount.Account)\n\n\t// Connect to the RPC client with the give URL\n\tethClient, err1 := ethrpc.CreateClient(rpc)\n\tif err1 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to connect to given \" +\n\t\t\t\"rpc url : %v \\n\", err1)\n\t}\n\tdefer ethClient.CloseClient()\n\n\t// Attempt to load data from the blockchain given the connected RPC Client\n\tcurrBlockchainState, err2 := ethClient.LoadBlockChainState(context.Background())\n\tif err2 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to retrieve account using \" +\n\t\t\t\"provided private key : %v\\n\", err2)\n\t}\n\n\tfmt.Printf(\"Succesfully connected to RPC client %s. Current Block Height %d \"+\n\t\t\", for chain id: %d\\n\", ethClient.RawUrl, currBlockchainState.BlockNumber,\n\t\tcurrBlockchainState.ChainId)\n\n\t// Using the client and the account get data needed for contract deployment\n\tauth, err3 := ethClient.GetDataForTransaction(context.Background(),\n\t\tuserAccount, currBlockchainState.ChainId, gasLimit, gasPrice)\n\tif err3 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to get data for transaction \" +\n\t\t\t\"processing: %v\\n\", err3)\n\t}\n\n\tcontractDeployerFacade := &contractDeployerFacade{\n\t\tbaseContractInteractorFacade{\n\t\t\tuserAccount,\n\t\t\tethClient,\n\t\t\tcurrBlockchainState,\n\t\t\tauth,\n\t\t\tcontractType,\n\t\t},\n\t\tcontractArgs,\n\t}\n\tfmt.Println(\"Successfully completed account and blockchain connection \" +\n\t\t\"process.\")\n\treturn contractDeployerFacade, nil\n}",
"func DeployRBAC(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *RBAC, error) {\n\tparsed, err := abi.JSON(strings.NewReader(RBACABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(RBACBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &RBAC{RBACCaller: RBACCaller{contract: contract}, RBACTransactor: RBACTransactor{contract: contract}}, nil\n}",
"func DeployDropkitContract(auth *bind.TransactOpts, backend bind.ContractBackend, admin common.Address, pool common.Address) (common.Address, *types.Transaction, *DropkitContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(DropkitContractABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(DropkitContractBin), backend, admin, pool)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &DropkitContract{DropkitContractCaller: DropkitContractCaller{contract: contract}, DropkitContractTransactor: DropkitContractTransactor{contract: contract}, DropkitContractFilterer: DropkitContractFilterer{contract: contract}}, nil\n}",
"func DeployVPC(auth *bind.TransactOpts, backend bind.ContractBackend, _libSig common.Address) (common.Address, *types.Transaction, *VPC, error) {\n\tparsed, err := abi.JSON(strings.NewReader(VPCABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(VPCBin), backend, _libSig)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &VPC{VPCCaller: VPCCaller{contract: contract}, VPCTransactor: VPCTransactor{contract: contract}, VPCFilterer: VPCFilterer{contract: contract}}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewContractAccessControlCaller creates a new readonly instance of ContractAccessControl, bound to a specific deployed contract.
|
func NewContractAccessControlCaller(address common.Address, caller bind.ContractCaller) (*ContractAccessControlCaller, error) {
contract, err := bindContractAccessControl(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &ContractAccessControlCaller{contract: contract}, nil
}
|
[
"func bindContractAccessControl(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCivilTCRContractCaller(address common.Address, caller bind.ContractCaller) (*CivilTCRContractCaller, error) {\n\tcontract, err := bindCivilTCRContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CivilTCRContractCaller{contract: contract}, nil\n}",
"func NewLockContractCaller(address common.Address, caller bind.ContractCaller) (*LockContractCaller, error) {\n\tcontract, err := bindLockContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &LockContractCaller{contract: contract}, nil\n}",
"func NewAirdropContractCaller(address common.Address, caller bind.ContractCaller) (*AirdropContractCaller, error) {\n\tcontract, err := bindAirdropContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AirdropContractCaller{contract: contract}, nil\n}",
"func NewRBACCaller(address common.Address, caller bind.ContractCaller) (*RBACCaller, error) {\n\tcontract, err := bindRBAC(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RBACCaller{contract: contract}, nil\n}",
"func NewGenericContract(addr *common.Address, block *Block, trx *Transaction) *Contract {\n\t// make the contract\n\treturn &Contract{\n\t\tType: AccountTypeContract,\n\t\tOrdinalIndex: TransactionIndex(block, trx),\n\t\tAddress: Address(*addr),\n\t\tTransactionHash: trx.Hash,\n\t\tTimeStamp: block.TimeStamp,\n\t\tName: \"\",\n\t\tVersion: \"\",\n\t\tSupportContact: \"\",\n\t\tLicense: \"\",\n\t\tCompiler: \"\",\n\t\tIsOptimized: false,\n\t\tOptimizeRuns: 0,\n\t\tSourceCode: \"\",\n\t\tSourceCodeHash: nil,\n\t\tAbi: \"\",\n\t\tValidated: nil,\n\t}\n}",
"func DeployContractAccessControl(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ContractAccessControl, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ContractAccessControlBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &ContractAccessControl{ContractAccessControlCaller: ContractAccessControlCaller{contract: contract}, ContractAccessControlTransactor: ContractAccessControlTransactor{contract: contract}, ContractAccessControlFilterer: ContractAccessControlFilterer{contract: contract}}, nil\n}",
"func (cs ContractService) New(name string, description string) *models.Contract {\n\n\tb := models.Contract{models.ResourceAttributes{\n\t\tName: name,\n\t\tDescription: description,\n\t\tStatus: \"created, modified\",\n\t\tObjectClass: models.CONTRACT_OBJECT_CLASS,\n\t\tResourceName: cs.getResourceName(name),\n\t},\n\t\t\"context\",\n\t\t\"unspecified\",\n\t\tnil,\n\t\tnil,\n\t}\n\t//Do any additional construction logic here.\n\treturn &b\n}",
"func NewAssetCaller(address common.Address, caller bind.ContractCaller) (*AssetCaller, error) {\n\tcontract, err := bindAsset(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AssetCaller{contract: contract}, nil\n}",
"func NewContractAddress(channelID string, caller Address, code []byte) (newAddr Address) {\n\t// temp := make([]byte, 32+8)\n\t// copy(temp, caller[:])\n\t// PutUint64BE(temp[32:], uint64(sequence))\n\ttemp := util.BytesCombine([]byte(channelID), caller.Bytes(), code)\n\thasher := ripemd160.New()\n\thasher.Write(temp) // does not error\n\tcopy(newAddr[:], hasher.Sum(nil))\n\treturn\n}",
"func NewCivilTCRContract(address common.Address, backend bind.ContractBackend) (*CivilTCRContract, error) {\n\tcontract, err := bindCivilTCRContract(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CivilTCRContract{CivilTCRContractCaller: CivilTCRContractCaller{contract: contract}, CivilTCRContractTransactor: CivilTCRContractTransactor{contract: contract}, CivilTCRContractFilterer: CivilTCRContractFilterer{contract: contract}}, nil\n}",
"func newAuthAccountContractsChangeFunction(\n\tfunctionType *sema.FunctionType,\n\tgauge common.MemoryGauge,\n\thandler AccountContractAdditionHandler,\n\taddressValue interpreter.AddressValue,\n\tisUpdate bool,\n) *interpreter.HostFunctionValue {\n\treturn interpreter.NewHostFunctionValue(\n\t\tgauge,\n\t\tfunctionType,\n\t\tfunc(invocation interpreter.Invocation) interpreter.Value {\n\n\t\t\tlocationRange := invocation.LocationRange\n\n\t\t\tconst requiredArgumentCount = 2\n\n\t\t\tnameValue, ok := invocation.Arguments[0].(*interpreter.StringValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tnewCodeValue, ok := invocation.Arguments[1].(*interpreter.ArrayValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tconstructorArguments := invocation.Arguments[requiredArgumentCount:]\n\t\t\tconstructorArgumentTypes := invocation.ArgumentTypes[requiredArgumentCount:]\n\n\t\t\tcode, err := interpreter.ByteArrayValueToByteSlice(invocation.Interpreter, newCodeValue, locationRange)\n\t\t\tif err != nil {\n\t\t\t\tpanic(errors.NewDefaultUserError(\"add requires the second argument to be an array\"))\n\t\t\t}\n\n\t\t\t// Get the existing code\n\n\t\t\tcontractName := nameValue.Str\n\n\t\t\tif contractName == \"\" {\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"contract name argument cannot be empty.\" +\n\t\t\t\t\t\t\"it must match the name of the deployed contract declaration or contract interface declaration\",\n\t\t\t\t))\n\t\t\t}\n\n\t\t\taddress := addressValue.ToAddress()\n\t\t\tlocation := common.NewAddressLocation(invocation.Interpreter, address, contractName)\n\n\t\t\texistingCode, err := handler.GetAccountContractCode(location)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tif isUpdate {\n\t\t\t\t// We are updating an existing contract.\n\t\t\t\t// Ensure that there's a contract/contract-interface with the given name exists already\n\n\t\t\t\tif len(existingCode) == 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot update non-existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// We are adding a new contract.\n\t\t\t\t// Ensure that no contract/contract interface with the given name exists already\n\n\t\t\t\tif len(existingCode) > 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot overwrite existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check the code\n\t\t\thandleContractUpdateError := func(err error) {\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(&InvalidContractDeploymentError{\n\t\t\t\t\tErr: err,\n\t\t\t\t\tLocationRange: locationRange,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// NOTE: do NOT use the program obtained from the host environment, as the current program.\n\t\t\t// Always re-parse and re-check the new program.\n\n\t\t\t// NOTE: *DO NOT* store the program – the new or updated program\n\t\t\t// should not be effective during the execution\n\n\t\t\tconst getAndSetProgram = false\n\n\t\t\tprogram, err := handler.ParseAndCheckProgram(\n\t\t\t\tcode,\n\t\t\t\tlocation,\n\t\t\t\tgetAndSetProgram,\n\t\t\t)\n\t\t\thandleContractUpdateError(err)\n\n\t\t\t// The code may declare exactly one contract or one contract interface.\n\n\t\t\tvar contractTypes []*sema.CompositeType\n\t\t\tvar contractInterfaceTypes []*sema.InterfaceType\n\n\t\t\tprogram.Elaboration.ForEachGlobalType(func(_ string, variable *sema.Variable) {\n\t\t\t\tswitch ty := variable.Type.(type) {\n\t\t\t\tcase *sema.CompositeType:\n\t\t\t\t\tif ty.Kind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractTypes = append(contractTypes, ty)\n\t\t\t\t\t}\n\n\t\t\t\tcase *sema.InterfaceType:\n\t\t\t\t\tif ty.CompositeKind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractInterfaceTypes = append(contractInterfaceTypes, ty)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar deployedType sema.Type\n\t\t\tvar contractType *sema.CompositeType\n\t\t\tvar contractInterfaceType *sema.InterfaceType\n\t\t\tvar declaredName string\n\t\t\tvar declarationKind common.DeclarationKind\n\n\t\t\tswitch {\n\t\t\tcase len(contractTypes) == 1 && len(contractInterfaceTypes) == 0:\n\t\t\t\tcontractType = contractTypes[0]\n\t\t\t\tdeclaredName = contractType.Identifier\n\t\t\t\tdeployedType = contractType\n\t\t\t\tdeclarationKind = common.DeclarationKindContract\n\t\t\tcase len(contractInterfaceTypes) == 1 && len(contractTypes) == 0:\n\t\t\t\tcontractInterfaceType = contractInterfaceTypes[0]\n\t\t\t\tdeclaredName = contractInterfaceType.Identifier\n\t\t\t\tdeployedType = contractInterfaceType\n\t\t\t\tdeclarationKind = common.DeclarationKindContractInterface\n\t\t\t}\n\n\t\t\tif deployedType == nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the code must declare exactly one contract or contract interface\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// The declared contract or contract interface must have the name\n\t\t\t// passed to the constructor as the first argument\n\n\t\t\tif declaredName != contractName {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the name argument must match the name of the declaration: got %q, expected %q\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t\tcontractName,\n\t\t\t\t\tdeclaredName,\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// Validate the contract update\n\n\t\t\tif isUpdate {\n\t\t\t\toldCode, err := handler.GetAccountContractCode(location)\n\t\t\t\thandleContractUpdateError(err)\n\n\t\t\t\toldProgram, err := parser.ParseProgram(\n\t\t\t\t\tgauge,\n\t\t\t\t\toldCode,\n\t\t\t\t\tparser.Config{},\n\t\t\t\t)\n\n\t\t\t\tif !ignoreUpdatedProgramParserError(err) {\n\t\t\t\t\thandleContractUpdateError(err)\n\t\t\t\t}\n\n\t\t\t\tvalidator := NewContractUpdateValidator(\n\t\t\t\t\tlocation,\n\t\t\t\t\tcontractName,\n\t\t\t\t\toldProgram,\n\t\t\t\t\tprogram.Program,\n\t\t\t\t)\n\t\t\t\terr = validator.Validate()\n\t\t\t\thandleContractUpdateError(err)\n\t\t\t}\n\n\t\t\tinter := invocation.Interpreter\n\n\t\t\terr = updateAccountContractCode(\n\t\t\t\thandler,\n\t\t\t\tlocation,\n\t\t\t\tprogram,\n\t\t\t\tcode,\n\t\t\t\tcontractType,\n\t\t\t\tconstructorArguments,\n\t\t\t\tconstructorArgumentTypes,\n\t\t\t\tupdateAccountContractCodeOptions{\n\t\t\t\t\tcreateContract: !isUpdate,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tvar eventType *sema.CompositeType\n\n\t\t\tif isUpdate {\n\t\t\t\teventType = AccountContractUpdatedEventType\n\t\t\t} else {\n\t\t\t\teventType = AccountContractAddedEventType\n\t\t\t}\n\n\t\t\tcodeHashValue := CodeToHashValue(inter, code)\n\n\t\t\thandler.EmitEvent(\n\t\t\t\tinter,\n\t\t\t\teventType,\n\t\t\t\t[]interpreter.Value{\n\t\t\t\t\taddressValue,\n\t\t\t\t\tcodeHashValue,\n\t\t\t\t\tnameValue,\n\t\t\t\t},\n\t\t\t\tlocationRange,\n\t\t\t)\n\n\t\t\treturn interpreter.NewDeployedContractValue(\n\t\t\t\tinter,\n\t\t\t\taddressValue,\n\t\t\t\tnameValue,\n\t\t\t\tnewCodeValue,\n\t\t\t)\n\t\t},\n\t)\n}",
"func NewAccessControlClient(c config) *AccessControlClient {\n\treturn &AccessControlClient{config: c}\n}",
"func NewCivilTokenControllerContractCaller(address common.Address, caller bind.ContractCaller) (*CivilTokenControllerContractCaller, error) {\n\tcontract, err := bindCivilTokenControllerContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CivilTokenControllerContractCaller{contract: contract}, nil\n}",
"func (lr *LogsReader) CreateContract(chainID, codePath string, args ...interface{}) (*txs.Envelope, error) {\n\tvar byteArgs []byte\n\tvar err error\n\tif len(args) != 0 {\n\t\tbyteArgs, err = lr.abi.Constructor.Inputs.Pack(args...)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tacc := lr.GetOrCreateAccount(common.BigToAddress(common.Big0))\n\tcontractContents, err := ioutil.ReadFile(codePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontractHex, err := hex.DecodeString(string(contractContents))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpartitionID, _ := strconv.Atoi(chainID)\n\tpartitionID--\n\tacc.PartitionIDSequence[partitionID]++\n\ttx := payload.Payload(&payload.CallTx{\n\t\tInput: &payload.TxInput{\n\t\t\tAddress: acc.Account.GetAddress(),\n\t\t\tAmount: 1,\n\t\t\tSequence: acc.PartitionIDSequence[partitionID],\n\t\t},\n\t\tData: append(contractHex, byteArgs...),\n\t\tAddress: nil,\n\t\tFee: 1,\n\t\tGasLimit: 4100000000,\n\t})\n\n\tenv := txs.Enclose(chainID, tx)\n\terr = env.Sign(acc.Account)\n\n\treturn env, err\n}",
"func NewRegistrarContractCaller(address common.Address, caller bind.ContractCaller) (*RegistrarContractCaller, error) {\n\tcontract, err := bindRegistrarContract(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RegistrarContractCaller{contract: contract}, nil\n}",
"func NewStandardCaller(address common.Address, caller bind.ContractCaller) (*StandardCaller, error) {\n\tcontract, err := bindStandard(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardCaller{contract: contract}, nil\n}",
"func NewClonesCaller(address common.Address, caller bind.ContractCaller) (*ClonesCaller, error) {\n\tcontract, err := bindClones(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesCaller{contract: contract}, nil\n}",
"func GetCACreator(commonName string) reconciling.SecretCreator {\n\treturn func(se *corev1.Secret) (*corev1.Secret, error) {\n\t\tif se.Data == nil {\n\t\t\tse.Data = map[string][]byte{}\n\t\t}\n\n\t\t// if the CA exists, only check if it's expired but never attempt to replace an existing CA\n\t\tif certPEM, exists := se.Data[resources.CACertSecretKey]; exists {\n\t\t\tcerts, err := certutil.ParseCertsPEM(certPEM)\n\t\t\tif err != nil {\n\t\t\t\treturn se, fmt.Errorf(\"certificate is not valid PEM-encoded: %v\", err)\n\t\t\t}\n\n\t\t\tif time.Now().After(certs[0].NotAfter) {\n\t\t\t\treturn se, errors.New(\"certificate has expired\")\n\t\t\t}\n\n\t\t\treturn se, nil\n\t\t}\n\n\t\tcaKp, err := triple.NewCA(commonName)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to create a new CA: %v\", err)\n\t\t}\n\n\t\tse.Data[resources.CAKeySecretKey] = triple.EncodePrivateKeyPEM(caKp.Key)\n\t\tse.Data[resources.CACertSecretKey] = triple.EncodeCertPEM(caKp.Cert)\n\n\t\treturn se, nil\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
bindContractAccessControl binds a generic wrapper to an already deployed contract.
|
func bindContractAccessControl(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
|
[
"func DeployContractAccessControl(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ContractAccessControl, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ContractAccessControlABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ContractAccessControlBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &ContractAccessControl{ContractAccessControlCaller: ContractAccessControlCaller{contract: contract}, ContractAccessControlTransactor: ContractAccessControlTransactor{contract: contract}, ContractAccessControlFilterer: ContractAccessControlFilterer{contract: contract}}, nil\n}",
"func bindCivilTCRContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CivilTCRContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindAirdropContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(AirdropContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindComptroller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ComptrollerABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindContractWithABI(strABI string, address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(strABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindLockContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(LockContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindDropkitContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(DropkitContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindPermissioning(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(PermissioningABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindRBAC(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(RBACABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor), nil\n}",
"func bindEthvault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, ) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(EthvaultABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, nil), nil\n}",
"func bindCivilTokenControllerContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CivilTokenControllerContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindParameterizerContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ParameterizerContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindTenancy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(TenancyABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor), nil\n}",
"func NewContractAccessControlCaller(address common.Address, caller bind.ContractCaller) (*ContractAccessControlCaller, error) {\n\tcontract, err := bindContractAccessControl(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractAccessControlCaller{contract: contract}, nil\n}",
"func bindBank(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BankABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCVLTokenContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CVLTokenContractABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCanDelegate(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CanDelegateABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DeployCryptoCardsCore deploys a new Ethereum contract, binding an instance of CryptoCardsCore to it.
|
func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {
parsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))
if err != nil {
return common.Address{}, nil, nil, err
}
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil
}
|
[
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCryptoCardsCore(address common.Address, backend bind.ContractBackend) (*CryptoCardsCore, error) {\n\tcontract, err := bindCryptoCardsCore(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func NewCryptoCardsCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CryptoCardsCoreTransactor, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreTransactor{contract: contract}, nil\n}",
"func DeployMonsterCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MonsterCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MonsterCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MonsterCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &MonsterCore{MonsterCoreCaller: MonsterCoreCaller{contract: contract}, MonsterCoreTransactor: MonsterCoreTransactor{contract: contract}, MonsterCoreFilterer: MonsterCoreFilterer{contract: contract}}, nil\n}",
"func DeployCardBase(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardBase, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardBaseBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func DeployCrossEther(auth *bind.TransactOpts, backend bind.ContractBackend, erc20 common.Address) (common.Address, *types.Transaction, *CrossEther, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CrossEtherABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CrossEtherBin), backend, erc20)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CrossEther{CrossEtherCaller: CrossEtherCaller{contract: contract}, CrossEtherTransactor: CrossEtherTransactor{contract: contract}, CrossEtherFilterer: CrossEtherFilterer{contract: contract}}, nil\n}",
"func NewCryptoCardsCoreCaller(address common.Address, caller bind.ContractCaller) (*CryptoCardsCoreCaller, error) {\n\tcontract, err := bindCryptoCardsCore(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreCaller{contract: contract}, nil\n}",
"func (_BattleGroups *BattleGroupsCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func (_Battles *BattlesCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Battles.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func DeployCardOwnership(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CardOwnership, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CardOwnershipBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CardOwnership{CardOwnershipCaller: CardOwnershipCaller{contract: contract}, CardOwnershipTransactor: CardOwnershipTransactor{contract: contract}, CardOwnershipFilterer: CardOwnershipFilterer{contract: contract}}, nil\n}",
"func (op *OpenGo) DeployEthereumScaffold(ctx context.Context, scaffold EthereumScaffold) (EthereumScaffold, error) {\n\top.baseURL.Path = \"/api/ethereum-scaffolds/doDeploy\"\n\tscaffoldJSON, _ := json.Marshal(scaffold)\n\tresponse, err := op.SendRequest(ctx, \"POST\", scaffoldJSON)\n\n\tif err != nil {\n\t\treturn EthereumScaffold{}, fmt.Errorf(\"The HTTP request failed with error %s\\n\", err)\n\t}\n\tdata, _ := ioutil.ReadAll(response.Body)\n\tjson.Unmarshal(data, scaffold)\n\treturn scaffold, nil\n}",
"func DeployChequesbooks(authPtr *bind.TransactOpts, backend bind.ContractBackended) (bgmcommon.Address, *types.Transaction, *Chequesbooks, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ChequesbooksABI))\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, bgmcommon.FromHex(ChequesbooksBin), backend)\n\tif err != nil {\n\t\treturn bgmcommon.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Chequesbooks{ChequesbooksCalled: ChequesbooksCalled{contract: contract}, ChequesbooksTransactor: ChequesbooksTransactor{contract: contract}}, nil\n}",
"func deployContract(ctx iscp.Sandbox) (dict.Dict, error) {\n\tctx.Log().Debugf(\"root.deployContract.begin\")\n\tif !isAuthorizedToDeploy(ctx) {\n\t\treturn nil, fmt.Errorf(\"root.deployContract: deploy not permitted for: %s\", ctx.Caller())\n\t}\n\tparams := kvdecoder.New(ctx.Params(), ctx.Log())\n\ta := assert.NewAssert(ctx.Log())\n\n\tprogHash := params.MustGetHashValue(ParamProgramHash)\n\tdescription := params.MustGetString(ParamDescription, \"N/A\")\n\tname := params.MustGetString(ParamName)\n\ta.Require(name != \"\", \"wrong name\")\n\n\t// pass to init function all params not consumed so far\n\tinitParams := dict.New()\n\tfor key, value := range ctx.Params() {\n\t\tif key != ParamProgramHash && key != ParamName && key != ParamDescription {\n\t\t\tinitParams.Set(key, value)\n\t\t}\n\t}\n\t// calls to loads VM from binary to check if it loads successfully\n\terr := ctx.DeployContract(progHash, \"\", \"\", nil)\n\ta.Require(err == nil, \"root.deployContract.fail 1: %v\", err)\n\n\t// VM loaded successfully. Storing contract in the registry and calling constructor\n\tmustStoreContractRecord(ctx, &ContractRecord{\n\t\tProgramHash: progHash,\n\t\tDescription: description,\n\t\tName: name,\n\t\tCreator: ctx.Caller(),\n\t}, a)\n\t_, err = ctx.Call(iscp.Hn(name), iscp.EntryPointInit, initParams, nil)\n\ta.RequireNoError(err)\n\n\tctx.Event(fmt.Sprintf(\"[deploy] name: %s hname: %s, progHash: %s, dscr: '%s'\",\n\t\tname, iscp.Hn(name), progHash.String(), description))\n\treturn nil, nil\n}",
"func NewContractDeployerFacade(\n\tprivateKey string,\n\trpc string,\n\tcontractArgs []string,\n\tcontractType string,\n\tgasLimit int,\n\tgasPrice int,\n) (*contractDeployerFacade, error) {\n\tfmt.Println(\"Starting account and blockchain connection process.\")\n\t// Process the private key from the flag\n\tuserAccount, err := ethacc.CreateAccount(privateKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Successfully accessed account for Public Key: %s\\n\",\n\t\tuserAccount.Account)\n\n\t// Connect to the RPC client with the give URL\n\tethClient, err1 := ethrpc.CreateClient(rpc)\n\tif err1 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to connect to given \" +\n\t\t\t\"rpc url : %v \\n\", err1)\n\t}\n\tdefer ethClient.CloseClient()\n\n\t// Attempt to load data from the blockchain given the connected RPC Client\n\tcurrBlockchainState, err2 := ethClient.LoadBlockChainState(context.Background())\n\tif err2 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to retrieve account using \" +\n\t\t\t\"provided private key : %v\\n\", err2)\n\t}\n\n\tfmt.Printf(\"Succesfully connected to RPC client %s. Current Block Height %d \"+\n\t\t\", for chain id: %d\\n\", ethClient.RawUrl, currBlockchainState.BlockNumber,\n\t\tcurrBlockchainState.ChainId)\n\n\t// Using the client and the account get data needed for contract deployment\n\tauth, err3 := ethClient.GetDataForTransaction(context.Background(),\n\t\tuserAccount, currBlockchainState.ChainId, gasLimit, gasPrice)\n\tif err3 != nil {\n\t\treturn nil, fmt.Errorf(\"error: failed to get data for transaction \" +\n\t\t\t\"processing: %v\\n\", err3)\n\t}\n\n\tcontractDeployerFacade := &contractDeployerFacade{\n\t\tbaseContractInteractorFacade{\n\t\t\tuserAccount,\n\t\t\tethClient,\n\t\t\tcurrBlockchainState,\n\t\t\tauth,\n\t\t\tcontractType,\n\t\t},\n\t\tcontractArgs,\n\t}\n\tfmt.Println(\"Successfully completed account and blockchain connection \" +\n\t\t\"process.\")\n\treturn contractDeployerFacade, nil\n}",
"func TestVMKeeper_DeployModule(t *testing.T) {\n\tconfig := sdk.GetConfig()\n\tdnodeConfig.InitBechPrefixes(config)\n\n\tinput := newTestInput(false)\n\n\t// launch docker\n\tstopContainer := startDVMContainer(t, input.dsPort)\n\tdefer stopContainer()\n\n\t// create accounts.\n\taddr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address())\n\tacc1 := input.ak.NewAccountWithAddress(input.ctx, addr1)\n\n\tinput.ak.SetAccount(input.ctx, acc1)\n\n\tgs := getGenesis(t)\n\tinput.vk.InitGenesis(input.ctx, gs)\n\tinput.vk.SetDSContext(input.ctx)\n\tinput.vk.StartDSServer(input.ctx)\n\ttime.Sleep(2 * time.Second)\n\n\tbytecodeModule, err := vm_client.Compile(*vmCompiler, &compiler_grpc.SourceFiles{\n\t\tUnits: []*compiler_grpc.CompilationUnit{\n\t\t\t{\n\t\t\t\tText: mathModule,\n\t\t\t\tName: \"MathModule\",\n\t\t\t},\n\t\t},\n\t\tAddress: common_vm.Bech32ToLibra(addr1),\n\t})\n\trequire.NoErrorf(t, err, \"can't get code for math module: %v\", err)\n\trequire.Len(t, bytecodeModule, 1)\n\n\tmsg := types.NewMsgDeployModule(addr1, []types.Contract{bytecodeModule[0].ByteCode})\n\terr = msg.ValidateBasic()\n\trequire.NoErrorf(t, err, \"can't validate err: %v\", err)\n\n\tctx, writeCtx := input.ctx.CacheContext()\n\terr = input.vk.DeployContract(ctx, msg)\n\trequire.NoErrorf(t, err, \"can't deploy contract: %v\", err)\n\n\tevents := ctx.EventManager().Events()\n\tcheckNoEventErrors(events, t)\n\n\twriteCtx()\n\n\tbytecodeScript, err := vm_client.Compile(*vmCompiler, &compiler_grpc.SourceFiles{\n\t\tUnits: []*compiler_grpc.CompilationUnit{\n\t\t\t{\n\t\t\t\tText: strings.Replace(mathScript, \"{{sender}}\", addr1.String(), 1),\n\t\t\t\tName: \"MathScript\",\n\t\t\t},\n\t\t},\n\t\tAddress: common_vm.Bech32ToLibra(addr1),\n\t})\n\trequire.NoErrorf(t, err, \"can't compiler script for math module: %v\", err)\n\trequire.Len(t, bytecodeScript, 1)\n\n\tvar args []types.ScriptArg\n\t{\n\t\targ, err := vm_client.NewU64ScriptArg(\"10\")\n\t\trequire.NoError(t, err)\n\t\targs = append(args, arg)\n\t}\n\t{\n\t\targ, err := vm_client.NewU64ScriptArg(\"100\")\n\t\trequire.NoError(t, err)\n\t\targs = append(args, arg)\n\t}\n\n\tctx, _ = input.ctx.CacheContext()\n\tmsgScript := types.NewMsgExecuteScript(addr1, bytecodeScript[0].ByteCode, args)\n\terr = input.vk.ExecuteScript(ctx, msgScript)\n\trequire.NoError(t, err)\n\n\tevents = ctx.EventManager().Events()\n\tcheckNoEventErrors(events, t)\n\n\tcheckEventsContainsEvery(t, events, newKeepEvents())\n\tvmEvent := events[2]\n\trequire.Equal(t, vmEvent.Type, types.EventTypeMoveEvent, \"script after execution doesn't contain event with amount\")\n\trequire.Len(t, vmEvent.Attributes, 4)\n\t// sender\n\t{\n\t\tattrIdx := 0\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventSender)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, types.StringifySenderAddress(addr1))\n\t}\n\t// source\n\t{\n\t\tattrIdx := 1\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventSource)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, types.GetEventSourceAttribute(nil))\n\t}\n\t// type\n\t{\n\t\tattrIdx := 2\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventType)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, types.StringifyEventTypePanic(sdk.NewInfiniteGasMeter(), &vm_grpc.LcsTag{TypeTag: vm_grpc.LcsType_LcsU64}))\n\t}\n\t// data\n\t{\n\t\tattrIdx := 3\n\t\tuintBz := make([]byte, 8)\n\t\tbinary.LittleEndian.PutUint64(uintBz, uint64(110))\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Key, types.AttributeVmEventData)\n\t\trequire.EqualValues(t, vmEvent.Attributes[attrIdx].Value, hex.EncodeToString(uintBz))\n\t}\n}",
"func (f *FastTestTokenContract) DeployContract(\n\tauth *bind.TransactOpts,\n\tclient eth_rpc_client.IEthClient,\n) error {\n\taddress, tx, instance, err := DeployFastTestToken(auth, client)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.Address = address\n\tf.LastTx = tx\n\tf.Instance = instance\n\treturn nil\n}",
"func (k Keeper) DeployModuleCRC20(ctx sdk.Context, denom string) (common.Address, error) {\n\tctor, err := types.ModuleCRC20Contract.ABI.Pack(\"\", denom, uint8(0))\n\tif err != nil {\n\t\treturn common.Address{}, err\n\t}\n\tdata := types.ModuleCRC20Contract.Bin\n\tdata = append(data, ctor...)\n\n\tmsg, res, err := k.CallEVM(ctx, nil, data, big.NewInt(0))\n\tif err != nil {\n\t\treturn common.Address{}, err\n\t}\n\n\tif res.Failed() {\n\t\treturn common.Address{}, fmt.Errorf(\"contract deploy failed: %s\", res.Ret)\n\t}\n\treturn crypto.CreateAddress(types.EVMModuleAddress, msg.Nonce()), nil\n}",
"func Init(\n\tctx context.Context,\n\tchequebookFactory Factory,\n\tstateStore storage.StateStorer,\n\tlogger logging.Logger,\n\tswapInitialDeposit *big.Int,\n\ttransactionService transaction.Service,\n\tswapBackend transaction.Backend,\n\tchainId int64,\n\toverlayEthAddress common.Address,\n\tchequeSigner ChequeSigner,\n) (chequebookService Service, err error) {\n\t// verify that the supplied factory is valid\n\terr = chequebookFactory.VerifyBytecode(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terc20Address, err := chequebookFactory.ERC20Address(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terc20Service := erc20.New(swapBackend, transactionService, erc20Address)\n\n\tvar chequebookAddress common.Address\n\terr = stateStore.Get(chequebookKey, &chequebookAddress)\n\tif err != nil {\n\t\tif err != storage.ErrNotFound {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar txHash common.Hash\n\t\terr = stateStore.Get(ChequebookDeploymentKey, &txHash)\n\t\tif err != nil && err != storage.ErrNotFound {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == storage.ErrNotFound {\n\t\t\tlogger.Info(\"no chequebook found, deploying new one.\")\n\t\t\terr = checkBalance(ctx, logger, swapInitialDeposit, swapBackend, chainId, overlayEthAddress, erc20Service)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tnonce := make([]byte, 32)\n\t\t\t_, err = rand.Read(nonce)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// if we don't yet have a chequebook, deploy a new one\n\t\t\ttxHash, err = chequebookFactory.Deploy(ctx, overlayEthAddress, big.NewInt(0), common.BytesToHash(nonce))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tlogger.Infof(\"deploying new chequebook in transaction %x\", txHash)\n\n\t\t\terr = stateStore.Put(ChequebookDeploymentKey, txHash)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.Infof(\"waiting for chequebook deployment in transaction %x\", txHash)\n\t\t}\n\n\t\tchequebookAddress, err = chequebookFactory.WaitDeployed(ctx, txHash)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlogger.Infof(\"deployed chequebook at address %x\", chequebookAddress)\n\n\t\t// save the address for later use\n\t\terr = stateStore.Put(chequebookKey, chequebookAddress)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tchequebookService, err = New(transactionService, chequebookAddress, overlayEthAddress, stateStore, chequeSigner, erc20Service)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif swapInitialDeposit.Cmp(big.NewInt(0)) != 0 {\n\t\t\tlogger.Infof(\"depositing %d token into new chequebook\", swapInitialDeposit)\n\t\t\tdepositHash, err := chequebookService.Deposit(ctx, swapInitialDeposit)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tlogger.Infof(\"sent deposit transaction %x\", depositHash)\n\t\t\terr = chequebookService.WaitForDeposit(ctx, depositHash)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tlogger.Info(\"successfully deposited to chequebook\")\n\t\t}\n\t} else {\n\t\tchequebookService, err = New(transactionService, chequebookAddress, overlayEthAddress, stateStore, chequeSigner, erc20Service)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlogger.Infof(\"using existing chequebook %x\", chequebookAddress)\n\t}\n\n\t// regardless of how the chequebook service was initialised make sure that the chequebook is valid\n\terr = chequebookFactory.VerifyChequebook(ctx, chequebookService.Address())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn chequebookService, nil\n}",
"func NewCryptoCardsCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CryptoCardsCoreFilterer, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreFilterer{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCryptoCardsCore creates a new instance of CryptoCardsCore, bound to a specific deployed contract.
|
func NewCryptoCardsCore(address common.Address, backend bind.ContractBackend) (*CryptoCardsCore, error) {
contract, err := bindCryptoCardsCore(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil
}
|
[
"func NewCryptoCardsCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CryptoCardsCoreTransactor, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreTransactor{contract: contract}, nil\n}",
"func NewCryptoCardsCoreCaller(address common.Address, caller bind.ContractCaller) (*CryptoCardsCoreCaller, error) {\n\tcontract, err := bindCryptoCardsCore(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreCaller{contract: contract}, nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func NewCore(conf *Config) (*Core, error) {\n\tc := &Core{}\n\terr := c.loadConfigs(conf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Init CRT\n\tc.crt, err = crt.NewDocker()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.initKeyPair(conf.DataDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.initPacks(filepath.Join(conf.DataDir, consts.PacksDir))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.initProviders()\n\tif err == nil {\n\t\terr = c.initStores(conf.DataDir)\n\t}\n\n\treturn c, err\n}",
"func NewCryptoCardsCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CryptoCardsCoreFilterer, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreFilterer{contract: contract}, nil\n}",
"func NewCrypto(provider CryptoProvider) Crypto { return Crypto{provider} }",
"func NewCardBase(address common.Address, backend bind.ContractBackend) (*CardBase, error) {\n\tcontract, err := bindCardBase(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBase{CardBaseCaller: CardBaseCaller{contract: contract}, CardBaseTransactor: CardBaseTransactor{contract: contract}, CardBaseFilterer: CardBaseFilterer{contract: contract}}, nil\n}",
"func (_BattleGroups *BattleGroupsCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func newTestCryptoProvider(db DBRead, recurser Recurser, resolver Resolver, router Router,\n\talwaysCacheOnly bool) CryptoProvider {\n\n\treturn &cryptoProvider{\n\t\tdb: db,\n\t\trecurser: recurser,\n\t\tresolver: resolver,\n\t\trouter: router,\n\t\talwaysCacheOnly: alwaysCacheOnly,\n\t}\n}",
"func NewCrypto(factor string) (*Crypto, error) {\n\tc := new(Crypto)\n\treturn c, c.init(factor)\n}",
"func (_Battles *BattlesCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Battles.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func (be *Pkcs11Backend) newEcdsaPair(ID string, curve elliptic.Curve, extractable bool) (pkcs11.ObjectHandle, pkcs11.ObjectHandle, error) {\n\tecParam, err := asn1.Marshal(curveOIDs[curve.Params().Name])\n\tif err != nil {\n\t\treturn invalidObjectHandle, invalidObjectHandle, errors.Wrapf(err, \"Error marshaling curve parameters, curve: %s\", curve.Params().Name)\n\t}\n\tpublicKeyTemplate := []*pkcs11.Attribute{\n\t\tpkcs11.NewAttribute(pkcs11.CKA_CLASS, pkcs11.CKO_PUBLIC_KEY),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_KEY_TYPE, pkcs11.CKK_EC),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_EC_PARAMS, ecParam),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_TOKEN, true), // persistent\n\t\tpkcs11.NewAttribute(pkcs11.CKA_VERIFY, true),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_LABEL, ID),\n\t}\n\tprivateKeyTemplate := []*pkcs11.Attribute{\n\t\tpkcs11.NewAttribute(pkcs11.CKA_CLASS, pkcs11.CKO_PRIVATE_KEY),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_TOKEN, true), // persistent\n\t\tpkcs11.NewAttribute(pkcs11.CKA_SIGN, true),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_DERIVE, true),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_LABEL, ID),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_SENSITIVE, true),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_EXTRACTABLE, extractable),\n\t}\n\tpublicKeyHandle, privateKeyHandle, err := be.ctx.GenerateKeyPair(be.sessionHandle,\n\t\t[]*pkcs11.Mechanism{pkcs11.NewMechanism(pkcs11.CKM_EC_KEY_PAIR_GEN, nil)},\n\t\tpublicKeyTemplate, privateKeyTemplate)\n\treturn publicKeyHandle, privateKeyHandle, err\n}",
"func NewErc20Contract(addr *common.Address, name string, block *Block, trx *Transaction) *Contract {\n\t// make the contract\n\tcon := NewGenericContract(addr, block, trx)\n\n\t// set additional details\n\tcon.Type = AccountTypeERC20Token\n\tcon.Abi = contracts.ERCTwentyABI\n\tcon.Name = name\n\treturn con\n}",
"func NewCryptoCompare(base string, currencies []string, fetcher Fetcher) *CryptoCompare {\n\turls, err := getUrlsFromCurrencies(base, currencies)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn &CryptoCompare{\n\t\tslug: \"cryptocompare\",\n\t\turls: urls,\n\t\trates: *dto.NewRates(base),\n\t\tfetcher: fetcher,\n\t}\n}",
"func NewCar(address common.Address, backend bind.ContractBackend) (*Car, error) {\n\tcontract, err := bindCar(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Car{CarCaller: CarCaller{contract: contract}, CarTransactor: CarTransactor{contract: contract}, CarFilterer: CarFilterer{contract: contract}}, nil\n}",
"func NewCore(s Strategy, trimFn TrimFunc) Core {\n\tswitch {\n\tcase s == nil:\n\t\tpanic(throw.IllegalValue())\n\tcase trimFn == nil:\n\t\tpanic(throw.IllegalValue())\n\t}\n\n\treturn Core{\n\t\talloc: newAllocationTracker(s.AllocationPageSize()),\n\t\tstrat: s,\n\t\ttrimFn: trimFn,\n\t\ttrimEach: s.TrimOnEachAddition(),\n\t}\n}",
"func New(keyManager kms.KeyManager, c ariescrypto.Crypto, vdri vdriapi.Registry, dl ld.DocumentLoader) *Crypto {\n\treturn &Crypto{\n\t\tkeyManager: keyManager,\n\t\tcrypto: c,\n\t\tvdri: vdri,\n\t\tdocLoader: dl,\n\t}\n}",
"func NewAESCTRCrypto(key, iv []byte) *AESCTRCrypto {\n\treturn &AESCTRCrypto{\n\t\tkey: key,\n\t\tiv: iv,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCryptoCardsCoreCaller creates a new readonly instance of CryptoCardsCore, bound to a specific deployed contract.
|
func NewCryptoCardsCoreCaller(address common.Address, caller bind.ContractCaller) (*CryptoCardsCoreCaller, error) {
contract, err := bindCryptoCardsCore(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &CryptoCardsCoreCaller{contract: contract}, nil
}
|
[
"func NewCryptoCardsCore(address common.Address, backend bind.ContractBackend) (*CryptoCardsCore, error) {\n\tcontract, err := bindCryptoCardsCore(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCryptoCardsCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CryptoCardsCoreTransactor, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreTransactor{contract: contract}, nil\n}",
"func NewCryptoCardsCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CryptoCardsCoreFilterer, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreFilterer{contract: contract}, nil\n}",
"func NewCardBaseCaller(address common.Address, caller bind.ContractCaller) (*CardBaseCaller, error) {\n\tcontract, err := bindCardBase(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseCaller{contract: contract}, nil\n}",
"func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func NewCrypto(provider CryptoProvider) Crypto { return Crypto{provider} }",
"func NewCore(conf *Config) (*Core, error) {\n\tc := &Core{}\n\terr := c.loadConfigs(conf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Init CRT\n\tc.crt, err = crt.NewDocker()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.initKeyPair(conf.DataDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.initPacks(filepath.Join(conf.DataDir, consts.PacksDir))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = c.initProviders()\n\tif err == nil {\n\t\terr = c.initStores(conf.DataDir)\n\t}\n\n\treturn c, err\n}",
"func newTestCryptoProvider(db DBRead, recurser Recurser, resolver Resolver, router Router,\n\talwaysCacheOnly bool) CryptoProvider {\n\n\treturn &cryptoProvider{\n\t\tdb: db,\n\t\trecurser: recurser,\n\t\tresolver: resolver,\n\t\trouter: router,\n\t\talwaysCacheOnly: alwaysCacheOnly,\n\t}\n}",
"func (_BattleGroups *BattleGroupsCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func (_Battles *BattlesCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Battles.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func NewCarCaller(address common.Address, caller bind.ContractCaller) (*CarCaller, error) {\n\tcontract, err := bindCar(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarCaller{contract: contract}, nil\n}",
"func NewMonsterCoreCaller(address common.Address, caller bind.ContractCaller) (*MonsterCoreCaller, error) {\n\tcontract, err := bindMonsterCore(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterCoreCaller{contract: contract}, nil\n}",
"func NewChaincode(\n\tch *fabric.Channel,\n\ter *EnclaveRegistry,\n\tinvoker invokerContract,\n\tendorser endorserContract,\n\tid view.Identity,\n\tip identityProvider,\n\tcid string,\n) *Chaincode {\n\treturn &Chaincode{\n\t\tChannel: ch,\n\t\tEnclaveRegistry: er,\n\t\tInvokerContract: invoker,\n\t\tEndorserContract: endorser,\n\t\tSigner: id,\n\t\tIdentityProvider: ip,\n\t\tID: cid,\n\t}\n}",
"func NewClonesCaller(address common.Address, caller bind.ContractCaller) (*ClonesCaller, error) {\n\tcontract, err := bindClones(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesCaller{contract: contract}, nil\n}",
"func NewIPairedErc20Caller(address common.Address, caller bind.ContractCaller) (*IPairedErc20Caller, error) {\n\tcontract, err := bindIPairedErc20(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &IPairedErc20Caller{contract: contract}, nil\n}",
"func newCrc() *crc32 {\n\treturn &crc32{0, 0, 0, false}\n}",
"func NewStandardCaller(address common.Address, caller bind.ContractCaller) (*StandardCaller, error) {\n\tcontract, err := bindStandard(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardCaller{contract: contract}, nil\n}",
"func newCoreService(\n\tcfg config.API,\n\tchain blockchain.Blockchain,\n\tbs blocksync.BlockSync,\n\tsf factory.Factory,\n\tdao blockdao.BlockDAO,\n\tindexer blockindex.Indexer,\n\tbfIndexer blockindex.BloomFilterIndexer,\n\tactPool actpool.ActPool,\n\tregistry *protocol.Registry,\n\topts ...Option,\n) (CoreService, error) {\n\tapiCfg := Config{}\n\tfor _, opt := range opts {\n\t\tif err := opt(&apiCfg); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif cfg == (config.API{}) {\n\t\tlog.L().Warn(\"API server is not configured.\")\n\t\tcfg = config.Default.API\n\t}\n\n\tif cfg.RangeQueryLimit < uint64(cfg.TpsWindow) {\n\t\treturn nil, errors.New(\"range query upper limit cannot be less than tps window\")\n\t}\n\treturn &coreService{\n\t\tbc: chain,\n\t\tbs: bs,\n\t\tsf: sf,\n\t\tdao: dao,\n\t\tindexer: indexer,\n\t\tbfIndexer: bfIndexer,\n\t\tap: actPool,\n\t\tbroadcastHandler: apiCfg.broadcastHandler,\n\t\tcfg: cfg,\n\t\tregistry: registry,\n\t\tchainListener: NewChainListener(500),\n\t\tgs: gasstation.NewGasStation(chain, sf.SimulateExecution, dao, cfg),\n\t\telectionCommittee: apiCfg.electionCommittee,\n\t\treadCache: NewReadCache(),\n\t\thasActionIndex: apiCfg.hasActionIndex,\n\t}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCryptoCardsCoreTransactor creates a new writeonly instance of CryptoCardsCore, bound to a specific deployed contract.
|
func NewCryptoCardsCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CryptoCardsCoreTransactor, error) {
contract, err := bindCryptoCardsCore(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &CryptoCardsCoreTransactor{contract: contract}, nil
}
|
[
"func NewCryptoCardsCore(address common.Address, backend bind.ContractBackend) (*CryptoCardsCore, error) {\n\tcontract, err := bindCryptoCardsCore(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func NewCryptoCardsCoreCaller(address common.Address, caller bind.ContractCaller) (*CryptoCardsCoreCaller, error) {\n\tcontract, err := bindCryptoCardsCore(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreCaller{contract: contract}, nil\n}",
"func NewCarTransactor(address common.Address, transactor bind.ContractTransactor) (*CarTransactor, error) {\n\tcontract, err := bindCar(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarTransactor{contract: contract}, nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBaseTransactor(address common.Address, transactor bind.ContractTransactor) (*CardBaseTransactor, error) {\n\tcontract, err := bindCardBase(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseTransactor{contract: contract}, nil\n}",
"func NewEthoFSControllerTransactor(address common.Address, transactor bind.ContractTransactor) (*EthoFSControllerTransactor, error) {\n\tcontract, err := bindEthoFSController(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &EthoFSControllerTransactor{contract: contract}, nil\n}",
"func NewMonsterCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*MonsterCoreTransactor, error) {\n\tcontract, err := bindMonsterCore(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterCoreTransactor{contract: contract}, nil\n}",
"func NewSchellingCoinTransactor(address common.Address, transactor bind.ContractTransactor) (*SchellingCoinTransactor, error) {\n\tcontract, err := bindSchellingCoin(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SchellingCoinTransactor{contract: contract}, nil\n}",
"func NewChequesbooksTransactor(address bgmcommon.Address, transactor bind.ContractTransactor) (*ChequesbooksTransactor, error) {\n\tcontract, err := bindChequesbooks(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ChequesbooksTransactor{contract: contract}, nil\n}",
"func NewClonesTransactor(address common.Address, transactor bind.ContractTransactor) (*ClonesTransactor, error) {\n\tcontract, err := bindClones(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesTransactor{contract: contract}, nil\n}",
"func NewGopherConTransactor(address common.Address, transactor bind.ContractTransactor) (*GopherConTransactor, error) {\n\tcontract, err := bindGopherCon(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GopherConTransactor{contract: contract}, nil\n}",
"func NewCappedCrowdsaleTransactor(address common.Address, transactor bind.ContractTransactor) (*CappedCrowdsaleTransactor, error) {\n\tcontract, err := bindCappedCrowdsale(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CappedCrowdsaleTransactor{contract: contract}, nil\n}",
"func NewIPairedErc20Transactor(address common.Address, transactor bind.ContractTransactor) (*IPairedErc20Transactor, error) {\n\tcontract, err := bindIPairedErc20(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &IPairedErc20Transactor{contract: contract}, nil\n}",
"func NewCairoProverTransactor(address common.Address, transactor bind.ContractTransactor) (*CairoProverTransactor, error) {\n\tcontract, err := bindCairoProver(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CairoProverTransactor{contract: contract}, nil\n}",
"func NewCryptoCardsCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CryptoCardsCoreFilterer, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreFilterer{contract: contract}, nil\n}",
"func NewStandardTransactor(address common.Address, transactor bind.ContractTransactor) (*StandardTransactor, error) {\n\tcontract, err := bindStandard(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StandardTransactor{contract: contract}, nil\n}",
"func NewPancakeERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*PancakeERC20Transactor, error) {\n\tcontract, err := bindPancakeERC20(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PancakeERC20Transactor{contract: contract}, nil\n}",
"func NewSmartcontractTransactor(address common.Address, transactor bind.ContractTransactor) (*SmartcontractTransactor, error) {\n\tcontract, err := bindSmartcontract(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SmartcontractTransactor{contract: contract}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewCryptoCardsCoreFilterer creates a new log filterer instance of CryptoCardsCore, bound to a specific deployed contract.
|
func NewCryptoCardsCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*CryptoCardsCoreFilterer, error) {
contract, err := bindCryptoCardsCore(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &CryptoCardsCoreFilterer{contract: contract}, nil
}
|
[
"func NewCryptoCardsCore(address common.Address, backend bind.ContractBackend) (*CryptoCardsCore, error) {\n\tcontract, err := bindCryptoCardsCore(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func NewCryptoCardsCoreCaller(address common.Address, caller bind.ContractCaller) (*CryptoCardsCoreCaller, error) {\n\tcontract, err := bindCryptoCardsCore(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreCaller{contract: contract}, nil\n}",
"func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCardBaseFilterer(address common.Address, filterer bind.ContractFilterer) (*CardBaseFilterer, error) {\n\tcontract, err := bindCardBase(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseFilterer{contract: contract}, nil\n}",
"func NewCarFilterer(address common.Address, filterer bind.ContractFilterer) (*CarFilterer, error) {\n\tcontract, err := bindCar(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CarFilterer{contract: contract}, nil\n}",
"func (_CardBase *CardBaseFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBaseNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseNewCardIterator{contract: _CardBase.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewSchellingCoinFilterer(address common.Address, filterer bind.ContractFilterer) (*SchellingCoinFilterer, error) {\n\tcontract, err := bindSchellingCoin(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SchellingCoinFilterer{contract: contract}, nil\n}",
"func NewCrossEtherFilterer(address common.Address, filterer bind.ContractFilterer) (*CrossEtherFilterer, error) {\n\tcontract, err := bindCrossEther(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CrossEtherFilterer{contract: contract}, nil\n}",
"func NewCryptoCardsCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CryptoCardsCoreTransactor, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreTransactor{contract: contract}, nil\n}",
"func NewGopherConFilterer(address common.Address, filterer bind.ContractFilterer) (*GopherConFilterer, error) {\n\tcontract, err := bindGopherCon(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GopherConFilterer{contract: contract}, nil\n}",
"func NewCreditScoreDBFilterer(address common.Address, filterer bind.ContractFilterer) (*CreditScoreDBFilterer, error) {\n\tcontract, err := bindCreditScoreDB(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CreditScoreDBFilterer{contract: contract}, nil\n}",
"func NewClonesFilterer(address common.Address, filterer bind.ContractFilterer) (*ClonesFilterer, error) {\n\tcontract, err := bindClones(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ClonesFilterer{contract: contract}, nil\n}",
"func NewCairoProverFilterer(address common.Address, filterer bind.ContractFilterer) (*CairoProverFilterer, error) {\n\tcontract, err := bindCairoProver(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CairoProverFilterer{contract: contract}, nil\n}",
"func NewDelegateERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*DelegateERC20Filterer, error) {\n\tcontract, err := bindDelegateERC20(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DelegateERC20Filterer{contract: contract}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) FilterNewCard(opts *bind.FilterOpts) (*CardBattlesNewCardIterator, error) {\n\n\tlogs, sub, err := _CardBattles.contract.FilterLogs(opts, \"NewCard\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBattlesNewCardIterator{contract: _CardBattles.contract, event: \"NewCard\", logs: logs, sub: sub}, nil\n}",
"func NewMonsterCoreFilterer(address common.Address, filterer bind.ContractFilterer) (*MonsterCoreFilterer, error) {\n\tcontract, err := bindMonsterCore(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MonsterCoreFilterer{contract: contract}, nil\n}",
"func NewComptrollerFilterer(address common.Address, filterer bind.ContractFilterer) (*ComptrollerFilterer, error) {\n\tcontract, err := bindComptroller(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerFilterer{contract: contract}, nil\n}",
"func NewEthoFSControllerFilterer(address common.Address, filterer bind.ContractFilterer) (*EthoFSControllerFilterer, error) {\n\tcontract, err := bindEthoFSController(address, nil, nil, filterer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &EthoFSControllerFilterer{contract: contract}, nil\n}",
"func NewFilter(chain *core.BlockChain) func(id ID) error {\n\treturn newFilter(\n\t\tchain.Config(),\n\t\tchain.Genesis().Hash(),\n\t\tfunc() uint64 {\n\t\t\treturn chain.CurrentHeader().Number.Uint64()\n\t\t},\n\t)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
bindCryptoCardsCore binds a generic wrapper to an already deployed contract.
|
func bindCryptoCardsCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
|
[
"func bindCardBase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBaseABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func DeployCryptoCardsCore(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CryptoCardsCore, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CryptoCardsCoreABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CryptoCardsCoreBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func NewCryptoCardsCore(address common.Address, backend bind.ContractBackend) (*CryptoCardsCore, error) {\n\tcontract, err := bindCryptoCardsCore(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCore{CryptoCardsCoreCaller: CryptoCardsCoreCaller{contract: contract}, CryptoCardsCoreTransactor: CryptoCardsCoreTransactor{contract: contract}, CryptoCardsCoreFilterer: CryptoCardsCoreFilterer{contract: contract}}, nil\n}",
"func (_Battles *BattlesCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Battles.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func bindCardBattles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardBattlesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardMinting(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardMintingABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_BattleGroups *BattleGroupsCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func bindCar(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CarABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindSchellingCoin(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(SchellingCoinABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindClones(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ClonesABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindMonsterCore(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(MonsterCoreABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindChequesbooks(address bgmcommon.Address, Called bind.ContractCalled, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ChequesbooksABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, Called, transactor), nil\n}",
"func bindComptroller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ComptrollerABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func bindCrossEther(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CrossEtherABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCryptoCardsCoreTransactor(address common.Address, transactor bind.ContractTransactor) (*CryptoCardsCoreTransactor, error) {\n\tcontract, err := bindCryptoCardsCore(address, nil, transactor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreTransactor{contract: contract}, nil\n}",
"func bindBerryGetters(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BerryGettersABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCryptoCardsCoreCaller(address common.Address, caller bind.ContractCaller) (*CryptoCardsCoreCaller, error) {\n\tcontract, err := bindCryptoCardsCore(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CryptoCardsCoreCaller{contract: contract}, nil\n}",
"func bindZBGCard(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(ZBGCardABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BATTLECOOLDOWNTIME is a free data retrieval call binding the contract method 0x9db02257. Solidity: function BATTLE_COOLDOWN_TIME() constant returns(uint64)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {
var (
ret0 = new(uint64)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "BATTLE_COOLDOWN_TIME")
return *ret0, err
}
|
[
"func (_CardMinting *CardMintingCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _CardMinting.contract.Call(opts, out, \"BATTLE_COOLDOWN_TIME\")\n\treturn *ret0, err\n}",
"func (wb *BenderCC) ChargingTime() (time.Duration, error) {\n\tif wb.legacy {\n\t\tb, err := wb.conn.ReadHoldingRegisters(bendRegChargingDurationLegacy, 1)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\treturn time.Duration(binary.BigEndian.Uint16(b)) * time.Second, nil\n\t}\n\n\tb, err := wb.conn.ReadHoldingRegisters(bendRegChargingDuration, 2)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn time.Duration(binary.BigEndian.Uint32(b)) * time.Second, nil\n}",
"func (ht *HeadTracker) backfillTimeBudget() time.Duration {\n\treturn time.Duration(7 * float64(ht.config.BlockTime) / 10)\n}",
"func (s *Status) BusyTime() int64 {\n\treturn s.pStatus.busyTime // Busy_time\n}",
"func (_OrgsData *OrgsDataCaller) GetTime(opts *bind.CallOpts, uuid [16]byte) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _OrgsData.contract.Call(opts, out, \"getTime\", uuid)\n\treturn *ret0, err\n}",
"func (_OrgsData *OrgsDataCallerSession) GetTime(uuid [16]byte) (*big.Int, error) {\n\treturn _OrgsData.Contract.GetTime(&_OrgsData.CallOpts, uuid)\n}",
"func (m *ResponseStatus) GetTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {\n val, err := m.GetBackingStore().Get(\"time\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)\n }\n return nil\n}",
"func (_Oasis *Oasis) GetTime(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _Oasis.Call(opts, out, \"getTime\")\n\treturn *ret0, err\n}",
"func (b *ConstantBackOff) GetElapsedTime() time.Duration {\n\treturn time.Since(b.startTime)\n}",
"func getCacheTimePercentile(lastHealthTimes map[tc.CacheName]time.Duration, percentile float64) time.Duration {\n\ttimes := make([]time.Duration, 0, len(lastHealthTimes))\n\tfor _, t := range lastHealthTimes {\n\t\ttimes = append(times, t)\n\t}\n\tsort.Sort(Durations(times))\n\n\tn := int(float64(len(lastHealthTimes)) * percentile)\n\n\treturn times[n]\n}",
"func (wb *WebastoNext) ChargingTime() (time.Duration, error) {\n\tb, err := wb.conn.ReadHoldingRegisters(tqRegChargingTime, 2)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn time.Duration(binary.BigEndian.Uint32(b)) * time.Second, nil\n}",
"func (r *ResetPolicy) GetTimeToBlockInMinutes() int {\n\tif r == nil || r.TimeToBlockInMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *r.TimeToBlockInMinutes\n}",
"func genUnbondingTime(r *rand.Rand) (ubdTime time.Duration) {\n\treturn time.Duration(simulation.RandIntBetween(r, 60, 60*60*24*3*2)) * time.Second\n}",
"func BootTime() time.Time {\n\treturn btime\n}",
"func (p *Process) GetRemainingBurstTime() BurstTime {\n\treturn p.remainingbt\n}",
"func (w *ImpressionCountWorker) FailureTime() int64 { return 1 }",
"func (chainAPI *ChainAPI) BlockTime() time.Duration {\n\treturn chainAPI.chain.config.BlockTime()\n}",
"func (this *Winner) TimeRemaining() float64 {\n\treturn this.totalTime - this.time\n}",
"func (this *Countdown) TimeRemaining() float64 {\n\treturn this.totalTime - this.time\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BattleContract is a free data retrieval call binding the contract method 0xe01196ef. Solidity: function BattleContract() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleContract(opts *bind.CallOpts) (common.Address, error) {
var (
ret0 = new(common.Address)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "BattleContract")
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleContract(&_CryptoCardsCore.CallOpts)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleQueueContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleQueueContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleGroupContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleGroupContract\")\n\treturn *ret0, err\n}",
"func (b *blockchainRemote) get(ctx context.Context, networkId, contractName string, address common.Address) (*bind.BoundContract, error) {\n\tpbc, err := b.findContract(ctx, networkId, contractName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when finding contract: %v\", err)\n\t}\n\tparsed, err := abi.JSON(strings.NewReader(string(pbc.GetAbi().GetJson())))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when parsing contract abi: %v\", err)\n\t}\n\tbound := bind.NewBoundContract(address, parsed, b.blockchain, b.blockchain)\n\treturn bound, nil\n}",
"func (_IContractRegistry *IContractRegistryCaller) GetContract(opts *bind.CallOpts, _name string) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _IContractRegistry.contract.Call(opts, out, \"getContract\", _name)\n\treturn *ret0, err\n}",
"func (mock *MockNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) {\n\t// return zero\n\tret = make([]byte, 0)\n\treturn ret, 0, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleGroupContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleGroupContract(&_CryptoCardsCore.CallOpts)\n}",
"func (a *Account) Contract(pos int) common.Address {\n\treturn crypto.CreateAddress(a.Addr, uint64(pos))\n}",
"func (_CryptoCardsCore *CryptoCardsCoreSession) BattleQueueContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleQueueContract(&_CryptoCardsCore.CallOpts)\n}",
"func (b *backend) CallContract(ctx context.Context, result interface{}, call CallMsg, blockNumber *big.Int) error {\n\tdata := utils.AddHexPrefix(hex.EncodeToString(call.Data))\n\tparams := map[string]string{\"from\": call.From.Hex(), \"data\": data, \"to\": \"\"}\n\tif call.To != nil {\n\t\tparams[\"to\"] = call.To.Hex()\n\t}\n\n\tblockNumberHex := \"latest\"\n\tif blockNumber != nil {\n\t\tblockNumberHex = hexutil.EncodeBig(blockNumber)\n\t}\n\n\tresp, err := b.provider.SendRequest(ethCallMethod, params, blockNumberHex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn resp.GetObject(result)\n}",
"func (t *RpcServ) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error) {\n\t// 默认响应\n\tresp := &pb.AddressStatus{\n\t\tBcs: make([]*pb.TokenDetail, 0),\n\t}\n\t// 获取请求上下文,对内传递rctx\n\trctx := sctx.ValueReqCtx(gctx)\n\n\tif req == nil || req.GetAddress() == \"\" {\n\t\trctx.GetLog().Warn(\"param error,some param unset\")\n\t\treturn resp, ecom.ErrParameter\n\t}\n\n\tfor i := 0; i < len(req.Bcs); i++ {\n\t\ttmpTokenDetail := &pb.TokenDetail{\n\t\t\tBcname: req.Bcs[i].Bcname,\n\t\t}\n\t\thandle, err := models.NewChainHandle(req.Bcs[i].Bcname, rctx)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_BLOCKCHAIN_NOTEXIST\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t\t\tcontinue\n\t\t}\n\t\tbalance, err := handle.GetFrozenBalance(req.Address)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_UNKNOW_ERROR\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t} else {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_SUCCESS\n\t\t\ttmpTokenDetail.Balance = balance\n\t\t}\n\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t}\n\tresp.Address = req.GetAddress()\n\n\trctx.GetLog().SetInfoField(\"account\", req.GetAddress())\n\treturn resp, nil\n}",
"func (_Permissioning *PermissioningCaller) GetContractAddress(opts *bind.CallOpts, name [32]byte) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Permissioning.contract.Call(opts, out, \"getContractAddress\", name)\n\treturn *ret0, err\n}",
"func (_Permissioning *PermissioningSession) GetContractAddress(name [32]byte) (common.Address, error) {\n\treturn _Permissioning.Contract.GetContractAddress(&_Permissioning.CallOpts, name)\n}",
"func (gc *Client) GetContractAddress(ctx context.Context, txhash string) (common.Address, error) {\n\tvar raw interface{}\n\tvar contractAddress common.Address\n\terr := gc.c.CallContext(ctx, &raw, \"getTransactionReceipt\", gc.groupID, txhash)\n\tif err != nil {\n\t\treturn contractAddress, err\n\t}\n\tm, ok := raw.(map[string]interface{})\n if ok != true {\n return contractAddress, errors.New(\"GetContractAddress Json respond does not satisfy the type assertion: map[string]interface{}\")\n\t}\n\tvar temp interface{}\n\ttemp, ok = m[\"contractAddress\"]\n\tif ok != true {\n\t\treturn contractAddress, errors.New(\"Json respond does not contains the key : contractAddress\")\n\t}\n\tvar strContractAddress string\n\tstrContractAddress, ok = temp.(string)\n\tif ok != true {\n\t\treturn contractAddress, errors.New(\"type assertion for Chain Id is wrong: not a string\")\n\t}\n\treturn common.HexToAddress(strContractAddress), nil\n}",
"func ExContract(rt *RunTime, state uint32, name string, params *types.Map) (interface{}, error) {\r\n\r\n\tname = StateName(state, name)\r\n\tcontract, ok := rt.vm.Objects[name]\r\n\tif !ok {\r\n\t\tlog.WithFields(log.Fields{\"contract_name\": name, \"type\": consts.ContractError}).Error(\"unknown contract\")\r\n\t\treturn nil, fmt.Errorf(eUnknownContract, name)\r\n\t}\r\n\tif params == nil {\r\n\t\tparams = types.NewMap()\r\n\t}\r\n\tlogger := log.WithFields(log.Fields{\"contract_name\": name, \"type\": consts.ContractError})\r\n\tnames := make([]string, 0)\r\n\tvals := make([]interface{}, 0)\r\n\tcblock := contract.Value.(*Block)\r\n\tif cblock.Info.(*ContractInfo).Tx != nil {\r\n\t\tfor _, tx := range *cblock.Info.(*ContractInfo).Tx {\r\n\t\t\tval, ok := params.Get(tx.Name)\r\n\t\t\tif !ok {\r\n\t\t\t\tif !strings.Contains(tx.Tags, TagOptional) {\r\n\t\t\t\t\tlogger.WithFields(log.Fields{\"transaction_name\": tx.Name, \"type\": consts.ContractError}).Error(\"transaction not defined\")\r\n\t\t\t\t\treturn nil, fmt.Errorf(eUndefinedParam, tx.Name)\r\n\t\t\t\t}\r\n\t\t\t\tval = reflect.New(tx.Type).Elem().Interface()\r\n\t\t\t}\r\n\t\t\tnames = append(names, tx.Name)\r\n\t\t\tvals = append(vals, val)\r\n\t\t}\r\n\t}\r\n\tif len(vals) == 0 {\r\n\t\tvals = append(vals, ``)\r\n\t}\r\n\treturn ExecContract(rt, name, strings.Join(names, `,`), vals...)\r\n}",
"func (core *coreService) ReadContract(ctx context.Context, callerAddr address.Address, sc *action.Execution) (string, *iotextypes.Receipt, error) {\n\tlog.Logger(\"api\").Debug(\"receive read smart contract request\")\n\tkey := hash.Hash160b(append([]byte(sc.Contract()), sc.Data()...))\n\t// TODO: either moving readcache into the upper layer or change the storage format\n\tif d, ok := core.readCache.Get(key); ok {\n\t\tres := iotexapi.ReadContractResponse{}\n\t\tif err := proto.Unmarshal(d, &res); err == nil {\n\t\t\treturn res.Data, res.Receipt, nil\n\t\t}\n\t}\n\tstate, err := accountutil.AccountState(core.sf, callerAddr)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.InvalidArgument, err.Error())\n\t}\n\tif ctx, err = core.bc.Context(ctx); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tsc.SetNonce(state.Nonce + 1)\n\tblockGasLimit := core.bc.Genesis().BlockGasLimit\n\tif sc.GasLimit() == 0 || blockGasLimit < sc.GasLimit() {\n\t\tsc.SetGasLimit(blockGasLimit)\n\t}\n\tsc.SetGasPrice(big.NewInt(0)) // ReadContract() is read-only, use 0 to prevent insufficient gas\n\n\tretval, receipt, err := core.sf.SimulateExecution(ctx, callerAddr, sc, core.dao.GetBlockHash)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.Internal, err.Error())\n\t}\n\t// ReadContract() is read-only, if no error returned, we consider it a success\n\treceipt.Status = uint64(iotextypes.ReceiptStatus_Success)\n\tres := iotexapi.ReadContractResponse{\n\t\tData: hex.EncodeToString(retval),\n\t\tReceipt: receipt.ConvertToReceiptPb(),\n\t}\n\tif d, err := proto.Marshal(&res); err == nil {\n\t\tcore.readCache.Put(key, d)\n\t}\n\treturn res.Data, res.Receipt, nil\n}",
"func (_Asset *AssetCaller) Address(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"Address\")\n\treturn *ret0, err\n}",
"func (bt BlockTransaction) ContractAddress() string {\n\tif len(bt.Input) == 0 || bt.To != \"\" {\n\t\t// This is not a contract.\n\t\treturn \"\"\n\t}\n\n\thash := crypto.Keccak256(util.EncodeRLP([][]byte{\n\t\tfunc(from string) []byte {\n\t\t\to, _ := hex.DecodeString(from[2:])\n\t\t\treturn o\n\t\t}(bt.From),\n\t\tutil.IntToArr(bt.Nonce),\n\t}))\n\n\treturn \"0x\" + hex.EncodeToString(hash)[24:]\n}",
"func (_GlobalInbox *GlobalInboxCaller) GetEthBalance(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _GlobalInbox.contract.Call(opts, &out, \"getEthBalance\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BattleContract is a free data retrieval call binding the contract method 0xe01196ef. Solidity: function BattleContract() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleContract() (common.Address, error) {
return _CryptoCardsCore.Contract.BattleContract(&_CryptoCardsCore.CallOpts)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleQueueContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleQueueContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleGroupContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleGroupContract\")\n\treturn *ret0, err\n}",
"func (b *blockchainRemote) get(ctx context.Context, networkId, contractName string, address common.Address) (*bind.BoundContract, error) {\n\tpbc, err := b.findContract(ctx, networkId, contractName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when finding contract: %v\", err)\n\t}\n\tparsed, err := abi.JSON(strings.NewReader(string(pbc.GetAbi().GetJson())))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when parsing contract abi: %v\", err)\n\t}\n\tbound := bind.NewBoundContract(address, parsed, b.blockchain, b.blockchain)\n\treturn bound, nil\n}",
"func (_IContractRegistry *IContractRegistryCaller) GetContract(opts *bind.CallOpts, _name string) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _IContractRegistry.contract.Call(opts, out, \"getContract\", _name)\n\treturn *ret0, err\n}",
"func (mock *MockNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) {\n\t// return zero\n\tret = make([]byte, 0)\n\treturn ret, 0, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleGroupContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleGroupContract(&_CryptoCardsCore.CallOpts)\n}",
"func (a *Account) Contract(pos int) common.Address {\n\treturn crypto.CreateAddress(a.Addr, uint64(pos))\n}",
"func (_CryptoCardsCore *CryptoCardsCoreSession) BattleQueueContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleQueueContract(&_CryptoCardsCore.CallOpts)\n}",
"func (b *backend) CallContract(ctx context.Context, result interface{}, call CallMsg, blockNumber *big.Int) error {\n\tdata := utils.AddHexPrefix(hex.EncodeToString(call.Data))\n\tparams := map[string]string{\"from\": call.From.Hex(), \"data\": data, \"to\": \"\"}\n\tif call.To != nil {\n\t\tparams[\"to\"] = call.To.Hex()\n\t}\n\n\tblockNumberHex := \"latest\"\n\tif blockNumber != nil {\n\t\tblockNumberHex = hexutil.EncodeBig(blockNumber)\n\t}\n\n\tresp, err := b.provider.SendRequest(ethCallMethod, params, blockNumberHex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn resp.GetObject(result)\n}",
"func (t *RpcServ) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error) {\n\t// 默认响应\n\tresp := &pb.AddressStatus{\n\t\tBcs: make([]*pb.TokenDetail, 0),\n\t}\n\t// 获取请求上下文,对内传递rctx\n\trctx := sctx.ValueReqCtx(gctx)\n\n\tif req == nil || req.GetAddress() == \"\" {\n\t\trctx.GetLog().Warn(\"param error,some param unset\")\n\t\treturn resp, ecom.ErrParameter\n\t}\n\n\tfor i := 0; i < len(req.Bcs); i++ {\n\t\ttmpTokenDetail := &pb.TokenDetail{\n\t\t\tBcname: req.Bcs[i].Bcname,\n\t\t}\n\t\thandle, err := models.NewChainHandle(req.Bcs[i].Bcname, rctx)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_BLOCKCHAIN_NOTEXIST\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t\t\tcontinue\n\t\t}\n\t\tbalance, err := handle.GetFrozenBalance(req.Address)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_UNKNOW_ERROR\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t} else {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_SUCCESS\n\t\t\ttmpTokenDetail.Balance = balance\n\t\t}\n\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t}\n\tresp.Address = req.GetAddress()\n\n\trctx.GetLog().SetInfoField(\"account\", req.GetAddress())\n\treturn resp, nil\n}",
"func (_Permissioning *PermissioningCaller) GetContractAddress(opts *bind.CallOpts, name [32]byte) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Permissioning.contract.Call(opts, out, \"getContractAddress\", name)\n\treturn *ret0, err\n}",
"func (_Permissioning *PermissioningSession) GetContractAddress(name [32]byte) (common.Address, error) {\n\treturn _Permissioning.Contract.GetContractAddress(&_Permissioning.CallOpts, name)\n}",
"func (gc *Client) GetContractAddress(ctx context.Context, txhash string) (common.Address, error) {\n\tvar raw interface{}\n\tvar contractAddress common.Address\n\terr := gc.c.CallContext(ctx, &raw, \"getTransactionReceipt\", gc.groupID, txhash)\n\tif err != nil {\n\t\treturn contractAddress, err\n\t}\n\tm, ok := raw.(map[string]interface{})\n if ok != true {\n return contractAddress, errors.New(\"GetContractAddress Json respond does not satisfy the type assertion: map[string]interface{}\")\n\t}\n\tvar temp interface{}\n\ttemp, ok = m[\"contractAddress\"]\n\tif ok != true {\n\t\treturn contractAddress, errors.New(\"Json respond does not contains the key : contractAddress\")\n\t}\n\tvar strContractAddress string\n\tstrContractAddress, ok = temp.(string)\n\tif ok != true {\n\t\treturn contractAddress, errors.New(\"type assertion for Chain Id is wrong: not a string\")\n\t}\n\treturn common.HexToAddress(strContractAddress), nil\n}",
"func ExContract(rt *RunTime, state uint32, name string, params *types.Map) (interface{}, error) {\r\n\r\n\tname = StateName(state, name)\r\n\tcontract, ok := rt.vm.Objects[name]\r\n\tif !ok {\r\n\t\tlog.WithFields(log.Fields{\"contract_name\": name, \"type\": consts.ContractError}).Error(\"unknown contract\")\r\n\t\treturn nil, fmt.Errorf(eUnknownContract, name)\r\n\t}\r\n\tif params == nil {\r\n\t\tparams = types.NewMap()\r\n\t}\r\n\tlogger := log.WithFields(log.Fields{\"contract_name\": name, \"type\": consts.ContractError})\r\n\tnames := make([]string, 0)\r\n\tvals := make([]interface{}, 0)\r\n\tcblock := contract.Value.(*Block)\r\n\tif cblock.Info.(*ContractInfo).Tx != nil {\r\n\t\tfor _, tx := range *cblock.Info.(*ContractInfo).Tx {\r\n\t\t\tval, ok := params.Get(tx.Name)\r\n\t\t\tif !ok {\r\n\t\t\t\tif !strings.Contains(tx.Tags, TagOptional) {\r\n\t\t\t\t\tlogger.WithFields(log.Fields{\"transaction_name\": tx.Name, \"type\": consts.ContractError}).Error(\"transaction not defined\")\r\n\t\t\t\t\treturn nil, fmt.Errorf(eUndefinedParam, tx.Name)\r\n\t\t\t\t}\r\n\t\t\t\tval = reflect.New(tx.Type).Elem().Interface()\r\n\t\t\t}\r\n\t\t\tnames = append(names, tx.Name)\r\n\t\t\tvals = append(vals, val)\r\n\t\t}\r\n\t}\r\n\tif len(vals) == 0 {\r\n\t\tvals = append(vals, ``)\r\n\t}\r\n\treturn ExecContract(rt, name, strings.Join(names, `,`), vals...)\r\n}",
"func (core *coreService) ReadContract(ctx context.Context, callerAddr address.Address, sc *action.Execution) (string, *iotextypes.Receipt, error) {\n\tlog.Logger(\"api\").Debug(\"receive read smart contract request\")\n\tkey := hash.Hash160b(append([]byte(sc.Contract()), sc.Data()...))\n\t// TODO: either moving readcache into the upper layer or change the storage format\n\tif d, ok := core.readCache.Get(key); ok {\n\t\tres := iotexapi.ReadContractResponse{}\n\t\tif err := proto.Unmarshal(d, &res); err == nil {\n\t\t\treturn res.Data, res.Receipt, nil\n\t\t}\n\t}\n\tstate, err := accountutil.AccountState(core.sf, callerAddr)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.InvalidArgument, err.Error())\n\t}\n\tif ctx, err = core.bc.Context(ctx); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tsc.SetNonce(state.Nonce + 1)\n\tblockGasLimit := core.bc.Genesis().BlockGasLimit\n\tif sc.GasLimit() == 0 || blockGasLimit < sc.GasLimit() {\n\t\tsc.SetGasLimit(blockGasLimit)\n\t}\n\tsc.SetGasPrice(big.NewInt(0)) // ReadContract() is read-only, use 0 to prevent insufficient gas\n\n\tretval, receipt, err := core.sf.SimulateExecution(ctx, callerAddr, sc, core.dao.GetBlockHash)\n\tif err != nil {\n\t\treturn \"\", nil, status.Error(codes.Internal, err.Error())\n\t}\n\t// ReadContract() is read-only, if no error returned, we consider it a success\n\treceipt.Status = uint64(iotextypes.ReceiptStatus_Success)\n\tres := iotexapi.ReadContractResponse{\n\t\tData: hex.EncodeToString(retval),\n\t\tReceipt: receipt.ConvertToReceiptPb(),\n\t}\n\tif d, err := proto.Marshal(&res); err == nil {\n\t\tcore.readCache.Put(key, d)\n\t}\n\treturn res.Data, res.Receipt, nil\n}",
"func (_Asset *AssetCaller) Address(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"Address\")\n\treturn *ret0, err\n}",
"func (bt BlockTransaction) ContractAddress() string {\n\tif len(bt.Input) == 0 || bt.To != \"\" {\n\t\t// This is not a contract.\n\t\treturn \"\"\n\t}\n\n\thash := crypto.Keccak256(util.EncodeRLP([][]byte{\n\t\tfunc(from string) []byte {\n\t\t\to, _ := hex.DecodeString(from[2:])\n\t\t\treturn o\n\t\t}(bt.From),\n\t\tutil.IntToArr(bt.Nonce),\n\t}))\n\n\treturn \"0x\" + hex.EncodeToString(hash)[24:]\n}",
"func (_GlobalInbox *GlobalInboxCaller) GetEthBalance(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _GlobalInbox.contract.Call(opts, &out, \"getEthBalance\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BattleGroupContract is a free data retrieval call binding the contract method 0xe77dad5c. Solidity: function BattleGroupContract() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleGroupContract(opts *bind.CallOpts) (common.Address, error) {
var (
ret0 = new(common.Address)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "BattleGroupContract")
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleGroupContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleGroupContract(&_CryptoCardsCore.CallOpts)\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleContract(&_CryptoCardsCore.CallOpts)\n}",
"func bindBattleGroups(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleGroupsABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleQueueContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleQueueContract\")\n\treturn *ret0, err\n}",
"func (b *blockchainRemote) get(ctx context.Context, networkId, contractName string, address common.Address) (*bind.BoundContract, error) {\n\tpbc, err := b.findContract(ctx, networkId, contractName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when finding contract: %v\", err)\n\t}\n\tparsed, err := abi.JSON(strings.NewReader(string(pbc.GetAbi().GetJson())))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when parsing contract abi: %v\", err)\n\t}\n\tbound := bind.NewBoundContract(address, parsed, b.blockchain, b.blockchain)\n\treturn bound, nil\n}",
"func (_IContractRegistry *IContractRegistryCaller) GetContract(opts *bind.CallOpts, _name string) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _IContractRegistry.contract.Call(opts, out, \"getContract\", _name)\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreSession) BattleQueueContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleQueueContract(&_CryptoCardsCore.CallOpts)\n}",
"func (_Smartcontract *SmartcontractCaller) GetGroup(opts *bind.CallOpts, _groupId *big.Int) (struct {\n\tName string\n\tIndexes []*big.Int\n}, error) {\n\tvar out []interface{}\n\terr := _Smartcontract.contract.Call(opts, &out, \"getGroup\", _groupId)\n\n\toutstruct := new(struct {\n\t\tName string\n\t\tIndexes []*big.Int\n\t})\n\tif err != nil {\n\t\treturn *outstruct, err\n\t}\n\n\toutstruct.Name = *abi.ConvertType(out[0], new(string)).(*string)\n\toutstruct.Indexes = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)\n\n\treturn *outstruct, err\n\n}",
"func (_Permissioning *PermissioningSession) GetContractAddress(name [32]byte) (common.Address, error) {\n\treturn _Permissioning.Contract.GetContractAddress(&_Permissioning.CallOpts, name)\n}",
"func (b *backend) CallContract(ctx context.Context, result interface{}, call CallMsg, blockNumber *big.Int) error {\n\tdata := utils.AddHexPrefix(hex.EncodeToString(call.Data))\n\tparams := map[string]string{\"from\": call.From.Hex(), \"data\": data, \"to\": \"\"}\n\tif call.To != nil {\n\t\tparams[\"to\"] = call.To.Hex()\n\t}\n\n\tblockNumberHex := \"latest\"\n\tif blockNumber != nil {\n\t\tblockNumberHex = hexutil.EncodeBig(blockNumber)\n\t}\n\n\tresp, err := b.provider.SendRequest(ethCallMethod, params, blockNumberHex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn resp.GetObject(result)\n}",
"func (_BattleGroups *BattleGroupsCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func (t *RpcServ) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error) {\n\t// 默认响应\n\tresp := &pb.AddressStatus{\n\t\tBcs: make([]*pb.TokenDetail, 0),\n\t}\n\t// 获取请求上下文,对内传递rctx\n\trctx := sctx.ValueReqCtx(gctx)\n\n\tif req == nil || req.GetAddress() == \"\" {\n\t\trctx.GetLog().Warn(\"param error,some param unset\")\n\t\treturn resp, ecom.ErrParameter\n\t}\n\n\tfor i := 0; i < len(req.Bcs); i++ {\n\t\ttmpTokenDetail := &pb.TokenDetail{\n\t\t\tBcname: req.Bcs[i].Bcname,\n\t\t}\n\t\thandle, err := models.NewChainHandle(req.Bcs[i].Bcname, rctx)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_BLOCKCHAIN_NOTEXIST\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t\t\tcontinue\n\t\t}\n\t\tbalance, err := handle.GetFrozenBalance(req.Address)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_UNKNOW_ERROR\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t} else {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_SUCCESS\n\t\t\ttmpTokenDetail.Balance = balance\n\t\t}\n\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t}\n\tresp.Address = req.GetAddress()\n\n\trctx.GetLog().SetInfoField(\"account\", req.GetAddress())\n\treturn resp, nil\n}",
"func (a *Account) Contract(pos int) common.Address {\n\treturn crypto.CreateAddress(a.Addr, uint64(pos))\n}",
"func (_Permissioning *PermissioningCaller) GetContractAddress(opts *bind.CallOpts, name [32]byte) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Permissioning.contract.Call(opts, out, \"getContractAddress\", name)\n\treturn *ret0, err\n}",
"func (mock *MockNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) {\n\t// return zero\n\tret = make([]byte, 0)\n\treturn ret, 0, nil\n}",
"func DeployBattleGroups(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BattleGroups, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleGroupsABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattleGroupsBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BattleGroups{BattleGroupsCaller: BattleGroupsCaller{contract: contract}, BattleGroupsTransactor: BattleGroupsTransactor{contract: contract}, BattleGroupsFilterer: BattleGroupsFilterer{contract: contract}}, nil\n}",
"func NewContractAddress(channelID string, caller Address, code []byte) (newAddr Address) {\n\t// temp := make([]byte, 32+8)\n\t// copy(temp, caller[:])\n\t// PutUint64BE(temp[32:], uint64(sequence))\n\ttemp := util.BytesCombine([]byte(channelID), caller.Bytes(), code)\n\thasher := ripemd160.New()\n\thasher.Write(temp) // does not error\n\tcopy(newAddr[:], hasher.Sum(nil))\n\treturn\n}",
"func (_InauguralGateKeeper *InauguralGateKeeperCaller) Tournament(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _InauguralGateKeeper.contract.Call(opts, out, \"tournament\")\n\treturn *ret0, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BattleGroupContract is a free data retrieval call binding the contract method 0xe77dad5c. Solidity: function BattleGroupContract() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleGroupContract() (common.Address, error) {
return _CryptoCardsCore.Contract.BattleGroupContract(&_CryptoCardsCore.CallOpts)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleGroupContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleGroupContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleContract(&_CryptoCardsCore.CallOpts)\n}",
"func bindBattleGroups(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleGroupsABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleQueueContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleQueueContract\")\n\treturn *ret0, err\n}",
"func (b *blockchainRemote) get(ctx context.Context, networkId, contractName string, address common.Address) (*bind.BoundContract, error) {\n\tpbc, err := b.findContract(ctx, networkId, contractName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when finding contract: %v\", err)\n\t}\n\tparsed, err := abi.JSON(strings.NewReader(string(pbc.GetAbi().GetJson())))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when parsing contract abi: %v\", err)\n\t}\n\tbound := bind.NewBoundContract(address, parsed, b.blockchain, b.blockchain)\n\treturn bound, nil\n}",
"func (_IContractRegistry *IContractRegistryCaller) GetContract(opts *bind.CallOpts, _name string) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _IContractRegistry.contract.Call(opts, out, \"getContract\", _name)\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreSession) BattleQueueContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleQueueContract(&_CryptoCardsCore.CallOpts)\n}",
"func (_Smartcontract *SmartcontractCaller) GetGroup(opts *bind.CallOpts, _groupId *big.Int) (struct {\n\tName string\n\tIndexes []*big.Int\n}, error) {\n\tvar out []interface{}\n\terr := _Smartcontract.contract.Call(opts, &out, \"getGroup\", _groupId)\n\n\toutstruct := new(struct {\n\t\tName string\n\t\tIndexes []*big.Int\n\t})\n\tif err != nil {\n\t\treturn *outstruct, err\n\t}\n\n\toutstruct.Name = *abi.ConvertType(out[0], new(string)).(*string)\n\toutstruct.Indexes = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)\n\n\treturn *outstruct, err\n\n}",
"func (_Permissioning *PermissioningSession) GetContractAddress(name [32]byte) (common.Address, error) {\n\treturn _Permissioning.Contract.GetContractAddress(&_Permissioning.CallOpts, name)\n}",
"func (b *backend) CallContract(ctx context.Context, result interface{}, call CallMsg, blockNumber *big.Int) error {\n\tdata := utils.AddHexPrefix(hex.EncodeToString(call.Data))\n\tparams := map[string]string{\"from\": call.From.Hex(), \"data\": data, \"to\": \"\"}\n\tif call.To != nil {\n\t\tparams[\"to\"] = call.To.Hex()\n\t}\n\n\tblockNumberHex := \"latest\"\n\tif blockNumber != nil {\n\t\tblockNumberHex = hexutil.EncodeBig(blockNumber)\n\t}\n\n\tresp, err := b.provider.SendRequest(ethCallMethod, params, blockNumberHex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn resp.GetObject(result)\n}",
"func (_BattleGroups *BattleGroupsCaller) CryptoCardsContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"cryptoCardsContract\")\n\treturn *ret0, err\n}",
"func (t *RpcServ) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error) {\n\t// 默认响应\n\tresp := &pb.AddressStatus{\n\t\tBcs: make([]*pb.TokenDetail, 0),\n\t}\n\t// 获取请求上下文,对内传递rctx\n\trctx := sctx.ValueReqCtx(gctx)\n\n\tif req == nil || req.GetAddress() == \"\" {\n\t\trctx.GetLog().Warn(\"param error,some param unset\")\n\t\treturn resp, ecom.ErrParameter\n\t}\n\n\tfor i := 0; i < len(req.Bcs); i++ {\n\t\ttmpTokenDetail := &pb.TokenDetail{\n\t\t\tBcname: req.Bcs[i].Bcname,\n\t\t}\n\t\thandle, err := models.NewChainHandle(req.Bcs[i].Bcname, rctx)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_BLOCKCHAIN_NOTEXIST\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t\t\tcontinue\n\t\t}\n\t\tbalance, err := handle.GetFrozenBalance(req.Address)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_UNKNOW_ERROR\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t} else {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_SUCCESS\n\t\t\ttmpTokenDetail.Balance = balance\n\t\t}\n\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t}\n\tresp.Address = req.GetAddress()\n\n\trctx.GetLog().SetInfoField(\"account\", req.GetAddress())\n\treturn resp, nil\n}",
"func (a *Account) Contract(pos int) common.Address {\n\treturn crypto.CreateAddress(a.Addr, uint64(pos))\n}",
"func (_Permissioning *PermissioningCaller) GetContractAddress(opts *bind.CallOpts, name [32]byte) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Permissioning.contract.Call(opts, out, \"getContractAddress\", name)\n\treturn *ret0, err\n}",
"func (mock *MockNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) {\n\t// return zero\n\tret = make([]byte, 0)\n\treturn ret, 0, nil\n}",
"func DeployBattleGroups(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BattleGroups, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleGroupsABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattleGroupsBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BattleGroups{BattleGroupsCaller: BattleGroupsCaller{contract: contract}, BattleGroupsTransactor: BattleGroupsTransactor{contract: contract}, BattleGroupsFilterer: BattleGroupsFilterer{contract: contract}}, nil\n}",
"func NewContractAddress(channelID string, caller Address, code []byte) (newAddr Address) {\n\t// temp := make([]byte, 32+8)\n\t// copy(temp, caller[:])\n\t// PutUint64BE(temp[32:], uint64(sequence))\n\ttemp := util.BytesCombine([]byte(channelID), caller.Bytes(), code)\n\thasher := ripemd160.New()\n\thasher.Write(temp) // does not error\n\tcopy(newAddr[:], hasher.Sum(nil))\n\treturn\n}",
"func (_InauguralGateKeeper *InauguralGateKeeperCaller) Tournament(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _InauguralGateKeeper.contract.Call(opts, out, \"tournament\")\n\treturn *ret0, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BattleQueueContract is a free data retrieval call binding the contract method 0xd78d16b6. Solidity: function BattleQueueContract() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleQueueContract(opts *bind.CallOpts) (common.Address, error) {
var (
ret0 = new(common.Address)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "BattleQueueContract")
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreSession) BattleQueueContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleQueueContract(&_CryptoCardsCore.CallOpts)\n}",
"func bindBattleQueue(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleQueueABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleContract(&_CryptoCardsCore.CallOpts)\n}",
"func DeployBattleQueue(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BattleQueue, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleQueueABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattleQueueBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BattleQueue{BattleQueueCaller: BattleQueueCaller{contract: contract}, BattleQueueTransactor: BattleQueueTransactor{contract: contract}, BattleQueueFilterer: BattleQueueFilterer{contract: contract}}, nil\n}",
"func (mock *MockNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) {\n\t// return zero\n\tret = make([]byte, 0)\n\treturn ret, 0, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleGroupContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleGroupContract\")\n\treturn *ret0, err\n}",
"func (b *blockchainRemote) get(ctx context.Context, networkId, contractName string, address common.Address) (*bind.BoundContract, error) {\n\tpbc, err := b.findContract(ctx, networkId, contractName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when finding contract: %v\", err)\n\t}\n\tparsed, err := abi.JSON(strings.NewReader(string(pbc.GetAbi().GetJson())))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when parsing contract abi: %v\", err)\n\t}\n\tbound := bind.NewBoundContract(address, parsed, b.blockchain, b.blockchain)\n\treturn bound, nil\n}",
"func (_EthoFSDashboard *EthoFSDashboardSession) GetHostingContractAddress(UserAddress common.Address, ArrayKey *big.Int) (*types.Transaction, error) {\n\treturn _EthoFSDashboard.Contract.GetHostingContractAddress(&_EthoFSDashboard.TransactOpts, UserAddress, ArrayKey)\n}",
"func (_EthoFSDashboard *EthoFSDashboardTransactor) GetHostingContractAddress(opts *bind.TransactOpts, UserAddress common.Address, ArrayKey *big.Int) (*types.Transaction, error) {\n\treturn _EthoFSDashboard.contract.Transact(opts, \"GetHostingContractAddress\", UserAddress, ArrayKey)\n}",
"func (_IContractRegistry *IContractRegistryCaller) GetContract(opts *bind.CallOpts, _name string) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _IContractRegistry.contract.Call(opts, out, \"getContract\", _name)\n\treturn *ret0, err\n}",
"func (node *Node) generateDeployedStakingContractAddress(contractAddress common.Address) common.Address {\n\t//Correct Way 1:\n\t//node.SendTx(mycontracttx)\n\t//receipts := node.worker.GetCurrentReceipts()\n\t//deployedcontractaddress = receipts[len(receipts)-1].ContractAddress //get the address from the receipt\n\n\t//Correct Way 2:\n\t//nonce := GetNonce(contractAddress)\n\t//deployedAddress := crypto.CreateAddress(contractAddress, uint64(nonce))\n\tnonce := 0\n\treturn crypto.CreateAddress(contractAddress, uint64(nonce))\n}",
"func NewBattleQueue(address common.Address, backend bind.ContractBackend) (*BattleQueue, error) {\n\tcontract, err := bindBattleQueue(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattleQueue{BattleQueueCaller: BattleQueueCaller{contract: contract}, BattleQueueTransactor: BattleQueueTransactor{contract: contract}, BattleQueueFilterer: BattleQueueFilterer{contract: contract}}, nil\n}",
"func (b *backend) CallContract(ctx context.Context, result interface{}, call CallMsg, blockNumber *big.Int) error {\n\tdata := utils.AddHexPrefix(hex.EncodeToString(call.Data))\n\tparams := map[string]string{\"from\": call.From.Hex(), \"data\": data, \"to\": \"\"}\n\tif call.To != nil {\n\t\tparams[\"to\"] = call.To.Hex()\n\t}\n\n\tblockNumberHex := \"latest\"\n\tif blockNumber != nil {\n\t\tblockNumberHex = hexutil.EncodeBig(blockNumber)\n\t}\n\n\tresp, err := b.provider.SendRequest(ethCallMethod, params, blockNumberHex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn resp.GetObject(result)\n}",
"func (a *Account) Contract(pos int) common.Address {\n\treturn crypto.CreateAddress(a.Addr, uint64(pos))\n}",
"func (_Permissioning *PermissioningSession) GetContractAddress(name [32]byte) (common.Address, error) {\n\treturn _Permissioning.Contract.GetContractAddress(&_Permissioning.CallOpts, name)\n}",
"func (t *RpcServ) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error) {\n\t// 默认响应\n\tresp := &pb.AddressStatus{\n\t\tBcs: make([]*pb.TokenDetail, 0),\n\t}\n\t// 获取请求上下文,对内传递rctx\n\trctx := sctx.ValueReqCtx(gctx)\n\n\tif req == nil || req.GetAddress() == \"\" {\n\t\trctx.GetLog().Warn(\"param error,some param unset\")\n\t\treturn resp, ecom.ErrParameter\n\t}\n\n\tfor i := 0; i < len(req.Bcs); i++ {\n\t\ttmpTokenDetail := &pb.TokenDetail{\n\t\t\tBcname: req.Bcs[i].Bcname,\n\t\t}\n\t\thandle, err := models.NewChainHandle(req.Bcs[i].Bcname, rctx)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_BLOCKCHAIN_NOTEXIST\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t\t\tcontinue\n\t\t}\n\t\tbalance, err := handle.GetFrozenBalance(req.Address)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_UNKNOW_ERROR\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t} else {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_SUCCESS\n\t\t\ttmpTokenDetail.Balance = balance\n\t\t}\n\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t}\n\tresp.Address = req.GetAddress()\n\n\trctx.GetLog().SetInfoField(\"account\", req.GetAddress())\n\treturn resp, nil\n}",
"func NewBattleQueueCaller(address common.Address, caller bind.ContractCaller) (*BattleQueueCaller, error) {\n\tcontract, err := bindBattleQueue(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattleQueueCaller{contract: contract}, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleGroupContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleGroupContract(&_CryptoCardsCore.CallOpts)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BattleQueueContract is a free data retrieval call binding the contract method 0xd78d16b6. Solidity: function BattleQueueContract() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreSession) BattleQueueContract() (common.Address, error) {
return _CryptoCardsCore.Contract.BattleQueueContract(&_CryptoCardsCore.CallOpts)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleQueueContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleQueueContract\")\n\treturn *ret0, err\n}",
"func bindBattleQueue(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleQueueABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleContract\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleContract(&_CryptoCardsCore.CallOpts)\n}",
"func DeployBattleQueue(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BattleQueue, error) {\n\tparsed, err := abi.JSON(strings.NewReader(BattleQueueABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(BattleQueueBin), backend)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &BattleQueue{BattleQueueCaller: BattleQueueCaller{contract: contract}, BattleQueueTransactor: BattleQueueTransactor{contract: contract}, BattleQueueFilterer: BattleQueueFilterer{contract: contract}}, nil\n}",
"func (mock *MockNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) {\n\t// return zero\n\tret = make([]byte, 0)\n\treturn ret, 0, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BattleGroupContract(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BattleGroupContract\")\n\treturn *ret0, err\n}",
"func (b *blockchainRemote) get(ctx context.Context, networkId, contractName string, address common.Address) (*bind.BoundContract, error) {\n\tpbc, err := b.findContract(ctx, networkId, contractName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when finding contract: %v\", err)\n\t}\n\tparsed, err := abi.JSON(strings.NewReader(string(pbc.GetAbi().GetJson())))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"when parsing contract abi: %v\", err)\n\t}\n\tbound := bind.NewBoundContract(address, parsed, b.blockchain, b.blockchain)\n\treturn bound, nil\n}",
"func (_EthoFSDashboard *EthoFSDashboardSession) GetHostingContractAddress(UserAddress common.Address, ArrayKey *big.Int) (*types.Transaction, error) {\n\treturn _EthoFSDashboard.Contract.GetHostingContractAddress(&_EthoFSDashboard.TransactOpts, UserAddress, ArrayKey)\n}",
"func (_EthoFSDashboard *EthoFSDashboardTransactor) GetHostingContractAddress(opts *bind.TransactOpts, UserAddress common.Address, ArrayKey *big.Int) (*types.Transaction, error) {\n\treturn _EthoFSDashboard.contract.Transact(opts, \"GetHostingContractAddress\", UserAddress, ArrayKey)\n}",
"func (_IContractRegistry *IContractRegistryCaller) GetContract(opts *bind.CallOpts, _name string) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _IContractRegistry.contract.Call(opts, out, \"getContract\", _name)\n\treturn *ret0, err\n}",
"func (node *Node) generateDeployedStakingContractAddress(contractAddress common.Address) common.Address {\n\t//Correct Way 1:\n\t//node.SendTx(mycontracttx)\n\t//receipts := node.worker.GetCurrentReceipts()\n\t//deployedcontractaddress = receipts[len(receipts)-1].ContractAddress //get the address from the receipt\n\n\t//Correct Way 2:\n\t//nonce := GetNonce(contractAddress)\n\t//deployedAddress := crypto.CreateAddress(contractAddress, uint64(nonce))\n\tnonce := 0\n\treturn crypto.CreateAddress(contractAddress, uint64(nonce))\n}",
"func NewBattleQueue(address common.Address, backend bind.ContractBackend) (*BattleQueue, error) {\n\tcontract, err := bindBattleQueue(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattleQueue{BattleQueueCaller: BattleQueueCaller{contract: contract}, BattleQueueTransactor: BattleQueueTransactor{contract: contract}, BattleQueueFilterer: BattleQueueFilterer{contract: contract}}, nil\n}",
"func (b *backend) CallContract(ctx context.Context, result interface{}, call CallMsg, blockNumber *big.Int) error {\n\tdata := utils.AddHexPrefix(hex.EncodeToString(call.Data))\n\tparams := map[string]string{\"from\": call.From.Hex(), \"data\": data, \"to\": \"\"}\n\tif call.To != nil {\n\t\tparams[\"to\"] = call.To.Hex()\n\t}\n\n\tblockNumberHex := \"latest\"\n\tif blockNumber != nil {\n\t\tblockNumberHex = hexutil.EncodeBig(blockNumber)\n\t}\n\n\tresp, err := b.provider.SendRequest(ethCallMethod, params, blockNumberHex)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn resp.GetObject(result)\n}",
"func (a *Account) Contract(pos int) common.Address {\n\treturn crypto.CreateAddress(a.Addr, uint64(pos))\n}",
"func (_Permissioning *PermissioningSession) GetContractAddress(name [32]byte) (common.Address, error) {\n\treturn _Permissioning.Contract.GetContractAddress(&_Permissioning.CallOpts, name)\n}",
"func (t *RpcServ) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error) {\n\t// 默认响应\n\tresp := &pb.AddressStatus{\n\t\tBcs: make([]*pb.TokenDetail, 0),\n\t}\n\t// 获取请求上下文,对内传递rctx\n\trctx := sctx.ValueReqCtx(gctx)\n\n\tif req == nil || req.GetAddress() == \"\" {\n\t\trctx.GetLog().Warn(\"param error,some param unset\")\n\t\treturn resp, ecom.ErrParameter\n\t}\n\n\tfor i := 0; i < len(req.Bcs); i++ {\n\t\ttmpTokenDetail := &pb.TokenDetail{\n\t\t\tBcname: req.Bcs[i].Bcname,\n\t\t}\n\t\thandle, err := models.NewChainHandle(req.Bcs[i].Bcname, rctx)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_BLOCKCHAIN_NOTEXIST\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t\t\tcontinue\n\t\t}\n\t\tbalance, err := handle.GetFrozenBalance(req.Address)\n\t\tif err != nil {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_UNKNOW_ERROR\n\t\t\ttmpTokenDetail.Balance = \"\"\n\t\t} else {\n\t\t\ttmpTokenDetail.Error = pb.XChainErrorEnum_SUCCESS\n\t\t\ttmpTokenDetail.Balance = balance\n\t\t}\n\t\tresp.Bcs = append(resp.Bcs, tmpTokenDetail)\n\t}\n\tresp.Address = req.GetAddress()\n\n\trctx.GetLog().SetInfoField(\"account\", req.GetAddress())\n\treturn resp, nil\n}",
"func NewBattleQueueCaller(address common.Address, caller bind.ContractCaller) (*BattleQueueCaller, error) {\n\tcontract, err := bindBattleQueue(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BattleQueueCaller{contract: contract}, nil\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) BattleGroupContract() (common.Address, error) {\n\treturn _CryptoCardsCore.Contract.BattleGroupContract(&_CryptoCardsCore.CallOpts)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CardIndexToOwner is a free data retrieval call binding the contract method 0x78d0df50. Solidity: function cardIndexToOwner( uint256) constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) CardIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
var (
ret0 = new(common.Address)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "cardIndexToOwner", arg0)
return *ret0, err
}
|
[
"func (_CardMinting *CardMintingCaller) CardIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CardMinting.contract.Call(opts, out, \"cardIndexToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (_MonsterCore *MonsterCoreCaller) MonsterIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"monsterIndexToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (_MonsterMinting *MonsterMintingCaller) MonsterIndexToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"monsterIndexToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (_IotCloudlab *IotCloudlabCaller) RetrieveOwner(opts *bind.CallOpts) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _IotCloudlab.contract.Call(opts, &out, \"retrieveOwner\")\n\n\tif err != nil {\n\t\treturn *new([32]byte), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)\n\n\treturn out0, err\n\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) OwnerAddress(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"ownerAddress\")\n\treturn *ret0, err\n}",
"func (_MetaData *MetaDataCaller) Owner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MetaData.contract.Call(opts, out, \"owner\")\n\treturn *ret0, err\n}",
"func (_Paper *PaperCaller) PaperToOwner(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Paper.contract.Call(opts, out, \"paperToOwner\", arg0)\n\treturn *ret0, err\n}",
"func (r *Allowance) GetBalanceForOwner() uint {\n\tvar args [0]interface{}\n\n\tvar argsSerialized []byte\n\n\terr := proxyctx.Current.Serialize(args, &argsSerialized)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tres, err := proxyctx.Current.RouteCall(r.Reference, true, \"GetBalanceForOwner\", argsSerialized)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tret := [1]interface{}{}\n\tvar ret0 uint\n\tret[0] = &ret0\n\n\terr = proxyctx.Current.Deserialize(res, &ret)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn ret0\n}",
"func (_PaymentRecords *PaymentRecordsCaller) GetPaymentOwner(opts *bind.CallOpts, originalOwner common.Address, messageIndex *big.Int) (common.Address, error) {\n\tvar out []interface{}\n\terr := _PaymentRecords.contract.Call(opts, &out, \"getPaymentOwner\", originalOwner, messageIndex)\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}",
"func (_GlobalInbox *GlobalInboxCaller) GetPaymentOwner(opts *bind.CallOpts, originalOwner common.Address, messageIndex *big.Int) (common.Address, error) {\n\tvar out []interface{}\n\terr := _GlobalInbox.contract.Call(opts, &out, \"getPaymentOwner\", originalOwner, messageIndex)\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}",
"func (_NFToken *NFTokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _NFToken.Contract.OwnerOf(&_NFToken.CallOpts, _tokenId)\n}",
"func (_IotCloudlab *IotCloudlabSession) RetrieveOwner() ([32]byte, error) {\n\treturn _IotCloudlab.Contract.RetrieveOwner(&_IotCloudlab.CallOpts)\n}",
"func (_Bank *BankTransactor) TransferOwner(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bank.contract.Transact(opts, \"transferOwner\", newOwner)\n}",
"func (_Oasis *Oasis) GetOwner(opts *bind.CallOpts, id *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Oasis.Call(opts, out, \"getOwner\", id)\n\treturn *ret0, err\n}",
"func (_BalanceSheet *BalanceSheetCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BalanceSheet.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (_BurnableToken *BurnableTokenCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BurnableToken.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (_Paper *PaperSession) PaperToOwner(arg0 *big.Int) (common.Address, error) {\n\treturn _Paper.Contract.PaperToOwner(&_Paper.CallOpts, arg0)\n}",
"func (_Bank *BankTransactorSession) TransferOwner(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bank.Contract.TransferOwner(&_Bank.TransactOpts, newOwner)\n}",
"func (_Token *TokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _Token.Contract.OwnerOf(&_Token.CallOpts, _tokenId)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CardsHeldByOwner is a free data retrieval call binding the contract method 0x12c2debf. Solidity: function cardsHeldByOwner( address, uint256) constant returns(uint256)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) CardsHeldByOwner(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {
var (
ret0 = new(*big.Int)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "cardsHeldByOwner", arg0, arg1)
return *ret0, err
}
|
[
"func (_CardBattles *CardBattlesCaller) CardsHeldByOwner(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CardBattles.contract.Call(opts, out, \"cardsHeldByOwner\", arg0, arg1)\n\treturn *ret0, err\n}",
"func (_ZBGCard *ZBGCardCaller) TokensOwned(opts *bind.CallOpts, _owner common.Address) (struct {\n\tIndexes []*big.Int\n\tBalances []*big.Int\n}, error) {\n\tret := new(struct {\n\t\tIndexes []*big.Int\n\t\tBalances []*big.Int\n\t})\n\tout := ret\n\terr := _ZBGCard.contract.Call(opts, out, \"tokensOwned\", _owner)\n\treturn *ret, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) TokensOfOwner(opts *bind.CallOpts, _owner common.Address) ([]*big.Int, error) {\n\tvar (\n\t\tret0 = new([]*big.Int)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"tokensOfOwner\", _owner)\n\treturn *ret0, err\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func (_ZBGCard *ZBGCardCallerSession) TokensOwned(_owner common.Address) (struct {\n\tIndexes []*big.Int\n\tBalances []*big.Int\n}, error) {\n\treturn _ZBGCard.Contract.TokensOwned(&_ZBGCard.CallOpts, _owner)\n}",
"func (_Registry *RegistryCaller) Ownership(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Registry.contract.Call(opts, out, \"ownership\", arg0)\n\treturn *ret0, err\n}",
"func GetByOwner(stub shim.ChaincodeStubInterface, logger *shim.ChaincodeLogger, args []string) peer.Response {\n\tlogger.Info(\"Entry method: GetByOwner\")\n\tlogger.Debug(\"Received args:\", args)\n\n\t// Input sanitation\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. 1 expected\")\n\t}\n\tif args[0] == \"\" {\n\t\treturn shim.Error(\"Argument must be a non-empty string\")\n\t}\n\n\t// Mapping arg to variable\n\taccOwner := args[0]\n\n\t// Construct query string using account owner name\n\tqueryString := fmt.Sprintf(\"{\\\"selector\\\":{\\\"docType\\\":\\\"Account\\\",\\\"accountOwner\\\":\\\"%s\\\"}}\", accOwner)\n\tlogger.Debug(\"Query string:\", queryString)\n\n\t// Use package query to query couchdb and format the result\n\tqueryResults, err := query.GetQueryResultForQueryString(stub, queryString)\n\tif err != nil {\n\t\tlogger.Info(\"Exit method: GetByOwner\")\n\t\treturn shim.Error(\"Cannot get query results: \" + err.Error())\n\t}\n\n\terr = stub.SetEvent(\"get_account_by_owner\", []byte(\"Success\"))\n\tif err != nil {\n\t\tlogger.Critical(\"Failed to set event `get_account_by_owner`: \" + err.Error())\n\t\tlogger.Info(\"Exit method: GetByOwner\")\n\t\treturn shim.Error(\"Failed to set event `get_account_by_owner`: \" + err.Error())\n\t}\n\n\tlogger.Info(\"Exit method: GetByOwner\")\n\treturn shim.Success(queryResults)\n}",
"func (_MetaData *MetaDataCaller) Owner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MetaData.contract.Call(opts, out, \"owner\")\n\treturn *ret0, err\n}",
"func (_Asset *AssetCaller) Ownership(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"Ownership\")\n\treturn *ret0, err\n}",
"func (_IotCloudlab *IotCloudlabCaller) RetrieveOwner(opts *bind.CallOpts) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _IotCloudlab.contract.Call(opts, &out, \"retrieveOwner\")\n\n\tif err != nil {\n\t\treturn *new([32]byte), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)\n\n\treturn out0, err\n\n}",
"func (c *Deed) Owner() (common.Address, error) {\n\treturn c.Contract.Owner(nil)\n}",
"func InventoryHeldByCustomer(db XODB, v0 int) (int, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT public.inventory_held_by_customer($1)`\n\n\t// run query\n\tvar ret int\n\tXOLog(sqlstr, v0)\n\terr = db.QueryRow(sqlstr, v0).Scan(&ret)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn ret, nil\n}",
"func KeyOwner(address sdk.AccAddress, classID, tokenID string) []byte {\n\tkey := append(PrefixOwners, delimiter...)\n\tif address != nil {\n\t\tkey = append(key, []byte(address.String())...)\n\t\tkey = append(key, delimiter...)\n\t}\n\n\tif address != nil && len(classID) > 0 {\n\t\tkey = append(key, []byte(classID)...)\n\t\tkey = append(key, delimiter...)\n\t}\n\n\tif address != nil && len(classID) > 0 && len(tokenID) > 0 {\n\t\tkey = append(key, []byte(tokenID)...)\n\t}\n\treturn key\n}",
"func (playerView *PlayerView) VisibleHand(\n\tplayerName string) ([]card.Defined, string, error) {\n\tif playerName == playerView.playerName {\n\t\treturn nil,\n\t\t\t\"no color because of error\",\n\t\t\tfmt.Errorf(\"Player is not allowed to view own hand\")\n\t}\n\n\tplayerState, isParticipant := playerView.playerStates[playerName]\n\tif !isParticipant {\n\t\treturn nil,\n\t\t\t\"no color because of error\",\n\t\t\tfmt.Errorf(\"Player %v not found\", playerName)\n\t}\n\n\tvisibleCards, errorFromGameState := playerView.gameState.VisibleHand(playerName)\n\n\treturn visibleCards, playerState.Color(), errorFromGameState\n}",
"func (c *Card) QueryOwner() *UserQuery {\n\treturn NewCardClient(c.config).QueryOwner(c)\n}",
"func (_GlobalFTWallet *GlobalFTWalletCaller) OwnedERC20s(opts *bind.CallOpts, _owner common.Address) ([]common.Address, error) {\n\tvar out []interface{}\n\terr := _GlobalFTWallet.contract.Call(opts, &out, \"ownedERC20s\", _owner)\n\n\tif err != nil {\n\t\treturn *new([]common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)\n\n\treturn out0, err\n\n}",
"func GetOwnerKey(address sdk.AccAddress, denom string) []byte {\n\th := tmhash.New()\n\t_, err := h.Write([]byte(denom))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tbs := h.Sum(nil)\n\n\treturn append(GetOwnersKey(address), bs...)\n}",
"func (_IotCloudlab *IotCloudlabSession) RetrieveOwner() ([32]byte, error) {\n\treturn _IotCloudlab.Contract.RetrieveOwner(&_IotCloudlab.CallOpts)\n}",
"func (p *Participant) Owned() money.Reader {\n\treturn money.NewMoney(math.Abs(p.AmountPaid().Value() - p.AmountSpent().Value()))\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
IsReadyForBattle is a free data retrieval call binding the contract method 0x2109f89d. Solidity: function isReadyForBattle(_cardID uint256) constant returns(bool)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) IsReadyForBattle(opts *bind.CallOpts, _cardID *big.Int) (bool, error) {
var (
ret0 = new(bool)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "isReadyForBattle", _cardID)
return *ret0, err
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) IsReadyForBattle(_cardID *big.Int) (bool, error) {\n\treturn _CryptoCardsCore.Contract.IsReadyForBattle(&_CryptoCardsCore.CallOpts, _cardID)\n}",
"func (_BattleGroups *BattleGroupsCaller) IsGroupReadyForBattle(opts *bind.CallOpts, _groupID *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"isGroupReadyForBattle\", _groupID)\n\treturn *ret0, err\n}",
"func (_BasicTournament *BasicTournamentCaller) IsReady(opts *bind.CallOpts, wizardId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _BasicTournament.contract.Call(opts, out, \"isReady\", wizardId)\n\treturn *ret0, err\n}",
"func (_BattleGroups *BattleGroupsCallerSession) IsGroupReadyForBattle(_groupID *big.Int) (bool, error) {\n\treturn _BattleGroups.Contract.IsGroupReadyForBattle(&_BattleGroups.CallOpts, _groupID)\n}",
"func (_BasicTournament *BasicTournamentCallerSession) IsReady(wizardId *big.Int) (bool, error) {\n\treturn _BasicTournament.Contract.IsReady(&_BasicTournament.CallOpts, wizardId)\n}",
"func (p *fixtureProvisioner) IsReady() (result bool, err error) {\n\tp.log.Info(\"checking provisioner status\")\n\n\tif p.state.BecomeReadyCounter > 0 {\n\t\tp.state.BecomeReadyCounter--\n\t}\n\n\treturn p.state.BecomeReadyCounter == 0, nil\n}",
"func (im *InstanceManager) IsReadyForClose(instanceName string) bool {\n\treadyForCloseChecker := func(body string) bool {\n\t\tif err := im.ValidateMonitoringResponse(body); err != nil {\n\t\t\tlogger.Debugf(\"err: %s\", err)\n\t\t\t// Assume the instance is ready if non-valid response got\n\t\t\treturn false\n\t\t}\n\n\t\tresult, _ := formatutil.JSONStringToMap(body)\n\t\tsystem := result[\"system\"].(map[string]interface{})\n\t\treadyForClose := system[\"readyForClose\"].(bool)\n\n\t\treturn readyForClose\n\t}\n\n\terr := im.assertInstanceReady(instanceName, readyForCloseChecker)\n\treturn err == nil\n}",
"func (_MonsterCore *MonsterCoreCaller) IsReadyToBreed(opts *bind.CallOpts, _monsterId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"isReadyToBreed\", _monsterId)\n\treturn *ret0, err\n}",
"func (s *service) IsReady(_ context.Context) bool {\n\treturn s.ready\n}",
"func (_MonsterMinting *MonsterMintingCaller) IsReadyToBreed(opts *bind.CallOpts, _monsterId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"isReadyToBreed\", _monsterId)\n\treturn *ret0, err\n}",
"func (r *ResourceBase) IsReady() bool {\n\treturn false\n}",
"func (c *ControlPlaneContract) Ready() *Bool {\n\treturn &Bool{\n\t\tpath: []string{\"status\", \"ready\"},\n\t}\n}",
"func (instance HeatEngine) IsReady() bool {\n\treturn instance.Status.Conditions.IsTrue(condition.ReadyCondition)\n}",
"func IsReady() error {\n\treq, _ := http.NewRequest(\"GET\", viper.GetString(\"keto_url\")+\"/health/ready\", nil)\n\n\tclient := &http.Client{}\n\t_, err := client.Do(req)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (p *Peer) IsReady() bool {\n\treturn p.UnChoked && len(p.Bitfield) == len(Torr.Pieces) && p.Connected\n}",
"func (b *BootstrapContract) Ready() *Bool {\n\treturn &Bool{\n\t\tpath: []string{\"status\", \"ready\"},\n\t}\n}",
"func (m *Prober) IsReady(ctx context.Context, ing *v1alpha1.Ingress) (bool, error) {\n\tingressKey := types.NamespacedName{Namespace: ing.Namespace, Name: ing.Name}\n\tlogger := logging.FromContext(ctx)\n\n\tbytes, err := ingress.ComputeHash(ing)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to compute the hash of the Ingress: %w\", err)\n\t}\n\thash := fmt.Sprintf(\"%x\", bytes)\n\n\tif ready, ok := func() (bool, bool) {\n\t\tm.mu.Lock()\n\t\tdefer m.mu.Unlock()\n\t\tif state, ok := m.ingressStates[ingressKey]; ok {\n\t\t\tif state.hash == hash {\n\t\t\t\tstate.lastAccessed = time.Now()\n\t\t\t\treturn state.pendingCount.Load() == 0, true\n\t\t\t}\n\n\t\t\t// Cancel the polling for the outdated version\n\t\t\tstate.cancel()\n\t\t\tdelete(m.ingressStates, ingressKey)\n\t\t}\n\t\treturn false, false\n\t}(); ok {\n\t\treturn ready, nil\n\t}\n\n\tingCtx, cancel := context.WithCancel(context.Background())\n\tingressState := &ingressState{\n\t\thash: hash,\n\t\ting: ing,\n\t\tlastAccessed: time.Now(),\n\t\tcancel: cancel,\n\t}\n\n\t// Get the probe targets and group them by IP\n\ttargets, err := m.targetLister.ListProbeTargets(ctx, ing)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tworkItems := make(map[string][]*workItem)\n\tfor _, target := range targets {\n\t\tfor ip := range target.PodIPs {\n\t\t\tfor _, url := range target.URLs {\n\t\t\t\tworkItems[ip] = append(workItems[ip], &workItem{\n\t\t\t\t\tingressState: ingressState,\n\t\t\t\t\turl: url,\n\t\t\t\t\tpodIP: ip,\n\t\t\t\t\tpodPort: target.PodPort,\n\t\t\t\t\tlogger: logger,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tingressState.pendingCount.Store(int32(len(workItems)))\n\n\tfor ip, ipWorkItems := range workItems {\n\t\t// Get or create the context for that IP\n\t\tipCtx := func() context.Context {\n\t\t\tm.mu.Lock()\n\t\t\tdefer m.mu.Unlock()\n\t\t\tcancelCtx, ok := m.podContexts[ip]\n\t\t\tif !ok {\n\t\t\t\tctx, cancel := context.WithCancel(context.Background())\n\t\t\t\tcancelCtx = cancelContext{\n\t\t\t\t\tcontext: ctx,\n\t\t\t\t\tcancel: cancel,\n\t\t\t\t}\n\t\t\t\tm.podContexts[ip] = cancelCtx\n\t\t\t}\n\t\t\treturn cancelCtx.context\n\t\t}()\n\n\t\tpodCtx, cancel := context.WithCancel(ingCtx)\n\t\tpodState := &podState{\n\t\t\tpendingCount: *atomic.NewInt32(int32(len(ipWorkItems))),\n\t\t\tcancel: cancel,\n\t\t}\n\n\t\t// Quick and dirty way to join two contexts (i.e. podCtx is cancelled when either ingCtx or ipCtx are cancelled)\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-podCtx.Done():\n\t\t\t\t// This is the actual context, there is nothing to do except\n\t\t\t\t// break to avoid leaking this goroutine.\n\t\t\t\tbreak\n\t\t\tcase <-ipCtx.Done():\n\t\t\t\t// Cancel podCtx\n\t\t\t\tcancel()\n\t\t\t}\n\t\t}()\n\n\t\t// Update the states when probing is cancelled\n\t\tgo func() {\n\t\t\t<-podCtx.Done()\n\t\t\tm.onProbingCancellation(ingressState, podState)\n\t\t}()\n\n\t\tfor _, wi := range ipWorkItems {\n\t\t\twi.podState = podState\n\t\t\twi.context = podCtx\n\t\t\tm.workQueue.AddAfter(wi, initialDelay)\n\t\t\tlogger.Infof(\"Queuing probe for %s, IP: %s:%s (depth: %d)\",\n\t\t\t\twi.url, wi.podIP, wi.podPort, m.workQueue.Len())\n\t\t}\n\t}\n\n\tfunc() {\n\t\tm.mu.Lock()\n\t\tdefer m.mu.Unlock()\n\t\tm.ingressStates[ingressKey] = ingressState\n\t}()\n\treturn len(workItems) == 0, nil\n}",
"func (s *schedulerImpl) IsReady() bool {\n\treturn !s.cleanUpStaleCaptureStatus()\n}",
"func (c *Client) IsReady(data *pb.BackendData, opts ...interface{}) (bool, error) {\n\n\ttimeout := time.After(viper.GetDuration(\"server.backend-ready-timeout\"))\n\tticker := time.Tick(1000 * time.Millisecond)\n\n\ttimer := prometheus.NewTimer(metrics.BackendIsReadyDuration)\n\tdefer timer.ObserveDuration()\n\n\t// Keep trying until we're time out or get a result or get an error\n\tfor {\n\t\tselect {\n\t\t// Got a timeout! fail with a timeout error\n\t\tcase <-timeout:\n\t\t\tmetrics.BackendReadyTimeoutTotal.Inc()\n\t\t\treturn false, errors.New(\"timed out\")\n\t\t// Got a tick\n\t\tcase <-ticker:\n\t\t\tdeploymentIsReady := false\n\t\t\tserviceIsReady := false\n\n\t\t\tdeployment, err := c.getDeployment(data)\n\t\t\tif err != nil {\n\t\t\t\tmetrics.BackendReadyErrorTotal.WithLabelValues(\"deployment\").Inc()\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tfor _, dcondidtion := range deployment.Status.Conditions {\n\t\t\t\tif dcondidtion.Status == apiv1.ConditionFalse {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdeploymentIsReady = true\n\t\t\t}\n\n\t\t\tservice, err := c.getService(data)\n\t\t\tif err != nil {\n\t\t\t\tmetrics.BackendReadyErrorTotal.WithLabelValues(\"service\").Inc()\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tfor _, scondidtion := range service.Status.LoadBalancer.Ingress {\n\t\t\t\tif scondidtion.IP == \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tserviceIsReady = true\n\t\t\t}\n\n\t\t\tif deploymentIsReady && serviceIsReady {\n\t\t\t\tmetrics.BackendReadyTotal.WithLabelValues(\"deployment\", \"true\").Inc()\n\t\t\t\tmetrics.BackendReadyTotal.WithLabelValues(\"service\", \"true\").Inc()\n\t\t\t\treturn (deploymentIsReady && serviceIsReady), nil\n\t\t\t}\n\t\t}\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
IsReadyForBattle is a free data retrieval call binding the contract method 0x2109f89d. Solidity: function isReadyForBattle(_cardID uint256) constant returns(bool)
|
func (_CryptoCardsCore *CryptoCardsCoreCallerSession) IsReadyForBattle(_cardID *big.Int) (bool, error) {
return _CryptoCardsCore.Contract.IsReadyForBattle(&_CryptoCardsCore.CallOpts, _cardID)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreCaller) IsReadyForBattle(opts *bind.CallOpts, _cardID *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"isReadyForBattle\", _cardID)\n\treturn *ret0, err\n}",
"func (_BattleGroups *BattleGroupsCaller) IsGroupReadyForBattle(opts *bind.CallOpts, _groupID *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _BattleGroups.contract.Call(opts, out, \"isGroupReadyForBattle\", _groupID)\n\treturn *ret0, err\n}",
"func (_BasicTournament *BasicTournamentCaller) IsReady(opts *bind.CallOpts, wizardId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _BasicTournament.contract.Call(opts, out, \"isReady\", wizardId)\n\treturn *ret0, err\n}",
"func (_BattleGroups *BattleGroupsCallerSession) IsGroupReadyForBattle(_groupID *big.Int) (bool, error) {\n\treturn _BattleGroups.Contract.IsGroupReadyForBattle(&_BattleGroups.CallOpts, _groupID)\n}",
"func (_BasicTournament *BasicTournamentCallerSession) IsReady(wizardId *big.Int) (bool, error) {\n\treturn _BasicTournament.Contract.IsReady(&_BasicTournament.CallOpts, wizardId)\n}",
"func (p *fixtureProvisioner) IsReady() (result bool, err error) {\n\tp.log.Info(\"checking provisioner status\")\n\n\tif p.state.BecomeReadyCounter > 0 {\n\t\tp.state.BecomeReadyCounter--\n\t}\n\n\treturn p.state.BecomeReadyCounter == 0, nil\n}",
"func (im *InstanceManager) IsReadyForClose(instanceName string) bool {\n\treadyForCloseChecker := func(body string) bool {\n\t\tif err := im.ValidateMonitoringResponse(body); err != nil {\n\t\t\tlogger.Debugf(\"err: %s\", err)\n\t\t\t// Assume the instance is ready if non-valid response got\n\t\t\treturn false\n\t\t}\n\n\t\tresult, _ := formatutil.JSONStringToMap(body)\n\t\tsystem := result[\"system\"].(map[string]interface{})\n\t\treadyForClose := system[\"readyForClose\"].(bool)\n\n\t\treturn readyForClose\n\t}\n\n\terr := im.assertInstanceReady(instanceName, readyForCloseChecker)\n\treturn err == nil\n}",
"func (_MonsterCore *MonsterCoreCaller) IsReadyToBreed(opts *bind.CallOpts, _monsterId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"isReadyToBreed\", _monsterId)\n\treturn *ret0, err\n}",
"func (s *service) IsReady(_ context.Context) bool {\n\treturn s.ready\n}",
"func (_MonsterMinting *MonsterMintingCaller) IsReadyToBreed(opts *bind.CallOpts, _monsterId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"isReadyToBreed\", _monsterId)\n\treturn *ret0, err\n}",
"func (r *ResourceBase) IsReady() bool {\n\treturn false\n}",
"func (c *ControlPlaneContract) Ready() *Bool {\n\treturn &Bool{\n\t\tpath: []string{\"status\", \"ready\"},\n\t}\n}",
"func (instance HeatEngine) IsReady() bool {\n\treturn instance.Status.Conditions.IsTrue(condition.ReadyCondition)\n}",
"func IsReady() error {\n\treq, _ := http.NewRequest(\"GET\", viper.GetString(\"keto_url\")+\"/health/ready\", nil)\n\n\tclient := &http.Client{}\n\t_, err := client.Do(req)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (p *Peer) IsReady() bool {\n\treturn p.UnChoked && len(p.Bitfield) == len(Torr.Pieces) && p.Connected\n}",
"func (b *BootstrapContract) Ready() *Bool {\n\treturn &Bool{\n\t\tpath: []string{\"status\", \"ready\"},\n\t}\n}",
"func (m *Prober) IsReady(ctx context.Context, ing *v1alpha1.Ingress) (bool, error) {\n\tingressKey := types.NamespacedName{Namespace: ing.Namespace, Name: ing.Name}\n\tlogger := logging.FromContext(ctx)\n\n\tbytes, err := ingress.ComputeHash(ing)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to compute the hash of the Ingress: %w\", err)\n\t}\n\thash := fmt.Sprintf(\"%x\", bytes)\n\n\tif ready, ok := func() (bool, bool) {\n\t\tm.mu.Lock()\n\t\tdefer m.mu.Unlock()\n\t\tif state, ok := m.ingressStates[ingressKey]; ok {\n\t\t\tif state.hash == hash {\n\t\t\t\tstate.lastAccessed = time.Now()\n\t\t\t\treturn state.pendingCount.Load() == 0, true\n\t\t\t}\n\n\t\t\t// Cancel the polling for the outdated version\n\t\t\tstate.cancel()\n\t\t\tdelete(m.ingressStates, ingressKey)\n\t\t}\n\t\treturn false, false\n\t}(); ok {\n\t\treturn ready, nil\n\t}\n\n\tingCtx, cancel := context.WithCancel(context.Background())\n\tingressState := &ingressState{\n\t\thash: hash,\n\t\ting: ing,\n\t\tlastAccessed: time.Now(),\n\t\tcancel: cancel,\n\t}\n\n\t// Get the probe targets and group them by IP\n\ttargets, err := m.targetLister.ListProbeTargets(ctx, ing)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tworkItems := make(map[string][]*workItem)\n\tfor _, target := range targets {\n\t\tfor ip := range target.PodIPs {\n\t\t\tfor _, url := range target.URLs {\n\t\t\t\tworkItems[ip] = append(workItems[ip], &workItem{\n\t\t\t\t\tingressState: ingressState,\n\t\t\t\t\turl: url,\n\t\t\t\t\tpodIP: ip,\n\t\t\t\t\tpodPort: target.PodPort,\n\t\t\t\t\tlogger: logger,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tingressState.pendingCount.Store(int32(len(workItems)))\n\n\tfor ip, ipWorkItems := range workItems {\n\t\t// Get or create the context for that IP\n\t\tipCtx := func() context.Context {\n\t\t\tm.mu.Lock()\n\t\t\tdefer m.mu.Unlock()\n\t\t\tcancelCtx, ok := m.podContexts[ip]\n\t\t\tif !ok {\n\t\t\t\tctx, cancel := context.WithCancel(context.Background())\n\t\t\t\tcancelCtx = cancelContext{\n\t\t\t\t\tcontext: ctx,\n\t\t\t\t\tcancel: cancel,\n\t\t\t\t}\n\t\t\t\tm.podContexts[ip] = cancelCtx\n\t\t\t}\n\t\t\treturn cancelCtx.context\n\t\t}()\n\n\t\tpodCtx, cancel := context.WithCancel(ingCtx)\n\t\tpodState := &podState{\n\t\t\tpendingCount: *atomic.NewInt32(int32(len(ipWorkItems))),\n\t\t\tcancel: cancel,\n\t\t}\n\n\t\t// Quick and dirty way to join two contexts (i.e. podCtx is cancelled when either ingCtx or ipCtx are cancelled)\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-podCtx.Done():\n\t\t\t\t// This is the actual context, there is nothing to do except\n\t\t\t\t// break to avoid leaking this goroutine.\n\t\t\t\tbreak\n\t\t\tcase <-ipCtx.Done():\n\t\t\t\t// Cancel podCtx\n\t\t\t\tcancel()\n\t\t\t}\n\t\t}()\n\n\t\t// Update the states when probing is cancelled\n\t\tgo func() {\n\t\t\t<-podCtx.Done()\n\t\t\tm.onProbingCancellation(ingressState, podState)\n\t\t}()\n\n\t\tfor _, wi := range ipWorkItems {\n\t\t\twi.podState = podState\n\t\t\twi.context = podCtx\n\t\t\tm.workQueue.AddAfter(wi, initialDelay)\n\t\t\tlogger.Infof(\"Queuing probe for %s, IP: %s:%s (depth: %d)\",\n\t\t\t\twi.url, wi.podIP, wi.podPort, m.workQueue.Len())\n\t\t}\n\t}\n\n\tfunc() {\n\t\tm.mu.Lock()\n\t\tdefer m.mu.Unlock()\n\t\tm.ingressStates[ingressKey] = ingressState\n\t}()\n\treturn len(workItems) == 0, nil\n}",
"func (s *schedulerImpl) IsReady() bool {\n\treturn !s.cleanUpStaleCaptureStatus()\n}",
"func (c *Client) IsReady(data *pb.BackendData, opts ...interface{}) (bool, error) {\n\n\ttimeout := time.After(viper.GetDuration(\"server.backend-ready-timeout\"))\n\tticker := time.Tick(1000 * time.Millisecond)\n\n\ttimer := prometheus.NewTimer(metrics.BackendIsReadyDuration)\n\tdefer timer.ObserveDuration()\n\n\t// Keep trying until we're time out or get a result or get an error\n\tfor {\n\t\tselect {\n\t\t// Got a timeout! fail with a timeout error\n\t\tcase <-timeout:\n\t\t\tmetrics.BackendReadyTimeoutTotal.Inc()\n\t\t\treturn false, errors.New(\"timed out\")\n\t\t// Got a tick\n\t\tcase <-ticker:\n\t\t\tdeploymentIsReady := false\n\t\t\tserviceIsReady := false\n\n\t\t\tdeployment, err := c.getDeployment(data)\n\t\t\tif err != nil {\n\t\t\t\tmetrics.BackendReadyErrorTotal.WithLabelValues(\"deployment\").Inc()\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tfor _, dcondidtion := range deployment.Status.Conditions {\n\t\t\t\tif dcondidtion.Status == apiv1.ConditionFalse {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdeploymentIsReady = true\n\t\t\t}\n\n\t\t\tservice, err := c.getService(data)\n\t\t\tif err != nil {\n\t\t\t\tmetrics.BackendReadyErrorTotal.WithLabelValues(\"service\").Inc()\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tfor _, scondidtion := range service.Status.LoadBalancer.Ingress {\n\t\t\t\tif scondidtion.IP == \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tserviceIsReady = true\n\t\t\t}\n\n\t\t\tif deploymentIsReady && serviceIsReady {\n\t\t\t\tmetrics.BackendReadyTotal.WithLabelValues(\"deployment\", \"true\").Inc()\n\t\t\t\tmetrics.BackendReadyTotal.WithLabelValues(\"service\", \"true\").Inc()\n\t\t\t\treturn (deploymentIsReady && serviceIsReady), nil\n\t\t\t}\n\t\t}\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
OwnerAddress is a free data retrieval call binding the contract method 0x8f84aa09. Solidity: function ownerAddress() constant returns(address)
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) OwnerAddress(opts *bind.CallOpts) (common.Address, error) {
var (
ret0 = new(common.Address)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "ownerAddress")
return *ret0, err
}
|
[
"func (_MetaData *MetaDataCaller) Owner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _MetaData.contract.Call(opts, out, \"owner\")\n\treturn *ret0, err\n}",
"func minerOwnerAddress(ctx context.Context, st state.Tree, vms vm.StorageMap, minerAddr address.Address) (address.Address, error) {\n\tret, code, err := CallQueryMethod(ctx, st, vms, minerAddr, \"getOwner\", []byte{}, address.Undef, types.NewBlockHeight(0))\n\tif err != nil {\n\t\treturn address.Undef, errors.FaultErrorWrap(err, \"could not get miner owner\")\n\t}\n\tif code != 0 {\n\t\treturn address.Undef, errors.NewFaultErrorf(\"could not get miner owner. error code %d\", code)\n\t}\n\treturn address.NewFromBytes(ret[0])\n}",
"func (c *Deed) Owner() (common.Address, error) {\n\treturn c.Contract.Owner(nil)\n}",
"func (_OrgsData *OrgsDataCaller) GetOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _OrgsData.contract.Call(opts, out, \"getOwner\")\n\treturn *ret0, err\n}",
"func (_Manager *ManagerCaller) GetOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Manager.contract.Call(opts, out, \"getOwner\")\n\treturn *ret0, err\n}",
"func (_Oasis *Oasis) GetOwner(opts *bind.CallOpts, id *big.Int) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Oasis.Call(opts, out, \"getOwner\", id)\n\treturn *ret0, err\n}",
"func (_NFToken *NFTokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _NFToken.Contract.OwnerOf(&_NFToken.CallOpts, _tokenId)\n}",
"func (_BalanceSheet *BalanceSheetCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BalanceSheet.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (_Owned *OwnedCaller) WhoIsTheOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Owned.contract.Call(opts, out, \"whoIsTheOwner\")\n\treturn *ret0, err\n}",
"func (_Token *TokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _Token.Contract.OwnerOf(&_Token.CallOpts, _tokenId)\n}",
"func (_Mortal *MortalCaller) WhoIsTheOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Mortal.contract.Call(opts, out, \"whoIsTheOwner\")\n\treturn *ret0, err\n}",
"func (_BattleGroups *BattleGroupsCallerSession) OwnerOf(_groupID *big.Int) (common.Address, error) {\n\treturn _BattleGroups.Contract.OwnerOf(&_BattleGroups.CallOpts, _groupID)\n}",
"func (_BurnableToken *BurnableTokenCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BurnableToken.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (_CrossEther *CrossEtherTransactor) OwnerSetErc20Addr(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) {\n\treturn _CrossEther.contract.Transact(opts, \"ownerSetErc20Addr\", addr)\n}",
"func (_CrossEther *CrossEtherSession) OwnerSetErc20Addr(addr common.Address) (*types.Transaction, error) {\n\treturn _CrossEther.Contract.OwnerSetErc20Addr(&_CrossEther.TransactOpts, addr)\n}",
"func (_Registry *RegistryCaller) Ownership(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Registry.contract.Call(opts, out, \"ownership\", arg0)\n\treturn *ret0, err\n}",
"func (_Asset *AssetCaller) Address(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"Address\")\n\treturn *ret0, err\n}",
"func (_BattleGroups *BattleGroupsSession) OwnerOf(_groupID *big.Int) (common.Address, error) {\n\treturn _BattleGroups.Contract.OwnerOf(&_BattleGroups.CallOpts, _groupID)\n}",
"func (_Wrapper *WrapperCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Wrapper.contract.Call(opts, out, \"newOwner\")\n\treturn *ret0, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RequireCardExists is a free data retrieval call binding the contract method 0x30259720. Solidity: function requireCardExists(cardID uint256) constant returns()
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) RequireCardExists(opts *bind.CallOpts, cardID *big.Int) error {
var ()
out := &[]interface{}{}
err := _CryptoCardsCore.contract.Call(opts, out, "requireCardExists", cardID)
return err
}
|
[
"func (_CardMinting *CardMintingCaller) RequireCardExists(opts *bind.CallOpts, cardID *big.Int) error {\n\tvar ()\n\tout := &[]interface{}{}\n\terr := _CardMinting.contract.Call(opts, out, \"requireCardExists\", cardID)\n\treturn err\n}",
"func (c *Client) HasCard() (existingCards bool, returnErr error) {\n\tif c.StripeUser == nil {\n\t\treturn\n\t}\n\tif err := c.get(meURL, true, c); err != nil {\n\t\treturnErr = errors.Wrap(err, \"error updating stripe details\")\n\t}\n\texistingCards = len(c.StripeUser.Cards) != 0\n\treturn\n}",
"func (o *DeductLoyaltyPointsEffectProps) HasCardIdentifier() bool {\n\tif o != nil && o.CardIdentifier != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}",
"func (_NFToken *NFTokenCaller) Exists(opts *bind.CallOpts, _tokenId *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _NFToken.contract.Call(opts, out, \"exists\", _tokenId)\n\treturn *ret0, err\n}",
"func (c *Client) GetCard(cardNo string, pin string) (*Card, *Response, error) {\n\tcard := &Card{}\n\tresponse := &Response{}\n\tvar err error\n\tencryptedPin, err := encryptPinWithPublicKey(pin, c.publicKey)\n\tif err != nil {\n\t\treturn card, response, err\n\t}\n\n\tco := colly.NewCollector()\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblMembershipNumber\", func(e *colly.HTMLElement) {\n\t\tcard.CardNo = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblAccountNumber\", func(e *colly.HTMLElement) {\n\t\tcard.AccountNo = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblcardvalue\", func(e *colly.HTMLElement) {\n\t\tcard.LoadsToDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblpurchasestodate\", func(e *colly.HTMLElement) {\n\t\tcard.PurchasesToDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblavailablebalance\", func(e *colly.HTMLElement) {\n\t\tcard.AvailableBalance = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblCardPurchasedDate\", func(e *colly.HTMLElement) {\n\t\tcard.PurchasedDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#ctl00_DefaultContent_lblCardExpiryDate\", func(e *colly.HTMLElement) {\n\t\tcard.ExpiryDate = strings.TrimSpace(e.Text)\n\t})\n\n\tco.OnHTML(\"#htmltdErrorDescription\", func(e *colly.HTMLElement) {\n\t\terr = errors.New(e.Text)\n\t\tresponse.StatusCode = http.StatusUnauthorized\n\t})\n\n\tco.OnHTML(\".content-error h3\", func(e *colly.HTMLElement) {\n\t\terr = errors.New(\"internal server error\")\n\t\tresponse.StatusCode = http.StatusInternalServerError\n\t})\n\n\tco.OnHTML(\"#dgPointsStatement tbody\", func(e *colly.HTMLElement) {\n\t\te.ForEach(\"tr\", func(i int, el *colly.HTMLElement) {\n\t\t\t// skip title row\n\t\t\tif i == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttransaction := Transaction{\n\t\t\t\tDate: strings.TrimSpace(el.ChildText(\"td:nth-of-type(1)\")),\n\t\t\t\tDetails: strings.TrimSpace(el.ChildText(\"td:nth-of-type(2)\")),\n\t\t\t\tDescription: strings.TrimSpace(el.ChildText(\"td:nth-of-type(3)\")),\n\t\t\t\tAmount: strings.TrimSpace(el.ChildText(\"td:nth-of-type(4)\")),\n\t\t\t\tBalance: strings.TrimSpace(el.ChildText(\"td:nth-of-type(5)\")),\n\t\t\t}\n\t\t\tcard.Transactions = append(card.Transactions, transaction)\n\t\t})\n\t})\n\n\tco.OnResponse(func(r *colly.Response) {\n\t\tresponse = &Response{Response: r}\n\t})\n\n\tco.OnError(func(r *colly.Response, e error) {\n\t\terr = e\n\t\tresponse.Response = r\n\t})\n\n\tbody[\"txtCardNumber\"] = cardNo\n\tbody[\"hdnrequest\"] = fmt.Sprintf(\"%x\", encryptedPin)\n\tco.Post(c.BaseURL.String(), body)\n\treturn card, response, err\n}",
"func (_RootChain *RootChainCaller) ChallengeExists(opts *bind.CallOptsWithNumber, uid *big.Int, challengeTx []byte) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _RootChain.contract.CallWithNumber(opts, out, \"challengeExists\", uid, challengeTx)\n\treturn *ret0, err\n}",
"func (_Accountregistry *AccountregistryCaller) Exists(opts *bind.CallOpts, pubkeyID *big.Int, pubkey [4]*big.Int, witness [31][32]byte) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _Accountregistry.contract.Call(opts, out, \"exists\", pubkeyID, pubkey, witness)\n\treturn *ret0, err\n}",
"func (_CivilTCRContract *CivilTCRContractCaller) ChallengeExists(opts *bind.CallOpts, listingAddress common.Address) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _CivilTCRContract.contract.Call(opts, out, \"challengeExists\", listingAddress)\n\treturn *ret0, err\n}",
"func (lc *cachedLayerService) Exists(dgst digest.Digest) (bool, error) {\n\tctxu.GetLogger(lc.ctx).Debugf(\"(*cachedLayerService).Exists(%q)\", dgst)\n\tnow := time.Now()\n\tdefer func() {\n\t\t// TODO(stevvooe): Replace this with a decent context-based metrics solution\n\t\tctxu.GetLoggerWithField(lc.ctx, \"blob.exists.duration\", time.Since(now)).\n\t\t\tInfof(\"(*cachedLayerService).Exists(%q)\", dgst)\n\t}()\n\n\tatomic.AddUint64(&layerInfoCacheMetrics.Exists.Requests, 1)\n\tavailable, err := lc.cache.Contains(lc.ctx, lc.repository.Name(), dgst)\n\tif err != nil {\n\t\tctxu.GetLogger(lc.ctx).Errorf(\"error checking availability of %v@%v: %v\", lc.repository.Name(), dgst, err)\n\t\tgoto fallback\n\t}\n\n\tif available {\n\t\tatomic.AddUint64(&layerInfoCacheMetrics.Exists.Hits, 1)\n\t\treturn true, nil\n\t}\n\nfallback:\n\tatomic.AddUint64(&layerInfoCacheMetrics.Exists.Misses, 1)\n\texists, err := lc.LayerService.Exists(dgst)\n\tif err != nil {\n\t\treturn exists, err\n\t}\n\n\tif exists {\n\t\t// we can only cache this if the existence is positive.\n\t\tif err := lc.cache.Add(lc.ctx, lc.repository.Name(), dgst); err != nil {\n\t\t\tctxu.GetLogger(lc.ctx).Errorf(\"error adding %v@%v to cache: %v\", lc.repository.Name(), dgst, err)\n\t\t}\n\t}\n\n\treturn exists, err\n}",
"func (_NFToken *NFTokenCallerSession) Exists(_tokenId *big.Int) (bool, error) {\n\treturn _NFToken.Contract.Exists(&_NFToken.CallOpts, _tokenId)\n}",
"func (m *DeviceTokenMockup) Exist(deviceID string, tokenID string) (*bool, derrors.Error) {\n\tm.Lock()\n\tdefer m.Unlock()\n\t_, ok := m.data[m.generateID(deviceID, tokenID)]\n\treturn &ok, nil\n}",
"func (_Accountregistry *AccountregistryCallerSession) Exists(pubkeyID *big.Int, pubkey [4]*big.Int, witness [31][32]byte) (bool, error) {\n\treturn _Accountregistry.Contract.Exists(&_Accountregistry.CallOpts, pubkeyID, pubkey, witness)\n}",
"func (client *HearthstoneAPI) SearchCard(id string) *Card {\n\tsearch := client.newCardSearch(id)\n\n\tif output, ok := client.execute(&search).(Card); ok {\n\t\tif output.Error.Status != 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\tif output.Collectible == 1 {\n\t\t\treturn &output\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (_Node *NodeCaller) RecordExists(opts *bind.CallOpts, digest [32]byte) (bool, error) {\n\tvar out []interface{}\n\terr := _Node.contract.Call(opts, &out, \"recordExists\", digest)\n\n\tif err != nil {\n\t\treturn *new(bool), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(bool)).(*bool)\n\n\treturn out0, err\n\n}",
"func (o *DeductLoyaltyPointsEffectProps) GetCardIdentifierOk() (string, bool) {\n\tif o == nil || o.CardIdentifier == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.CardIdentifier, true\n}",
"func (bankRepo *BankGormRepo) BankExists(acc string) bool {\n\tbank := entity.Bank{}\n\terrs := bankRepo.conn.Find(&bank, \"account_no=?\", acc).GetErrors()\n\tif len(errs) > 0 {\n\t\treturn false\n\t}\n\treturn true\n}",
"func (_Node *NodeCallerSession) RecordExists(digest [32]byte) (bool, error) {\n\treturn _Node.Contract.RecordExists(&_Node.CallOpts, digest)\n}",
"func CheckCard(card *models.Card) (exists bool, err error) {\n\n\tquery := `SELECT EXISTS(\n\t\tSELECT\n\t\t\t(1)\n\t\tFROM\n\t\t\twords\n\t\tWHERE\n\t\t\tid = ` + strconv.Itoa(card.ID) + ` and\n\t\t\tword = '` + card.Word + `' and\n\t\t\tmeaning = '` + card.Meaning + `');`\n\n\trows, err := db.Query(query)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfor rows.Next() {\n\t\terr = rows.Scan(&exists)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) IsReadyForBattle(opts *bind.CallOpts, _cardID *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"isReadyForBattle\", _cardID)\n\treturn *ret0, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
TokensOfOwner is a free data retrieval call binding the contract method 0x8462151c. Solidity: function tokensOfOwner(_owner address) constant returns(ownerTokens uint256[])
|
func (_CryptoCardsCore *CryptoCardsCoreCaller) TokensOfOwner(opts *bind.CallOpts, _owner common.Address) ([]*big.Int, error) {
var (
ret0 = new([]*big.Int)
)
out := ret0
err := _CryptoCardsCore.contract.Call(opts, out, "tokensOfOwner", _owner)
return *ret0, err
}
|
[
"func (_ZBGCard *ZBGCardCaller) TokensOwned(opts *bind.CallOpts, _owner common.Address) (struct {\n\tIndexes []*big.Int\n\tBalances []*big.Int\n}, error) {\n\tret := new(struct {\n\t\tIndexes []*big.Int\n\t\tBalances []*big.Int\n\t})\n\tout := ret\n\terr := _ZBGCard.contract.Call(opts, out, \"tokensOwned\", _owner)\n\treturn *ret, err\n}",
"func (_ZBGCard *ZBGCardCallerSession) TokensOwned(_owner common.Address) (struct {\n\tIndexes []*big.Int\n\tBalances []*big.Int\n}, error) {\n\treturn _ZBGCard.Contract.TokensOwned(&_ZBGCard.CallOpts, _owner)\n}",
"func (_NFToken *NFTokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _NFToken.Contract.OwnerOf(&_NFToken.CallOpts, _tokenId)\n}",
"func TokenOwner(hToken windows.Token) (string, error) {\n\ttokenUser, err := hToken.GetTokenUser()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"could not get token user\")\n\t}\n\tu, d, _, err := tokenUser.User.Sid.LookupAccount(\"\")\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"could not find SID for user\")\n\t}\n\treturn fmt.Sprintf(`%s\\%s`, d, u), err\n}",
"func (t *Token) Owner() sdk.IAccount {\n\treturn t.smc.Helper().AccountHelper().AccountOf(t.tk.Owner)\n}",
"func (_Token *TokenSession) OwnerOf(_tokenId *big.Int) (common.Address, error) {\n\treturn _Token.Contract.OwnerOf(&_Token.CallOpts, _tokenId)\n}",
"func KeyOwner(address sdk.AccAddress, classID, tokenID string) []byte {\n\tkey := append(PrefixOwners, delimiter...)\n\tif address != nil {\n\t\tkey = append(key, []byte(address.String())...)\n\t\tkey = append(key, delimiter...)\n\t}\n\n\tif address != nil && len(classID) > 0 {\n\t\tkey = append(key, []byte(classID)...)\n\t\tkey = append(key, delimiter...)\n\t}\n\n\tif address != nil && len(classID) > 0 && len(tokenID) > 0 {\n\t\tkey = append(key, []byte(tokenID)...)\n\t}\n\treturn key\n}",
"func (t *Tokens) Owner(tokenValue string) string {\n\ti, exists := t.Exists(tokenValue)\n\tif exists {\n\t\treturn t.tokens[i].userName\n\t}\n\treturn \"\"\n}",
"func (k Keeper) GetUserTokenPairs(ctx sdk.Context, owner sdk.AccAddress) (tokenPairs []*types.TokenPair) {\n\tstore := ctx.KVStore(k.tokenPairStoreKey)\n\tuserTokenPairPrefix := types.GetUserTokenPairAddressPrefix(owner)\n\tprefixLen := len(userTokenPairPrefix)\n\n\titer := sdk.KVStorePrefixIterator(store, userTokenPairPrefix)\n\tdefer iter.Close()\n\n\tfor ; iter.Valid(); iter.Next() {\n\t\tkey := iter.Key()\n\t\ttokenPairName := string(key[prefixLen:])\n\n\t\ttokenPair := k.GetTokenPairFromStore(ctx, tokenPairName)\n\t\tif tokenPair != nil {\n\t\t\ttokenPairs = append(tokenPairs, tokenPair)\n\t\t}\n\t}\n\n\treturn tokenPairs\n}",
"func GetOwnerKey(address sdk.AccAddress, denom string) []byte {\n\th := tmhash.New()\n\t_, err := h.Write([]byte(denom))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tbs := h.Sum(nil)\n\n\treturn append(GetOwnersKey(address), bs...)\n}",
"func (_BurnableToken *BurnableTokenCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _BurnableToken.contract.Call(opts, out, \"pendingOwner\")\n\treturn *ret0, err\n}",
"func (c *Client) WalletToken(usage string, owner *[ed25519.PublicKeySize]byte) (tokenHash []byte, err error) {\n\tnewToken, params, pubkeyUsed, err := c.getTokenFromWallet(usage)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Cache token, params\n\ttokenUnmarshalled, err := token.Unmarshal(newToken)\n\tif err != nil {\n\t\tc.LastError = err\n\t\treturn nil, ErrFatal\n\t}\n\t// Parse pubkeyUsed and add to keypool\n\tsignerPubKey, err := new(signkeys.PublicKey).Unmarshal(pubkeyUsed)\n\tif err != nil {\n\t\tc.LastError = err\n\t\treturn nil, ErrFatal\n\t}\n\tkeyid, err := c.packetClient.Keypool.LoadKey(signerPubKey)\n\tif err != nil && err != keypool.ErrExists {\n\t\tc.LastError = err\n\t\treturn nil, ErrFatal\n\t}\n\tc.packetClient.Keypool.SaveKey(*keyid)\n\t// If we have params this is not renewable\n\trenewable := false\n\tif params == nil || len(params) == 0 {\n\t\trenewable = true\n\t} else {\n\t\t// Unless the params state otherwise....\n\t\t_, _, _, canReissue, err := types.UnmarshalParams(params)\n\t\tif err != nil {\n\t\t\tc.LastError = err\n\t\t\treturn nil, ErrFatal\n\t\t}\n\t\tif canReissue {\n\t\t\trenewable = true\n\t\t}\n\t}\n\t//tokenUnmarshalled.KeyID\n\townerPubkey, ownerPrivkey := splitKey(c.walletKey)\n\t// Set tokenentry struct for storage\n\ttokenentry := TokenEntry{\n\t\tHash: tokenUnmarshalled.Hash(),\n\t\tToken: newToken,\n\t\tParams: params,\n\t\tOwnerPubKey: ownerPubkey,\n\t\tOwnerPrivKey: ownerPrivkey,\n\t\tRenewable: renewable,\n\t\tCanReissue: true,\n\t\tUsage: signerPubKey.Usage,\n\t\tExpire: signerPubKey.Expire,\n\t}\n\terr = c.walletStore.SetToken(tokenentry) // Cache current state\n\tif err != nil {\n\t\tc.LastError = err\n\t\treturn nil, ErrFatal\n\t}\n\tif owner == nil && renewable == false {\n\t\treturn tokenentry.Hash, ErrNeedReissue\n\t}\n\t// Reissue\n\treturn c.ReissueToken(tokenentry.Hash, owner)\n}",
"func (s *AccountService) GetTokenBalancesProvidor(owner common.Address) (map[common.Address]*types.TokenBalance, error) {\n\treturn s.AccountDao.GetTokenBalances(owner)\n}",
"func (r *API) GetTokenTokenNetorks() (tokens []string) {\n\ttokenMap, err := r.Photon.dao.GetAllTokens()\n\tif err != nil {\n\t\tlog.Error(fmt.Sprintf(\"GetAllTokens err %s\", err))\n\t}\n\tfor k := range tokenMap {\n\t\ttokens = append(tokens, k.String())\n\t}\n\treturn\n}",
"func (d *Dao) Tokens(c context.Context, mid int64) (res []string, err error) {\n\tvar rows *xsql.Rows\n\tif rows, err = d.cloudDB.Query(c, _getTokensSQL, mid); err != nil {\n\t\tlog.Error(\"failed to get tokens, dao.cloudDB.Tokens(%s) error(%v)\", _getTokensSQL, err)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar at string\n\t\tif err = rows.Scan(&at); err != nil {\n\t\t\tlog.Error(\"row.Scan() error(%v)\", err)\n\t\t\tres = nil\n\t\t\treturn\n\t\t}\n\t\tres = append(res, at)\n\t}\n\treturn\n}",
"func getOwnerRefs(obj runtime.Object) ([]string, error) {\n\tif unstructured, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj); err != nil {\n\t\treturn nil, err\n\t} else {\n\t\tif m, ok := unstructured[\"metadata\"]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"no metadata in passed object\")\n\t\t} else {\n\t\t\tmetadata, ok := m.(map[string]interface{})\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected metadata structure\")\n\t\t\t}\n\t\t\tif ownerRefs, ok := metadata[\"ownerReferences\"]; !ok {\n\t\t\t\t// no owner refs\n\t\t\t\treturn []string{}, nil\n\t\t\t} else {\n\t\t\t\tvar uids []string\n\t\t\t\tfor _, ref := range ownerRefs.([]interface{}) {\n\t\t\t\t\tuid := ref.(map[string]interface{})[\"uid\"]\n\t\t\t\t\tuids = append(uids, uid.(string))\n\t\t\t\t}\n\t\t\t\treturn uids, nil\n\t\t\t}\n\t\t}\n\t}\n}",
"func OwnerGTE(v string) predicate.Account {\n\treturn predicate.Account(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldOwner), v))\n\t})\n}",
"func (m *ServicePrincipal) GetOwners()([]DirectoryObjectable) {\n val, err := m.GetBackingStore().Get(\"owners\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]DirectoryObjectable)\n }\n return nil\n}",
"func SplitKeyOwner(key []byte) (address sdk.AccAddress, classID, tokenID string, err error) {\n\tkey = key[len(PrefixOwners)+len(delimiter):]\n\tkeys := bytes.Split(key, delimiter)\n\tif len(keys) != 3 {\n\t\treturn address, classID, tokenID, errors.New(\"wrong KeyOwner\")\n\t}\n\n\taddress, _ = sdk.AccAddressFromBech32(string(keys[0]))\n\tclassID = string(keys[1])\n\ttokenID = string(keys[2])\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateCard is a paid mutator transaction binding the contract method 0x5de038b1. Solidity: function createCard(_owner address, _attributes uint256) returns(uint256)
|
func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {
return _CryptoCardsCore.contract.Transact(opts, "createCard", _owner, _attributes)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)\n}",
"func (s *csServer) Create(ctx context.Context, c *cs.Card) (*cs.Card, error) {\n\n\ttx, err := s.db.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuid, err := tx.CreateCard(c)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\ttx.Rollback()\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\tc.Id = uid\n\n\tlog.Printf(\"created card: %+v\\n\", c)\n\treturn c, nil\n}",
"func (m *MoonpayCustomer) CreateCard(tokenid uuid.UUID) (card Card, err error) {\n\ttype data struct {\n\t\tTokenID uuid.UUID `json:\"tokenId\"`\n\t}\n\tresp, err := req.Post(m.url(\"/cards\"), m.authHeader(), req.BodyJSON(data{tokenid}))\n\tif err := m.handleError(resp, err); err != nil {\n\t\treturn card, err\n\t}\n\n\terr = resp.ToJSON(&card)\n\treturn\n}",
"func (p *Prettycards) Create(ownerId int, photo string, title string, link string, price string, priceOld string, button string) (resp responses.PrettycardsCreate, err error) {\n\tparams := map[string]interface{}{}\n\n\tparams[\"owner_id\"] = ownerId\n\n\tparams[\"photo\"] = photo\n\n\tparams[\"title\"] = title\n\n\tparams[\"link\"] = link\n\n\tif price != \"\" {\n\t\tparams[\"price\"] = price\n\t}\n\n\tif priceOld != \"\" {\n\t\tparams[\"price_old\"] = priceOld\n\t}\n\n\tif button != \"\" {\n\t\tparams[\"button\"] = button\n\t}\n\n\terr = p.SendObjRequest(\"prettyCards.create\", params, &resp)\n\n\treturn\n}",
"func (tx *Tx) CreateCard(c *cs.Card) (string, error) {\n\n\tif c == nil {\n\t\treturn \"\", errors.New(\"card required\")\n\t} else if c.Title == \"\" {\n\t\treturn \"\", errors.New(\"card.Title required\")\n\t}\n\n\tstmt, err := tx.Prepare(\"INSERT cards SET uid=?, title=?\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tid, _ := uid.NextStringID()\n\t_, err = stmt.Exec(id, c.Title)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn id, err\n}",
"func (c TokenContract) Create(issuer string, maxSupply string) {\n\tc.PushAction(\n\t\t\"create\",\n\t\tmap[string]interface{}{\n\t\t\t\"issuer\": issuer,\n\t\t\t\"maximum_supply\": maxSupply,\n\t\t},\n\t\t&Permission{\n\t\t\tActor: c.Account.Name,\n\t\t\tLevel: \"active\",\n\t\t},\n\t)\n}",
"func CreateCard(db *sql.DB, card model.Card) error {\n\tquery := \"INSERT INTO `card` (`user_id`, `name`, `status`, `content`, `category`) VALUES (?, ?, ?, ?, ?)\"\n\tresult, err := db.Exec(query, card.UserID, card.Name, card.Status, card.Content, card.Category)\n\n\tif err != nil {\n\t\tzap.S().Info(\"CreateCard insert error \", err)\n\t\treturn err\n\t}\n\n\trowEffect, _ := result.RowsAffected()\n\tif rowEffect == 0 {\n\t\tzap.S().Info(\"CreateCard insert error \", err)\n\t\treturn errors.New(\"Create Card Error\")\n\t}\n\n\treturn nil\n}",
"func (c *Producer) create(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\n\t// if len(args) != 3 {\n\t// \treturn shim.Error(\"create arguments usage: Serialnumber, Serie, Others\")\n\t// }\n\n\t// // A newly created computer is available\n\t// pc := PC{args[0], args[1], args[2], \"available\"}\n\n\t// // Use JSON to store in the Blockchain\n\t// pcAsBytes, err := json.Marshal(pc)\n\n\t// if err != nil {\n\t// \treturn shim.Error(err.Error())\n\t// }\n\n\t// // Use serial number as key\n\t// err = stub.PutState(pc.Snumber, pcAsBytes)\n\n\t// if err != nil {\n\t// \treturn shim.Error(err.Error())\n\t// }\n\treturn shim.Success(nil)\n}",
"func (s *Service) createCardHandler(w http.ResponseWriter, r *http.Request) {\n\t// Get the authenticated user from the request context\n\tauthenticatedUser, err := accounts.GetAuthenticatedUser(r)\n\tif err != nil {\n\t\tresponse.UnauthorizedError(w, err.Error())\n\t\treturn\n\t}\n\n\t// Request body cannot be nil\n\tif r.Body == nil {\n\t\tresponse.Error(w, \"Request body cannot be nil\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Read the request body\n\tpayload, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tresponse.Error(w, \"Error reading request body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Unmarshal the request body into the request prototype\n\tcardRequest := new(CardRequest)\n\tif err := json.Unmarshal(payload, cardRequest); err != nil {\n\t\tlogger.ERROR.Printf(\"Failed to unmarshal card request: %s\", payload)\n\t\tresponse.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Create a new card\n\tcard, err := s.createCard(authenticatedUser, cardRequest)\n\tif err != nil {\n\t\tlogger.ERROR.Printf(\"Create card error: %s\", err)\n\t\tresponse.Error(w, err.Error(), getErrStatusCode(err))\n\t\treturn\n\t}\n\n\t// Create response\n\tcardResponse, err := NewCardResponse(card)\n\tif err != nil {\n\t\tresponse.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// Set Location header to the newly created resource\n\tw.Header().Set(\"Location\", fmt.Sprintf(\"/v1/cards/%d\", card.ID))\n\t// Write JSON response\n\tresponse.WriteJSON(w, cardResponse, http.StatusCreated)\n}",
"func (_DisputeGameFactory *DisputeGameFactoryTransactor) Create(opts *bind.TransactOpts, _gameType uint8, _rootClaim [32]byte, _extraData []byte) (*types.Transaction, error) {\n\treturn _DisputeGameFactory.contract.Transact(opts, \"create\", _gameType, _rootClaim, _extraData)\n}",
"func (a *AccountApiService) CreateCreditCard(ctx _context.Context) ApiCreateCreditCardRequest {\n\treturn ApiCreateCreditCardRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func MsgCardCreate(conn net.Conn, msg *message.Msg) {\n\tcard := &Card{\n\t\t0,\n\t\t*msg.Cards.Name,\n\t\t*msg.Cards.Desc,\n\t\t*msg.Cards.ColumnId,\n\t\t*msg.Cards.ProjectId,\n\t\tmsg.Cards.Tags,\n\t\t*msg.Cards.UserId,\n\t\tmsg.Cards.ScriptsIds,\n\t\tmsg.Cards.Write,\n\t}\n\tvar answer *message.Msg\n\tproj := &Project{\n\t\tId: *msg.Cards.ProjectId,\n\t}\n\tif adm, err := proj.IsAdmin(dbPool, *msg.AuthorId); adm == false || err != nil {\n\t\tanswer = &message.Msg{\n\t\t\tTarget: message.TARGET_CARDS.Enum(),\n\t\t\tCommand: message.CMD_ERROR.Enum(),\n\t\t\tAuthorId: proto.Uint32(*msg.AuthorId),\n\t\t\tSessionId: proto.String(*msg.SessionId),\n\t\t\tError: &message.Msg_Error{\n\t\t\t\tErrorId: proto.Uint32(2), // remplacer par le vrai code d'erreur ici\n\t\t\t},\n\t\t}\n\t} else if err := card.Add(dbPool); err != nil {\n\t\t// Envoyer un message d'erreur ici\n\t\tanswer = &message.Msg{\n\t\t\tTarget: message.TARGET_CARDS.Enum(),\n\t\t\tCommand: message.CMD_ERROR.Enum(),\n\t\t\tAuthorId: proto.Uint32(*msg.AuthorId),\n\t\t\tSessionId: proto.String(*msg.SessionId),\n\t\t\tError: &message.Msg_Error{\n\t\t\t\tErrorId: proto.Uint32(5), // remplacer par le vrai code d'erreur ici\n\t\t\t},\n\t\t}\n\t} else {\n\t\tcard.GetLastCardWithName(dbPool)\n\t\tprintln(card.Id)\n\t\t*msg.Cards.Id = card.Id\n\t\t// Envoyer un message de succes ici\n\t\tanswer = &message.Msg{\n\t\t\tTarget: message.TARGET_CARDS.Enum(),\n\t\t\tCommand: message.CMD_SUCCES.Enum(),\n\t\t\tAuthorId: proto.Uint32(*msg.AuthorId),\n\t\t\tSessionId: proto.String(*msg.SessionId),\n\t\t\tCards: &message.Msg_Cards{\n\t\t\t\tId: proto.Uint32(card.Id),\n\t\t\t\tProjectId: proto.Uint32(card.Project_id),\n\t\t\t\tColumnId: proto.Uint32(card.Column_id),\n\t\t\t\tName: proto.String(card.Name),\n\t\t\t\tDesc: proto.String(card.Content),\n\t\t\t\tTags: card.Tags,\n\t\t\t\tUserId: proto.Uint32(card.User_id),\n\t\t\t\tScriptsIds: card.Scripts_id,\n\t\t\t\tWrite: card.Write,\n\t\t\t},\n\t\t}\n\t\tnotifyUsers(msg)\n\t}\n\tsendKanbanMsg(conn, answer)\n}",
"func (_MultiSigWalletFactoryContract *MultiSigWalletFactoryContractTransactor) Create(opts *bind.TransactOpts, _owners []common.Address, _required *big.Int) (*types.Transaction, error) {\n\treturn _MultiSigWalletFactoryContract.contract.Transact(opts, \"create\", _owners, _required)\n}",
"func (_CardMinting *CardMintingTransactorSession) CreateGen0Card() (*types.Transaction, error) {\n\treturn _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)\n}",
"func (_CardMinting *CardMintingSession) CreateGen0Card() (*types.Transaction, error) {\n\treturn _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCard(rank, suit, color string, rv, sv int, up bool) Card {\n\treturn Card{\n\t\tRank: rank,\n\t\tSuit: suit,\n\t\tColor: color,\n\t\tRvalue: rv,\n\t\tSvalue: sv,\n\t\tFaceup: up,\n\t}\n}",
"func contractCreateStandardAccount(ic *interop.Context) error {\n\th := ic.VM.Estack().Pop().Bytes()\n\tp, err := keys.NewPublicKeyFromBytes(h, elliptic.P256())\n\tif err != nil {\n\t\treturn err\n\t}\n\tic.VM.Estack().PushItem(stackitem.NewByteArray(p.GetScriptHash().BytesBE()))\n\treturn nil\n}",
"func (s *SmartContract) CreatePrivateCar(ctx contractapi.TransactionContextInterface, args []string) (string, error) {\n\n\ttype carTransientInput struct {\n\t\tMake string `json:\"make\"` //the fieldtags are needed to keep case from bouncing around\n\t\tModel string `json:\"model\"`\n\t\tColor string `json:\"color\"`\n\t\tOwner string `json:\"owner\"`\n\t\tPrice string `json:\"price\"`\n\t\tKey string `json:\"key\"`\n\t}\n\n\tif len(args) != 0 {\n\t\treturn \" Error \", fmt.Errorf(\"Incorrect number of arguments. Private marble data must be passed in transient map\")\n\t}\n\n\ttransMap, err := ctx.GetStub().GetTransient()\n\n\tif err != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Get Transient State Error\")\n\t}\n\n\tcarDataAsBytes, _ := transMap[\"car\"]\n\n\tvar carInput carTransientInput\n\t_ = json.Unmarshal(carDataAsBytes, &carInput)\n\n\tcarAsBytes, err := ctx.GetStub().GetPrivateData(\"collectionCars\", carInput.Key)\n\n\tif err != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Get Private Data Collection Error\")\n\t} else if carAsBytes != nil {\n\t\treturn \"Car Key already exists in priavte data \", fmt.Errorf(\"Already Exists. %s\", carInput.Key)\n\t}\n\n\tvar car = Car{Make: carInput.Make, Model: carInput.Model, Colour: carInput.Color, Owner: carInput.Owner}\n\n\tcarAsBytes, err = json.Marshal(car)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprivateDataStatus := ctx.GetStub().PutPrivateData(\"collectionCars\", carInput.Key, carAsBytes)\n\n\tif privateDataStatus != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Put Private Data Collection Error %s\", privateDataStatus.Error())\n\t}\n\n\tcarPrivateDetails := &carPrivateDetails{Owner: carInput.Owner, Price: carInput.Price}\n\n\tcarPrivateDetailsAsBytes, err := json.Marshal(carPrivateDetails)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprivateCollectionStatus := ctx.GetStub().PutPrivateData(\"collectionCarPrivateDetails\", carInput.Key, carPrivateDetailsAsBytes)\n\n\tif privateCollectionStatus != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Put Private Data Collection Error %s\", privateCollectionStatus.Error())\n\t}\n\n\treturn \"Private Car Data Added Successfully\", nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateCard is a paid mutator transaction binding the contract method 0x5de038b1. Solidity: function createCard(_owner address, _attributes uint256) returns(uint256)
|
func (_CryptoCardsCore *CryptoCardsCoreTransactorSession) CreateCard(_owner common.Address, _attributes *big.Int) (*types.Transaction, error) {
return _CryptoCardsCore.Contract.CreateCard(&_CryptoCardsCore.TransactOpts, _owner, _attributes)
}
|
[
"func (_CryptoCardsCore *CryptoCardsCoreTransactor) CreateCard(opts *bind.TransactOpts, _owner common.Address, _attributes *big.Int) (*types.Transaction, error) {\n\treturn _CryptoCardsCore.contract.Transact(opts, \"createCard\", _owner, _attributes)\n}",
"func (s *csServer) Create(ctx context.Context, c *cs.Card) (*cs.Card, error) {\n\n\ttx, err := s.db.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuid, err := tx.CreateCard(c)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\ttx.Rollback()\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, grpc.Errorf(codes.Unknown, err.Error())\n\t}\n\n\tc.Id = uid\n\n\tlog.Printf(\"created card: %+v\\n\", c)\n\treturn c, nil\n}",
"func (m *MoonpayCustomer) CreateCard(tokenid uuid.UUID) (card Card, err error) {\n\ttype data struct {\n\t\tTokenID uuid.UUID `json:\"tokenId\"`\n\t}\n\tresp, err := req.Post(m.url(\"/cards\"), m.authHeader(), req.BodyJSON(data{tokenid}))\n\tif err := m.handleError(resp, err); err != nil {\n\t\treturn card, err\n\t}\n\n\terr = resp.ToJSON(&card)\n\treturn\n}",
"func (p *Prettycards) Create(ownerId int, photo string, title string, link string, price string, priceOld string, button string) (resp responses.PrettycardsCreate, err error) {\n\tparams := map[string]interface{}{}\n\n\tparams[\"owner_id\"] = ownerId\n\n\tparams[\"photo\"] = photo\n\n\tparams[\"title\"] = title\n\n\tparams[\"link\"] = link\n\n\tif price != \"\" {\n\t\tparams[\"price\"] = price\n\t}\n\n\tif priceOld != \"\" {\n\t\tparams[\"price_old\"] = priceOld\n\t}\n\n\tif button != \"\" {\n\t\tparams[\"button\"] = button\n\t}\n\n\terr = p.SendObjRequest(\"prettyCards.create\", params, &resp)\n\n\treturn\n}",
"func (tx *Tx) CreateCard(c *cs.Card) (string, error) {\n\n\tif c == nil {\n\t\treturn \"\", errors.New(\"card required\")\n\t} else if c.Title == \"\" {\n\t\treturn \"\", errors.New(\"card.Title required\")\n\t}\n\n\tstmt, err := tx.Prepare(\"INSERT cards SET uid=?, title=?\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tid, _ := uid.NextStringID()\n\t_, err = stmt.Exec(id, c.Title)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn id, err\n}",
"func (c TokenContract) Create(issuer string, maxSupply string) {\n\tc.PushAction(\n\t\t\"create\",\n\t\tmap[string]interface{}{\n\t\t\t\"issuer\": issuer,\n\t\t\t\"maximum_supply\": maxSupply,\n\t\t},\n\t\t&Permission{\n\t\t\tActor: c.Account.Name,\n\t\t\tLevel: \"active\",\n\t\t},\n\t)\n}",
"func CreateCard(db *sql.DB, card model.Card) error {\n\tquery := \"INSERT INTO `card` (`user_id`, `name`, `status`, `content`, `category`) VALUES (?, ?, ?, ?, ?)\"\n\tresult, err := db.Exec(query, card.UserID, card.Name, card.Status, card.Content, card.Category)\n\n\tif err != nil {\n\t\tzap.S().Info(\"CreateCard insert error \", err)\n\t\treturn err\n\t}\n\n\trowEffect, _ := result.RowsAffected()\n\tif rowEffect == 0 {\n\t\tzap.S().Info(\"CreateCard insert error \", err)\n\t\treturn errors.New(\"Create Card Error\")\n\t}\n\n\treturn nil\n}",
"func (c *Producer) create(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\n\t// if len(args) != 3 {\n\t// \treturn shim.Error(\"create arguments usage: Serialnumber, Serie, Others\")\n\t// }\n\n\t// // A newly created computer is available\n\t// pc := PC{args[0], args[1], args[2], \"available\"}\n\n\t// // Use JSON to store in the Blockchain\n\t// pcAsBytes, err := json.Marshal(pc)\n\n\t// if err != nil {\n\t// \treturn shim.Error(err.Error())\n\t// }\n\n\t// // Use serial number as key\n\t// err = stub.PutState(pc.Snumber, pcAsBytes)\n\n\t// if err != nil {\n\t// \treturn shim.Error(err.Error())\n\t// }\n\treturn shim.Success(nil)\n}",
"func (s *Service) createCardHandler(w http.ResponseWriter, r *http.Request) {\n\t// Get the authenticated user from the request context\n\tauthenticatedUser, err := accounts.GetAuthenticatedUser(r)\n\tif err != nil {\n\t\tresponse.UnauthorizedError(w, err.Error())\n\t\treturn\n\t}\n\n\t// Request body cannot be nil\n\tif r.Body == nil {\n\t\tresponse.Error(w, \"Request body cannot be nil\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Read the request body\n\tpayload, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tresponse.Error(w, \"Error reading request body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Unmarshal the request body into the request prototype\n\tcardRequest := new(CardRequest)\n\tif err := json.Unmarshal(payload, cardRequest); err != nil {\n\t\tlogger.ERROR.Printf(\"Failed to unmarshal card request: %s\", payload)\n\t\tresponse.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Create a new card\n\tcard, err := s.createCard(authenticatedUser, cardRequest)\n\tif err != nil {\n\t\tlogger.ERROR.Printf(\"Create card error: %s\", err)\n\t\tresponse.Error(w, err.Error(), getErrStatusCode(err))\n\t\treturn\n\t}\n\n\t// Create response\n\tcardResponse, err := NewCardResponse(card)\n\tif err != nil {\n\t\tresponse.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// Set Location header to the newly created resource\n\tw.Header().Set(\"Location\", fmt.Sprintf(\"/v1/cards/%d\", card.ID))\n\t// Write JSON response\n\tresponse.WriteJSON(w, cardResponse, http.StatusCreated)\n}",
"func (_DisputeGameFactory *DisputeGameFactoryTransactor) Create(opts *bind.TransactOpts, _gameType uint8, _rootClaim [32]byte, _extraData []byte) (*types.Transaction, error) {\n\treturn _DisputeGameFactory.contract.Transact(opts, \"create\", _gameType, _rootClaim, _extraData)\n}",
"func (a *AccountApiService) CreateCreditCard(ctx _context.Context) ApiCreateCreditCardRequest {\n\treturn ApiCreateCreditCardRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func MsgCardCreate(conn net.Conn, msg *message.Msg) {\n\tcard := &Card{\n\t\t0,\n\t\t*msg.Cards.Name,\n\t\t*msg.Cards.Desc,\n\t\t*msg.Cards.ColumnId,\n\t\t*msg.Cards.ProjectId,\n\t\tmsg.Cards.Tags,\n\t\t*msg.Cards.UserId,\n\t\tmsg.Cards.ScriptsIds,\n\t\tmsg.Cards.Write,\n\t}\n\tvar answer *message.Msg\n\tproj := &Project{\n\t\tId: *msg.Cards.ProjectId,\n\t}\n\tif adm, err := proj.IsAdmin(dbPool, *msg.AuthorId); adm == false || err != nil {\n\t\tanswer = &message.Msg{\n\t\t\tTarget: message.TARGET_CARDS.Enum(),\n\t\t\tCommand: message.CMD_ERROR.Enum(),\n\t\t\tAuthorId: proto.Uint32(*msg.AuthorId),\n\t\t\tSessionId: proto.String(*msg.SessionId),\n\t\t\tError: &message.Msg_Error{\n\t\t\t\tErrorId: proto.Uint32(2), // remplacer par le vrai code d'erreur ici\n\t\t\t},\n\t\t}\n\t} else if err := card.Add(dbPool); err != nil {\n\t\t// Envoyer un message d'erreur ici\n\t\tanswer = &message.Msg{\n\t\t\tTarget: message.TARGET_CARDS.Enum(),\n\t\t\tCommand: message.CMD_ERROR.Enum(),\n\t\t\tAuthorId: proto.Uint32(*msg.AuthorId),\n\t\t\tSessionId: proto.String(*msg.SessionId),\n\t\t\tError: &message.Msg_Error{\n\t\t\t\tErrorId: proto.Uint32(5), // remplacer par le vrai code d'erreur ici\n\t\t\t},\n\t\t}\n\t} else {\n\t\tcard.GetLastCardWithName(dbPool)\n\t\tprintln(card.Id)\n\t\t*msg.Cards.Id = card.Id\n\t\t// Envoyer un message de succes ici\n\t\tanswer = &message.Msg{\n\t\t\tTarget: message.TARGET_CARDS.Enum(),\n\t\t\tCommand: message.CMD_SUCCES.Enum(),\n\t\t\tAuthorId: proto.Uint32(*msg.AuthorId),\n\t\t\tSessionId: proto.String(*msg.SessionId),\n\t\t\tCards: &message.Msg_Cards{\n\t\t\t\tId: proto.Uint32(card.Id),\n\t\t\t\tProjectId: proto.Uint32(card.Project_id),\n\t\t\t\tColumnId: proto.Uint32(card.Column_id),\n\t\t\t\tName: proto.String(card.Name),\n\t\t\t\tDesc: proto.String(card.Content),\n\t\t\t\tTags: card.Tags,\n\t\t\t\tUserId: proto.Uint32(card.User_id),\n\t\t\t\tScriptsIds: card.Scripts_id,\n\t\t\t\tWrite: card.Write,\n\t\t\t},\n\t\t}\n\t\tnotifyUsers(msg)\n\t}\n\tsendKanbanMsg(conn, answer)\n}",
"func (_MultiSigWalletFactoryContract *MultiSigWalletFactoryContractTransactor) Create(opts *bind.TransactOpts, _owners []common.Address, _required *big.Int) (*types.Transaction, error) {\n\treturn _MultiSigWalletFactoryContract.contract.Transact(opts, \"create\", _owners, _required)\n}",
"func (_CardMinting *CardMintingTransactorSession) CreateGen0Card() (*types.Transaction, error) {\n\treturn _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)\n}",
"func (_CardMinting *CardMintingSession) CreateGen0Card() (*types.Transaction, error) {\n\treturn _CardMinting.Contract.CreateGen0Card(&_CardMinting.TransactOpts)\n}",
"func bindCardOwnership(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(CardOwnershipABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}",
"func NewCard(rank, suit, color string, rv, sv int, up bool) Card {\n\treturn Card{\n\t\tRank: rank,\n\t\tSuit: suit,\n\t\tColor: color,\n\t\tRvalue: rv,\n\t\tSvalue: sv,\n\t\tFaceup: up,\n\t}\n}",
"func contractCreateStandardAccount(ic *interop.Context) error {\n\th := ic.VM.Estack().Pop().Bytes()\n\tp, err := keys.NewPublicKeyFromBytes(h, elliptic.P256())\n\tif err != nil {\n\t\treturn err\n\t}\n\tic.VM.Estack().PushItem(stackitem.NewByteArray(p.GetScriptHash().BytesBE()))\n\treturn nil\n}",
"func (s *SmartContract) CreatePrivateCar(ctx contractapi.TransactionContextInterface, args []string) (string, error) {\n\n\ttype carTransientInput struct {\n\t\tMake string `json:\"make\"` //the fieldtags are needed to keep case from bouncing around\n\t\tModel string `json:\"model\"`\n\t\tColor string `json:\"color\"`\n\t\tOwner string `json:\"owner\"`\n\t\tPrice string `json:\"price\"`\n\t\tKey string `json:\"key\"`\n\t}\n\n\tif len(args) != 0 {\n\t\treturn \" Error \", fmt.Errorf(\"Incorrect number of arguments. Private marble data must be passed in transient map\")\n\t}\n\n\ttransMap, err := ctx.GetStub().GetTransient()\n\n\tif err != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Get Transient State Error\")\n\t}\n\n\tcarDataAsBytes, _ := transMap[\"car\"]\n\n\tvar carInput carTransientInput\n\t_ = json.Unmarshal(carDataAsBytes, &carInput)\n\n\tcarAsBytes, err := ctx.GetStub().GetPrivateData(\"collectionCars\", carInput.Key)\n\n\tif err != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Get Private Data Collection Error\")\n\t} else if carAsBytes != nil {\n\t\treturn \"Car Key already exists in priavte data \", fmt.Errorf(\"Already Exists. %s\", carInput.Key)\n\t}\n\n\tvar car = Car{Make: carInput.Make, Model: carInput.Model, Colour: carInput.Color, Owner: carInput.Owner}\n\n\tcarAsBytes, err = json.Marshal(car)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprivateDataStatus := ctx.GetStub().PutPrivateData(\"collectionCars\", carInput.Key, carAsBytes)\n\n\tif privateDataStatus != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Put Private Data Collection Error %s\", privateDataStatus.Error())\n\t}\n\n\tcarPrivateDetails := &carPrivateDetails{Owner: carInput.Owner, Price: carInput.Price}\n\n\tcarPrivateDetailsAsBytes, err := json.Marshal(carPrivateDetails)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprivateCollectionStatus := ctx.GetStub().PutPrivateData(\"collectionCarPrivateDetails\", carInput.Key, carPrivateDetailsAsBytes)\n\n\tif privateCollectionStatus != nil {\n\t\treturn \" Error \", fmt.Errorf(\"Put Private Data Collection Error %s\", privateCollectionStatus.Error())\n\t}\n\n\treturn \"Private Car Data Added Successfully\", nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetOnBattleCooldown is a paid mutator transaction binding the contract method 0x685b7a5e. Solidity: function setOnBattleCooldown(_cardID uint256) returns(bool)
|
func (_CryptoCardsCore *CryptoCardsCoreTransactor) SetOnBattleCooldown(opts *bind.TransactOpts, _cardID *big.Int) (*types.Transaction, error) {
return _CryptoCardsCore.contract.Transact(opts, "setOnBattleCooldown", _cardID)
}
|
[
"func (_CardBattles *CardBattlesSession) SetOnBattleCooldown(_cardID *big.Int) (*types.Transaction, error) {\n\treturn _CardBattles.Contract.SetOnBattleCooldown(&_CardBattles.TransactOpts, _cardID)\n}",
"func (_BattleGroups *BattleGroupsTransactor) SetGroupOnBattleCooldown(opts *bind.TransactOpts, _groupID *big.Int) (*types.Transaction, error) {\n\treturn _BattleGroups.contract.Transact(opts, \"setGroupOnBattleCooldown\", _groupID)\n}",
"func (_BattleGroups *BattleGroupsTransactorSession) SetGroupOnBattleCooldown(_groupID *big.Int) (*types.Transaction, error) {\n\treturn _BattleGroups.Contract.SetGroupOnBattleCooldown(&_BattleGroups.TransactOpts, _groupID)\n}",
"func CheckSetCooldown(conf *models.ReputationConfig, senderID int64) (bool, error) {\n\tif conf.Cooldown < 1 {\n\t\treturn true, nil\n\t}\n\n\tvar resp string\n\terr := common.RedisPool.Do(radix.FlatCmd(&resp, \"SET\", KeyCooldown(conf.GuildID, senderID), true, \"EX\", conf.Cooldown, \"NX\"))\n\tif resp != \"OK\" {\n\t\treturn false, err\n\t}\n\n\treturn true, err\n}",
"func (cs *YAGCommand) SetCooldown(client *redis.Client, userID int64) error {\n\tif cs.Cooldown < 1 {\n\t\treturn nil\n\t}\n\tnow := time.Now().Unix()\n\terr := client.Cmd(\"SET\", RKeyCommandCooldown(userID, cs.Name), now, \"EX\", cs.Cooldown).Err\n\treturn err\n}",
"func (_CardMinting *CardMintingCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _CardMinting.contract.Call(opts, out, \"BATTLE_COOLDOWN_TIME\")\n\treturn *ret0, err\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCaller) BATTLECOOLDOWNTIME(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"BATTLE_COOLDOWN_TIME\")\n\treturn *ret0, err\n}",
"func (_MonsterMinting *MonsterMintingCaller) Cooldowns(opts *bind.CallOpts, arg0 *big.Int) (uint32, error) {\n\tvar (\n\t\tret0 = new(uint32)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"cooldowns\", arg0)\n\treturn *ret0, err\n}",
"func (_MonsterCore *MonsterCoreCaller) Cooldowns(opts *bind.CallOpts, arg0 *big.Int) (uint32, error) {\n\tvar (\n\t\tret0 = new(uint32)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"cooldowns\", arg0)\n\treturn *ret0, err\n}",
"func (c *CardInstance) OnAttack(target *CardInstance) error {\n\tvar ability Ability\n\tfor _, ai := range c.AbilitiesInstances {\n\t\tif ai.Trigger == zb_enums.AbilityTrigger_Attack {\n\t\t\tswitch abilityInstance := ai.AbilityType.(type) {\n\t\t\tcase *zb_data.CardAbilityInstance_AdditionalDamageToHeavyInAttack:\n\t\t\t\tadditionalDamageToHeavyInAttack := abilityInstance.AdditionalDamageToHeavyInAttack\n\t\t\t\tab := NewAdditionalDamgeToHeavyInAttack(c, additionalDamageToHeavyInAttack, target)\n\t\t\t\tif err := ab.Apply(c.Gameplay); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase *zb_data.CardAbilityInstance_DealDamageToThisAndAdjacentUnits:\n\t\t\t\tdealDamageToThisAndAdjacentUnits := abilityInstance.DealDamageToThisAndAdjacentUnits\n\t\t\t\tability = NewDealDamageToThisAndAdjacentUnits(c, dealDamageToThisAndAdjacentUnits, target)\n\t\t\t\tif err := ability.Apply(c.Gameplay); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}",
"func (_LockContract *LockContractCaller) IsAllowedAt(opts *bind.CallOpts, bookingID *big.Int, tenant common.Address, time *big.Int) (bool, error) {\n\tvar (\n\t\tret0 = new(bool)\n\t)\n\tout := ret0\n\terr := _LockContract.contract.Call(opts, out, \"isAllowedAt\", bookingID, tenant, time)\n\treturn *ret0, err\n}",
"func (_LockContract *LockContractCallerSession) IsAllowedAt(bookingID *big.Int, tenant common.Address, time *big.Int) (bool, error) {\n\treturn _LockContract.Contract.IsAllowedAt(&_LockContract.CallOpts, bookingID, tenant, time)\n}",
"func (s *ScalingPolicy) SetCooldown(v int64) *ScalingPolicy {\n\ts.Cooldown = &v\n\treturn s\n}",
"func (s *State) CanAffordBuyback() bool {\n\tif s == nil || s.Hero == nil || s.Player == nil {\n\t\treturn false\n\t}\n\n\treturn s.BuybackCost < (s.ReliableGold + s.UnreliableGoldAfterDeath())\n}",
"func (s *ExecutePolicyInput) SetHonorCooldown(v bool) *ExecutePolicyInput {\n\ts.HonorCooldown = &v\n\treturn s\n}",
"func (s *SetDesiredCapacityInput) SetHonorCooldown(v bool) *SetDesiredCapacityInput {\n\ts.HonorCooldown = &v\n\treturn s\n}",
"func (s *PutScalingPolicyInput) SetCooldown(v int64) *PutScalingPolicyInput {\n\ts.Cooldown = &v\n\treturn s\n}",
"func (_CryptoCardsCore *CryptoCardsCoreCallerSession) IsReadyForBattle(_cardID *big.Int) (bool, error) {\n\treturn _CryptoCardsCore.Contract.IsReadyForBattle(&_CryptoCardsCore.CallOpts, _cardID)\n}",
"func (_Comptroller *ComptrollerSession) MintAllowed(cToken common.Address, minter common.Address, mintAmount *big.Int) (*types.Transaction, error) {\n\treturn _Comptroller.Contract.MintAllowed(&_Comptroller.TransactOpts, cToken, minter, mintAmount)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
FilterContractUpgrade is a free log retrieval operation binding the contract event 0x450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa446199305. Solidity: event ContractUpgrade(newContract address)
|
func (_CryptoCardsCore *CryptoCardsCoreFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CryptoCardsCoreContractUpgradeIterator, error) {
logs, sub, err := _CryptoCardsCore.contract.FilterLogs(opts, "ContractUpgrade")
if err != nil {
return nil, err
}
return &CryptoCardsCoreContractUpgradeIterator{contract: _CryptoCardsCore.contract, event: "ContractUpgrade", logs: logs, sub: sub}, nil
}
|
[
"func (_CardBase *CardBaseFilterer) FilterContractUpgrade(opts *bind.FilterOpts) (*CardBaseContractUpgradeIterator, error) {\n\n\tlogs, sub, err := _CardBase.contract.FilterLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CardBaseContractUpgradeIterator{contract: _CardBase.contract, event: \"ContractUpgrade\", logs: logs, sub: sub}, nil\n}",
"func (_CardBattles *CardBattlesFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBattlesContractUpgrade) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBattles.contract.WatchLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBattlesContractUpgrade)\n\t\t\t\tif err := _CardBattles.contract.UnpackLog(event, \"ContractUpgrade\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_CardBase *CardBaseFilterer) WatchContractUpgrade(opts *bind.WatchOpts, sink chan<- *CardBaseContractUpgrade) (event.Subscription, error) {\n\n\tlogs, sub, err := _CardBase.contract.WatchLogs(opts, \"ContractUpgrade\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(CardBaseContractUpgrade)\n\t\t\t\tif err := _CardBase.contract.UnpackLog(event, \"ContractUpgrade\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}",
"func (_TransparentUpgradeableProxy *TransparentUpgradeableProxyFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*TransparentUpgradeableProxyUpgradedIterator, error) {\n\n\tvar implementationRule []interface{}\n\tfor _, implementationItem := range implementation {\n\t\timplementationRule = append(implementationRule, implementationItem)\n\t}\n\n\tlogs, sub, err := _TransparentUpgradeableProxy.contract.FilterLogs(opts, \"Upgraded\", implementationRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TransparentUpgradeableProxyUpgradedIterator{contract: _TransparentUpgradeableProxy.contract, event: \"Upgraded\", logs: logs, sub: sub}, nil\n}",
"func (_Comptroller *ComptrollerFilterer) FilterNewCloseFactor(opts *bind.FilterOpts) (*ComptrollerNewCloseFactorIterator, error) {\n\n\tlogs, sub, err := _Comptroller.contract.FilterLogs(opts, \"NewCloseFactor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ComptrollerNewCloseFactorIterator{contract: _Comptroller.contract, event: \"NewCloseFactor\", logs: logs, sub: sub}, nil\n}",
"func (_VorCoordinator *VorCoordinatorFilterer) FilterChangeFee(opts *bind.FilterOpts) (*VorCoordinatorChangeFeeIterator, error) {\n\n\tlogs, sub, err := _VorCoordinator.contract.FilterLogs(opts, \"ChangeFee\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &VorCoordinatorChangeFeeIterator{contract: _VorCoordinator.contract, event: \"ChangeFee\", logs: logs, sub: sub}, nil\n}",
"func (c *EventCollector) FilterAddedNewsroomContract(newsroomAddr common.Address) ([]*model.Event, error) {\n\tnwsrmFilterer := filterer.NewNewsroomContractFilterers(newsroomAddr)\n\tc.updateFiltererStartingBlock(nwsrmFilterer)\n\tretrieve := retriever.NewEventRetriever(c.httpClient, []model.ContractFilterers{nwsrmFilterer})\n\terr := retrieve.Retrieve()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnwsrmEvents := retrieve.PastEvents\n\treturn nwsrmEvents, nil\n}",
"func (_DNSResolverContract *DNSResolverContractFilterer) FilterUpdated(opts *bind.FilterOpts) (*DNSResolverContractUpdatedIterator, error) {\n\n\tlogs, sub, err := _DNSResolverContract.contract.FilterLogs(opts, \"Updated\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DNSResolverContractUpdatedIterator{contract: _DNSResolverContract.contract, event: \"Updated\", logs: logs, sub: sub}, nil\n}",
"func (_MSContract *MSContractFilterer) FilterEventClosing(opts *bind.FilterOpts) (*MSContractEventClosingIterator, error) {\n\n\tlogs, sub, err := _MSContract.contract.FilterLogs(opts, \"EventClosing\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MSContractEventClosingIterator{contract: _MSContract.contract, event: \"EventClosing\", logs: logs, sub: sub}, nil\n}",
"func (_UniswapV2 *UniswapV2Filterer) FilterBurn(opts *bind.FilterOpts, sender []common.Address, to []common.Address) (*UniswapV2BurnIterator, error) {\n\n\tvar senderRule []interface{}\n\tfor _, senderItem := range sender {\n\t\tsenderRule = append(senderRule, senderItem)\n\t}\n\n\tvar toRule []interface{}\n\tfor _, toItem := range to {\n\t\ttoRule = append(toRule, toItem)\n\t}\n\n\tlogs, sub, err := _UniswapV2.contract.FilterLogs(opts, \"Burn\", senderRule, toRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &UniswapV2BurnIterator{contract: _UniswapV2.contract, event: \"Burn\", logs: logs, sub: sub}, nil\n}",
"func (_Oneinch *OneinchFilterer) FilterImplementationUpdated(opts *bind.FilterOpts, newImpl []common.Address) (*OneinchImplementationUpdatedIterator, error) {\n\n\tvar newImplRule []interface{}\n\tfor _, newImplItem := range newImpl {\n\t\tnewImplRule = append(newImplRule, newImplItem)\n\t}\n\n\tlogs, sub, err := _Oneinch.contract.FilterLogs(opts, \"ImplementationUpdated\", newImplRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OneinchImplementationUpdatedIterator{contract: _Oneinch.contract, event: \"ImplementationUpdated\", logs: logs, sub: sub}, nil\n}",
"func NewUpgradeContractRequest(from *account.Account, module, name string, code []byte, opts ...RequestOption) (*Request, error) {\n\tif from == nil || !from.HasContractAccount() {\n\t\treturn nil, common.ErrInvalidAccount\n\t}\n\n\tif module == \"\" || name == \"\" || len(code) == 0 {\n\t\treturn nil, common.ErrInvalidParam\n\t}\n\n\treqArgs := generateDeployArgs(nil, nil, code, module, \"\", from.GetContractAccount(), name)\n\treturn NewRequest(from, Xkernel3Module, \"\", XkernelUpgradeMethod, reqArgs, \"\", \"\", opts...)\n}",
"func (_TrueUSD *TrueUSDFilterer) FilterChangeBurnBoundsEvent(opts *bind.FilterOpts) (*TrueUSDChangeBurnBoundsEventIterator, error) {\n\n\tlogs, sub, err := _TrueUSD.contract.FilterLogs(opts, \"ChangeBurnBoundsEvent\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TrueUSDChangeBurnBoundsEventIterator{contract: _TrueUSD.contract, event: \"ChangeBurnBoundsEvent\", logs: logs, sub: sub}, nil\n}",
"func (_MultiSigWalletFactoryContract *MultiSigWalletFactoryContractFilterer) FilterContractInstantiation(opts *bind.FilterOpts) (*MultiSigWalletFactoryContractContractInstantiationIterator, error) {\n\n\tlogs, sub, err := _MultiSigWalletFactoryContract.contract.FilterLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MultiSigWalletFactoryContractContractInstantiationIterator{contract: _MultiSigWalletFactoryContract.contract, event: \"ContractInstantiation\", logs: logs, sub: sub}, nil\n}",
"func (_BerryMaster *BerryMasterFilterer) FilterNewBerryAddress(opts *bind.FilterOpts) (*BerryMasterNewBerryAddressIterator, error) {\n\n\tlogs, sub, err := _BerryMaster.contract.FilterLogs(opts, \"NewBerryAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BerryMasterNewBerryAddressIterator{contract: _BerryMaster.contract, event: \"NewBerryAddress\", logs: logs, sub: sub}, nil\n}",
"func (_Stakinginfo *StakinginfoFilterer) FilterRewardUpdate(opts *bind.FilterOpts) (*StakinginfoRewardUpdateIterator, error) {\n\n\tlogs, sub, err := _Stakinginfo.contract.FilterLogs(opts, \"RewardUpdate\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &StakinginfoRewardUpdateIterator{contract: _Stakinginfo.contract, event: \"RewardUpdate\", logs: logs, sub: sub}, nil\n}",
"func newAuthAccountContractsChangeFunction(\n\tfunctionType *sema.FunctionType,\n\tgauge common.MemoryGauge,\n\thandler AccountContractAdditionHandler,\n\taddressValue interpreter.AddressValue,\n\tisUpdate bool,\n) *interpreter.HostFunctionValue {\n\treturn interpreter.NewHostFunctionValue(\n\t\tgauge,\n\t\tfunctionType,\n\t\tfunc(invocation interpreter.Invocation) interpreter.Value {\n\n\t\t\tlocationRange := invocation.LocationRange\n\n\t\t\tconst requiredArgumentCount = 2\n\n\t\t\tnameValue, ok := invocation.Arguments[0].(*interpreter.StringValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tnewCodeValue, ok := invocation.Arguments[1].(*interpreter.ArrayValue)\n\t\t\tif !ok {\n\t\t\t\tpanic(errors.NewUnreachableError())\n\t\t\t}\n\n\t\t\tconstructorArguments := invocation.Arguments[requiredArgumentCount:]\n\t\t\tconstructorArgumentTypes := invocation.ArgumentTypes[requiredArgumentCount:]\n\n\t\t\tcode, err := interpreter.ByteArrayValueToByteSlice(invocation.Interpreter, newCodeValue, locationRange)\n\t\t\tif err != nil {\n\t\t\t\tpanic(errors.NewDefaultUserError(\"add requires the second argument to be an array\"))\n\t\t\t}\n\n\t\t\t// Get the existing code\n\n\t\t\tcontractName := nameValue.Str\n\n\t\t\tif contractName == \"\" {\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"contract name argument cannot be empty.\" +\n\t\t\t\t\t\t\"it must match the name of the deployed contract declaration or contract interface declaration\",\n\t\t\t\t))\n\t\t\t}\n\n\t\t\taddress := addressValue.ToAddress()\n\t\t\tlocation := common.NewAddressLocation(invocation.Interpreter, address, contractName)\n\n\t\t\texistingCode, err := handler.GetAccountContractCode(location)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tif isUpdate {\n\t\t\t\t// We are updating an existing contract.\n\t\t\t\t// Ensure that there's a contract/contract-interface with the given name exists already\n\n\t\t\t\tif len(existingCode) == 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot update non-existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// We are adding a new contract.\n\t\t\t\t// Ensure that no contract/contract interface with the given name exists already\n\n\t\t\t\tif len(existingCode) > 0 {\n\t\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\t\"cannot overwrite existing contract with name %q in account %s\",\n\t\t\t\t\t\tcontractName,\n\t\t\t\t\t\taddress.ShortHexWithPrefix(),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check the code\n\t\t\thandleContractUpdateError := func(err error) {\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(&InvalidContractDeploymentError{\n\t\t\t\t\tErr: err,\n\t\t\t\t\tLocationRange: locationRange,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// NOTE: do NOT use the program obtained from the host environment, as the current program.\n\t\t\t// Always re-parse and re-check the new program.\n\n\t\t\t// NOTE: *DO NOT* store the program – the new or updated program\n\t\t\t// should not be effective during the execution\n\n\t\t\tconst getAndSetProgram = false\n\n\t\t\tprogram, err := handler.ParseAndCheckProgram(\n\t\t\t\tcode,\n\t\t\t\tlocation,\n\t\t\t\tgetAndSetProgram,\n\t\t\t)\n\t\t\thandleContractUpdateError(err)\n\n\t\t\t// The code may declare exactly one contract or one contract interface.\n\n\t\t\tvar contractTypes []*sema.CompositeType\n\t\t\tvar contractInterfaceTypes []*sema.InterfaceType\n\n\t\t\tprogram.Elaboration.ForEachGlobalType(func(_ string, variable *sema.Variable) {\n\t\t\t\tswitch ty := variable.Type.(type) {\n\t\t\t\tcase *sema.CompositeType:\n\t\t\t\t\tif ty.Kind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractTypes = append(contractTypes, ty)\n\t\t\t\t\t}\n\n\t\t\t\tcase *sema.InterfaceType:\n\t\t\t\t\tif ty.CompositeKind == common.CompositeKindContract {\n\t\t\t\t\t\tcontractInterfaceTypes = append(contractInterfaceTypes, ty)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar deployedType sema.Type\n\t\t\tvar contractType *sema.CompositeType\n\t\t\tvar contractInterfaceType *sema.InterfaceType\n\t\t\tvar declaredName string\n\t\t\tvar declarationKind common.DeclarationKind\n\n\t\t\tswitch {\n\t\t\tcase len(contractTypes) == 1 && len(contractInterfaceTypes) == 0:\n\t\t\t\tcontractType = contractTypes[0]\n\t\t\t\tdeclaredName = contractType.Identifier\n\t\t\t\tdeployedType = contractType\n\t\t\t\tdeclarationKind = common.DeclarationKindContract\n\t\t\tcase len(contractInterfaceTypes) == 1 && len(contractTypes) == 0:\n\t\t\t\tcontractInterfaceType = contractInterfaceTypes[0]\n\t\t\t\tdeclaredName = contractInterfaceType.Identifier\n\t\t\t\tdeployedType = contractInterfaceType\n\t\t\t\tdeclarationKind = common.DeclarationKindContractInterface\n\t\t\t}\n\n\t\t\tif deployedType == nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the code must declare exactly one contract or contract interface\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// The declared contract or contract interface must have the name\n\t\t\t// passed to the constructor as the first argument\n\n\t\t\tif declaredName != contractName {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(errors.NewDefaultUserError(\n\t\t\t\t\t\"invalid %s: the name argument must match the name of the declaration: got %q, expected %q\",\n\t\t\t\t\tdeclarationKind.Name(),\n\t\t\t\t\tcontractName,\n\t\t\t\t\tdeclaredName,\n\t\t\t\t))\n\t\t\t}\n\n\t\t\t// Validate the contract update\n\n\t\t\tif isUpdate {\n\t\t\t\toldCode, err := handler.GetAccountContractCode(location)\n\t\t\t\thandleContractUpdateError(err)\n\n\t\t\t\toldProgram, err := parser.ParseProgram(\n\t\t\t\t\tgauge,\n\t\t\t\t\toldCode,\n\t\t\t\t\tparser.Config{},\n\t\t\t\t)\n\n\t\t\t\tif !ignoreUpdatedProgramParserError(err) {\n\t\t\t\t\thandleContractUpdateError(err)\n\t\t\t\t}\n\n\t\t\t\tvalidator := NewContractUpdateValidator(\n\t\t\t\t\tlocation,\n\t\t\t\t\tcontractName,\n\t\t\t\t\toldProgram,\n\t\t\t\t\tprogram.Program,\n\t\t\t\t)\n\t\t\t\terr = validator.Validate()\n\t\t\t\thandleContractUpdateError(err)\n\t\t\t}\n\n\t\t\tinter := invocation.Interpreter\n\n\t\t\terr = updateAccountContractCode(\n\t\t\t\thandler,\n\t\t\t\tlocation,\n\t\t\t\tprogram,\n\t\t\t\tcode,\n\t\t\t\tcontractType,\n\t\t\t\tconstructorArguments,\n\t\t\t\tconstructorArgumentTypes,\n\t\t\t\tupdateAccountContractCodeOptions{\n\t\t\t\t\tcreateContract: !isUpdate,\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\t// Update the code for the error pretty printing\n\t\t\t\t// NOTE: only do this when an error occurs\n\n\t\t\t\thandler.TemporarilyRecordCode(location, code)\n\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tvar eventType *sema.CompositeType\n\n\t\t\tif isUpdate {\n\t\t\t\teventType = AccountContractUpdatedEventType\n\t\t\t} else {\n\t\t\t\teventType = AccountContractAddedEventType\n\t\t\t}\n\n\t\t\tcodeHashValue := CodeToHashValue(inter, code)\n\n\t\t\thandler.EmitEvent(\n\t\t\t\tinter,\n\t\t\t\teventType,\n\t\t\t\t[]interpreter.Value{\n\t\t\t\t\taddressValue,\n\t\t\t\t\tcodeHashValue,\n\t\t\t\t\tnameValue,\n\t\t\t\t},\n\t\t\t\tlocationRange,\n\t\t\t)\n\n\t\t\treturn interpreter.NewDeployedContractValue(\n\t\t\t\tinter,\n\t\t\t\taddressValue,\n\t\t\t\tnameValue,\n\t\t\t\tnewCodeValue,\n\t\t\t)\n\t\t},\n\t)\n}",
"func (_HoQuPlatform *HoQuPlatformFilterer) FilterLeadPriceChanged(opts *bind.FilterOpts, contractAddress []common.Address) (*HoQuPlatformLeadPriceChangedIterator, error) {\n\n\tvar contractAddressRule []interface{}\n\tfor _, contractAddressItem := range contractAddress {\n\t\tcontractAddressRule = append(contractAddressRule, contractAddressItem)\n\t}\n\n\tlogs, sub, err := _HoQuPlatform.contract.FilterLogs(opts, \"LeadPriceChanged\", contractAddressRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HoQuPlatformLeadPriceChangedIterator{contract: _HoQuPlatform.contract, event: \"LeadPriceChanged\", logs: logs, sub: sub}, nil\n}",
"func (_NewsroomFactory *NewsroomFactoryFilterer) FilterContractInstantiation(opts *bind.FilterOpts) (*NewsroomFactoryContractInstantiationIterator, error) {\n\n\tlogs, sub, err := _NewsroomFactory.contract.FilterLogs(opts, \"ContractInstantiation\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &NewsroomFactoryContractInstantiationIterator{contract: _NewsroomFactory.contract, event: \"ContractInstantiation\", logs: logs, sub: sub}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ResultChan returns channel events
|
func (w *Watcher) ResultChan() <-chan watch.Event {
return w.Result
}
|
[
"func (ch Channel) Result() <-chan []error {\n\treturn ch\n}",
"func (f *FileWatcher) GetEventChan() <-chan *FileContent {\n\treturn f.resultChan\n}",
"func (r *Receive) Results() <-chan interface{} {\n\treturn r.results\n}",
"func newInvokeResultChan(ctx context.Context, resultChan <-chan interface{}, errChan <-chan error) <-chan InvokeResult {\n\tch := make(chan InvokeResult, 1)\n\tgo func(ctx context.Context, ch chan InvokeResult, resultChan <-chan interface{}, errChan <-chan error) {\n\t\tvar resultChanClosed, errChanClosed bool\n\tloop:\n\t\tfor !resultChanClosed || !errChanClosed {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\tbreak loop\n\t\t\tcase value, ok := <-resultChan:\n\t\t\t\tif !ok {\n\t\t\t\t\tresultChanClosed = true\n\t\t\t\t} else {\n\t\t\t\t\tch <- InvokeResult{\n\t\t\t\t\t\tValue: value,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase err, ok := <-errChan:\n\t\t\t\tif !ok {\n\t\t\t\t\terrChanClosed = true\n\t\t\t\t} else {\n\t\t\t\t\tch <- InvokeResult{\n\t\t\t\t\t\tError: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclose(ch)\n\t}(ctx, ch, resultChan, errChan)\n\treturn ch\n}",
"func (_m *MockCall) ResultChan() chan hrpc.RPCResult {\n\tret := _m.ctrl.Call(_m, \"ResultChan\")\n\tret0, _ := ret[0].(chan hrpc.RPCResult)\n\treturn ret0\n}",
"func (f *future) Result() <-chan *packet.Packet {\n\treturn f.result\n}",
"func (m *MockRoomStorageStatusWatcher) ResultChan() chan game_room.StatusEvent {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ResultChan\")\n\tret0, _ := ret[0].(chan game_room.StatusEvent)\n\treturn ret0\n}",
"func (b *Boomer) Results() <-chan Result {\n\treturn b.results\n}",
"func (rd *reader) EventChan() <-chan Event {\n\treturn rd.eventChan\n}",
"func (this *Future) GetChan() <-chan *PromiseResult {\n\tc := make(chan *PromiseResult, 1)\n\tthis.OnComplete(func(v interface{}) {\n\t\tc <- this.loadResult()\n\t}).OnCancel(func() {\n\t\tc <- this.loadResult()\n\t})\n\treturn c\n}",
"func ProcessResults(c chan *Results) {\n\n\t// this will sit and wait for a response\n\tfor range c {\n\t\t// fmt.Printf(\"Results: %#v\\n\", r.FlopTurnRiver)\n\t\t// for p := range r.PlayerResults {\n\t\t// \tfmt.Printf(\"Player: %#v\\n\", p)\n\t\t// }\n\t}\n}",
"func queryWorker(id int, db dbInst,\n qpChan <- chan QueryHostParams, results chan<- *QueryHostResults,\n wg *sync.WaitGroup) {\n for {\n qp, more := <-qpChan\n if more {\n logger.Printf(\"worker %d : hostname %s\", id, qp.hostName)\n qhr := qp.findMinMaxForIntervals(db)\n logger.Printf(\"worker %d: queryresults \\n\", id)\n logger.Println(qhr)\n results <- qhr\n } else {\n wg.Done()\n logger.Println(\"query host parameters channel closed\")\n return\n }\n }\n}",
"func (c *Tex2BibConverter) OkChan() <-chan struct{} {\n\treturn c.okChannel\n}",
"func receiveResult(lineC chan []byte, queryErrC chan error, cancelFn context.CancelFunc, objectPattern string, timeout time.Duration) (result map[string]interface{}, err error) {\n\tdefer logAvailableWarnings(cmdWarnC)\n\tvar warn string\n\tfor {\n\t\tselect {\n\t\tcase line := <-lineC:\n\t\t\tif len(line) == 0 {\n\t\t\t\tcancelFn()\n\t\t\t\tlog.Warn(fmt.Sprintf(\"empty result for query: %s\", objectPattern))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar r map[string]interface{}\n\t\t\tif err = json.Unmarshal(line, &r); err != nil {\n\t\t\t\terr = fmt.Errorf(\"invalid return value for query: %s, error: %w, line: %q\", objectPattern, err, line)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif result == nil {\n\t\t\t\tresult = make(map[string]interface{})\n\t\t\t}\n\t\t\tfor k, v := range r {\n\t\t\t\tresult[k] = v\n\t\t\t}\n\n\t\t\treturn\n\n\t\tcase warn = <-cmdWarnC:\n\t\t\tlog.Warn(warn)\n\n\t\tcase err = <-cmdErrC:\n\t\t\treturn\n\n\t\tcase err = <-queryErrC:\n\t\t\treturn\n\n\t\tcase <-time.After(timeout):\n\t\t\t// In case of timeout, we want to close the command to avoid mixing up results coming up latter\n\t\t\tcancelFn()\n\t\t\tClose()\n\t\t\terr = fmt.Errorf(\"timeout waiting for query: %s\", objectPattern)\n\t\t\treturn\n\t\t}\n\t}\n}",
"func (b *broadcast) WaitChan(name string) chan struct{} {\n\tb.mutex.Lock()\n\tchannel, ok := b.clients[name]\n\tif !ok {\n\t\tb.clients[name] = make(chan struct{}, b.channelSize)\n\t\tchannel = b.clients[name]\n\t}\n\tb.mutex.Unlock()\n\treturn channel\n}",
"func (cp *ConnectionPool) ReturnChannel(chanHost *ChannelHost, erred bool) {\n\tchanHost.Close()\n}",
"func (client *Client) QuerySignResultWithChan(request *QuerySignResultRequest) (<-chan *QuerySignResultResponse, <-chan error) {\n\tresponseChan := make(chan *QuerySignResultResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.QuerySignResult(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}",
"func (q *remoteBase) Results(ctx context.Context) <-chan amboy.Job {\n\toutput := make(chan amboy.Job)\n\tgo func() {\n\t\tdefer close(output)\n\t\tfor j := range q.driver.Jobs(ctx) {\n\t\t\tif ctx.Err() != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif j.Status().Completed {\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\tcase output <- j:\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\treturn output\n}",
"func (q *localEventQueue) Events() <-chan Event {\n\treturn q.eventc\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Create a new (empty) AuthHandler
|
func NewAuthHandler() *AuthHandler {
a := &AuthHandler{
Users: make(map[string]string),
}
return a
}
|
[
"func NewAuthHandlers(e *echo.Echo, us authService.UserUsecase, sc session.SessionCheckerClient) {\n\thandlers := authHandlers{usecase: us, sessionClient: sc}\n\n\te.POST(\"/login/\", handlers.handleLogIn)\n\te.POST(\"/signup/\", handlers.handleSignUp)\n}",
"func New(handler http.Handler, auth *auth.Authenticator) *HTTP {\n\treturn &HTTP{Handler: handler, auth: auth}\n}",
"func NewAuthHTTPHandler(r *mux.Router, ad auth.Domain) {\n\tah := &authHTTPHandler{\n\t\tauthDomain: ad,\n\t}\n\tr.HandleFunc(\"/signin\", middleware.VerifyBasicAuth(ah.DoSignIn)).Methods(\"POST\")\n}",
"func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {\n\treturn &VaultAuth{\n\t\tnext: next,\n\t\tname: name,\n\t\tconfig: config,\n\t}, nil\n}",
"func NewAuth(c config.Config, initPayloadGetter InitPayloadGetter, l *zap.Logger) (*Auth, error) {\n\tkey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ta := &Auth{\n\t\tprivKey: key,\n\n\t\tadminOTP: c.AdminOTP,\n\t\tdisableAuth: c.DisableAuth,\n\n\t\tallowedPlugins: make(map[string]string),\n\t\tallowedOrigins: make(map[string]int),\n\n\t\tinitPayloadGetter: initPayloadGetter,\n\n\t\tlogger: l.Named(\"auth-handler\"),\n\t}\n\n\tif len(c.AllowOrigins) > 0 {\n\t\tfor _, origin := range c.AllowOrigins {\n\t\t\ta.allowedOrigins[origin] = math.MaxInt32\n\t\t}\n\t}\n\n\tinvalidID := xid.New().String()\n\ta.adminID.Store(invalidID)\n\n\ta.cors = cors.New(cors.Options{\n\t\tAllowOriginFunc: a.AllowOriginFunc,\n\t\tAllowCredentials: true,\n\t\tAllowedHeaders: []string{\"Authorization\", \"Content-Type\", \"X-Apollo-Tracing\"},\n\t})\n\n\treturn a, nil\n}",
"func CreateHandler() (Handler) {\n return Handler{}\n}",
"func (o *OAuth2) NewHandler(next http.Handler) (http.Handler, error) {\n\tvar h http.Handler\n\th = &OAuth2Handler{oauth2: o, next: next}\n\th = context.ClearHandler(h)\n\th = handlers.RecoveryHandler(handlers.RecoveryLogger(logrus.StandardLogger()))(h)\n\treturn h, nil\n}",
"func New(username, password string) goa.Middleware {\n\tmiddleware, _ := goa.NewMiddleware(func(ctx context.Context, w http.ResponseWriter, r *http.Request) error {\n\t\tu, p, ok := r.BasicAuth()\n\t\tif !ok || u != username || p != password {\n\t\t\treturn ErrBasicAuthFailed(\"Authentication failed\")\n\t\t}\n\t\treturn nil\n\t})\n\treturn middleware\n}",
"func New(token string) *Handler {\n\treturn &Handler{\n\t\tmetrics: promhttp.Handler(),\n\t\ttoken: token,\n\t}\n}",
"func NewHandler(handler http.Handler, key string, config *Config) *Handler {\n\tif key == \"\" {\n\t\tpanic(\"don't use an empty key\")\n\t}\n\n\t// sha256 sums are 32 bytes long. we use the first 16 bytes as\n\t// the aes key.\n\tencHash := sha256.New()\n\tencHash.Write([]byte(key))\n\tencHash.Write([]byte(\"-seshcookie-encryption\"))\n\n\t// if the user hasn't specified a config, use the package's\n\t// default one\n\tif config == nil {\n\t\tconfig = DefaultConfig\n\t}\n\n\tif config.CookieName == \"\" {\n\t\tconfig.CookieName = defaultCookieName\n\t}\n\n\treturn &Handler{\n\t\tHandler: handler,\n\t\tConfig: *config,\n\t\tencKey: encHash.Sum(nil)[:blockSize],\n\t}\n}",
"func New(name string) Handler {\n\tvar handler Handler\n\tswitch name {\n\tcase \"Graphite\":\n\t\thandler = NewGraphite()\n\tcase \"SignalFx\":\n\t\thandler = NewSignalFx()\n\tcase \"Datadog\":\n\t\thandler = NewDatadog()\n\tdefault:\n\t\tdefaultLog.Fatal(\"Cannot create handler \", name)\n\t\treturn nil\n\t}\n\treturn handler\n}",
"func NewHandler(cnf Config, um UserManager, tr TemplateRenderer) *Handler {\n\treturn &Handler{Config: cnf, um: um, tr: tr}\n}",
"func NewAuthMiddleware(service Service) (AuthMiddleware, error) {\n\tauthMiddleware := AuthMiddleware{}\n\treturn authMiddleware, nil\n\t//\tvar err error\n\t//\n\t//\t// If we are in the Root service...\n\t//\tif service.Name() == ServiceNameRoot {\n\t//\t\t// Really it would be most convenient to just use root.Root.publicKey but that\n\t//\t\t// would create a circular import dependency.\n\t//\t\tfullConfig := config.ServiceSpecific[FullConfigKey].(Config)\n\t//\t\trootConfig := fullConfig.Services[ServiceNameRoot].ServiceSpecific\n\t//\t\tauth, err := ToBool(rootConfig[\"auth\"])\n\t//\t\tif err != nil {\n\t//\t\t\treturn authMiddleware, err\n\t//\t\t}\n\t//\t\tif auth {\n\t//\t\t\t// If authentication is on, get the public key from local file\n\t//\t\t\t// and parse and store it.\n\t//\t\t\tpublicKeyLocation := config.Common.Api.AuthPublic\n\t//\t\t\tlog.Debugf(\"Creating AuthMiddleware for Root: reading public key from %s\", publicKeyLocation)\n\t//\t\t\tdata, err := ioutil.ReadFile(publicKeyLocation)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\treturn authMiddleware, err\n\t//\t\t\t}\n\t//\t\t\tkey, err := jwt.ParseRSAPublicKeyFromPEM(data)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\tlog.Errorf(\"Error parsing RSA public key from %s: %T: %s\", publicKeyLocation, err, err)\n\t//\t\t\t\treturn authMiddleware, err\n\t//\t\t\t}\n\t//\t\t\tauthMiddleware.PublicKey = key\n\t//\t\t\t// These URLs for Root are allowed to be accessed w/o authentication\n\t//\t\t\tauthMiddleware.AllowedURLs = []string{\"/\", \"/auth\", \"/publicKey\"}\n\t//\t\t} else {\n\t//\t\t\t// If the authentication is not turned on, just\n\t//\t\t\t// set this to nil\n\t//\t\t\tauthMiddleware.PublicKey = nil\n\t//\t\t}\n\t//\t\treturn authMiddleware, nil\n\t//\t}\n\t//\t// This is NOT root service - in this path\n\t//\t// we are constructing AuthMiddleware for some other service.\n\t//\t// So, first, get the public key to verify tokens with\n\t//\t// from Root:\n\t//\tauthMiddleware.PublicKey, err = client.GetPublicKey()\n\t//\tif err != nil {\n\t//\t\treturn authMiddleware, err\n\t//\t}\n\t//\treturn authMiddleware, nil\n}",
"func New(options *Options) *Handler {\n\tif options == nil {\n\t\treturn &Handler{options: defaultOptions()}\n\t}\n\tif options.LogFunc == nil {\n\t\toptions.LogFunc = defaultLogFunc()\n\t}\n\tif options.Encoders == nil {\n\t\toptions.Encoders = defaultEncoders()\n\t} else {\n\t\t_ = options.SetEncoders(options.Encoders)\n\t}\n\tif options.FallbackEncoderFunc == nil {\n\t\toptions.FallbackEncoderFunc = defaultFallbackEncoder()\n\t}\n\tif options.RequestUUIDFunc == nil {\n\t\toptions.RequestUUIDFunc = defaultRequestUUID()\n\t}\n\tif options.CustomPanicHandler == nil {\n\t\toptions.CustomPanicHandler = defaultCustomPanicHandler()\n\t}\n\treturn &Handler{options: options}\n}",
"func BasicAuthHandlerFactory(options plugin_v1.HandlerOptions) plugin_v1.Handler {\n\treturn &BasicAuthHandler{\n\t\tBaseHandler: plugin_v1.NewBaseHandler(options),\n\t}\n}",
"func New() *Handler {\n\th := &Handler{}\n\th.animMap = make(map[string]animInfo)\n\treturn h\n}",
"func New(config HandleConfig, opts ...Option) Handler {\n\thandler := handler{\n\t\tname: config.Name,\n\t\thandler: config.Handler,\n\t\ttransactional: true,\n\t}\n\tfor _, opt := range opts {\n\t\topt(&handler)\n\t}\n\treturn handler\n}",
"func NewHandler(notaryService *security.NotaryService, edgeManager *edge.Manager) *Handler {\n\th := &Handler{\n\t\tRouter: mux.NewRouter(),\n\t\tedgeManager: edgeManager,\n\t}\n\n\th.Handle(\"/key\",\n\t\thttperror.LoggerHandler(h.keyInspect)).Methods(http.MethodGet)\n\th.Handle(\"/key\",\n\t\thttperror.LoggerHandler(h.keyCreate)).Methods(http.MethodPost)\n\n\treturn h\n}",
"func NewHandler(t interface {\n\tmock.TestingT\n\tCleanup(func())\n}) *Handler {\n\tmock := &Handler{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewStrSet returns a new StrSet instance.
|
func NewStrSet(strs ...string) StrSet {
m := StrSet{}
for _, str := range strs {
m[str] = struct{}{}
}
return m
}
|
[
"func New() *StringSet {\n\tss := new(StringSet)\n\tss.content = make(map[string]nothing)\n\treturn ss\n}",
"func newStringSet(elements ...string) stringSet {\n\ts := make(stringSet)\n\ts.add(elements...)\n\treturn s\n}",
"func NewStringSet(contents ...string) StringSet {\n\tset := StringSet{}\n\tset.Add(contents...)\n\treturn set\n}",
"func New(strings ...string) StringSet {\n\tset := make(map[string]struct{}, len(strings))\n\tfor _, str := range strings {\n\t\tset[str] = struct{}{}\n\t}\n\treturn set\n}",
"func New(v ...string) Set {\n\treturn Add(nil, v...)\n}",
"func MakeStringSet() StringSet {\n\treturn StringSet{make(map[string]empty)}\n}",
"func NewSyncStringSet() *SyncStringSet {\n\treturn &SyncStringSet{\n\t\tm: make(map[string]struct{}),\n\t}\n}",
"func NewUnsafeStringSet() *StringSet {\n\treturn &StringSet{\n\t\tcontents: make(map[string]int8),\n\t}\n}",
"func MakeStringSetFromSlice(slice []string) StringSet {\n\ts := MakeStringSet()\n\tfor _, elem := range slice {\n\t\ts.Add(elem)\n\t}\n\treturn s\n}",
"func NewStringSetWithMemoryUsage(ss ...string) (setWithMemoryUsage StringSetWithMemoryUsage, memDelta int64) {\n\tset := make(StringSet, len(ss))\n\tsetWithMemoryUsage = StringSetWithMemoryUsage{\n\t\tStringSet: set,\n\t\tbInMap: 0,\n\t}\n\tmemDelta = DefStringSetBucketMemoryUsage * (1 << setWithMemoryUsage.bInMap)\n\tfor _, s := range ss {\n\t\tmemDelta += setWithMemoryUsage.Insert(s)\n\t}\n\treturn setWithMemoryUsage, memDelta\n}",
"func New(ss []string) (Set, error) {\n\tset := empty()\n\tfor _, s := range ss {\n\t\tname, err := image.NewName(s)\n\t\tif err != nil {\n\t\t\treturn Set{}, err\n\t\t}\n\t\tset.m[name] = struct{}{}\n\t}\n\treturn set, nil\n}",
"func newSimpleSet() Set {\n\treturn &simpleSet{\n\t\telements: make(map[interface{}]types.Empty),\n\t}\n}",
"func StringSetFromStringSlice(slice []string) StringSet {\n\ts := NewStringSet()\n\tfor _, str := range slice {\n\t\ts.Add(str)\n\t}\n\treturn s\n}",
"func NewSet(size int) *Set {\n\tif size <= 0 {\n\t\tsize = 10\n\t}\n\ts := &Set{\n\t\titems: make([]interface{}, 0, size),\n\t}\n\treturn s\n}",
"func NewSet(capacity int) *Set {\n\treturn &Set{\n\t\tsets: setslice(capacity),\n\t}\n}",
"func (tm *TypeManager) NewSet(name string) *Set {\n\ts := &Set{\n\t\tName: name,\n\t\ttm: tm,\n\t}\n\n\ttm.contains.RLock()\n\tif abstract, ok := tm.contains.abstracts[name]; ok && abstract.dtype == LWWSet {\n\t\ts.d = abstract\n\t\ttm.contains.RUnlock()\n\t\treturn s\n\t}\n\ttm.contains.RUnlock()\n\n\tas := &crdt{\n\t\tid: name + aSetIDSuffix,\n\t\tdtype: aSet,\n\t\tsval: setValue{},\n\t}\n\trs := &crdt{\n\t\tid: name + rSetIDSuffix,\n\t\tdtype: rSet,\n\t\tsval: setValue{},\n\t}\n\tabstract := &abstractCRDT{\n\t\tid: name,\n\t\tdtype: LWWSet,\n\t\tcomponents: map[DataType]*crdt{\n\t\t\taSet: as,\n\t\t\trSet: rs,\n\t\t},\n\t}\n\n\ttm.contains.Lock()\n\ttm.contains.values[as.id] = as\n\ttm.contains.values[rs.id] = rs\n\ttm.contains.abstracts[name] = abstract\n\ttm.contains.Unlock()\n\n\ts.d = abstract\n\treturn s\n}",
"func NewStrings(source []string) *Strings {\n\tvar m sync.Mutex\n\treturn &Strings{\n\t\tm: &m,\n\t\ts: source,\n\t\tc: sync.NewCond(&m),\n\t\twake: make(chan struct{}),\n\t}\n}",
"func New() *WriterSet {\n\treturn &WriterSet{\n\t\tm: make(map[io.Writer]chan error),\n\t\tmu: sync.Mutex{},\n\t}\n}",
"func NewFromSlice(slice []string) Set {\n\ts := New()\n\tfor _, elm := range slice {\n\t\ts.Add(elm)\n\t}\n\treturn s\n}",
"func NewStrSlice(parts ...string) *StrSlice {\n\treturn &StrSlice{parts}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewEvaluator returns the Eval function.
|
func NewEvaluator(opMap map[string]BinOp, prec PrecMap) func(expr string) (int, error) {
return func(expr string) (int, error) {
return Eval(opMap, prec, expr)
}
}
|
[
"func NewEvaluator(vars map[string]Var) *Evaluator {\n\treturn &Evaluator{\n\t\toutVars: make(Vars),\n\t\tvars: vars,\n\t\toutRuleVars: make(map[string]Vars),\n\t\texports: make(map[string]bool),\n\t}\n}",
"func NewEvaluator() *Evaluator {\n\tenv := NewEnv()\n\tpid := NewString(strconv.Itoa(syscall.Getpid()))\n\tg := map[string]*Value{\n\t\t\"env\": valuePtr(env), \"pid\": valuePtr(pid),\n\t}\n\tev := &Evaluator{\n\t\tChecker: NewChecker(),\n\t\tscope: g, env: env,\n\t\tin: &port{f: os.Stdin}, out: &port{f: os.Stdout},\n\t\tstatusCb: func(s []string) {\n\t\t\tif !statusOk(s) {\n\t\t\t\tfmt.Println(\"Status:\", s)\n\t\t\t}\n\t\t},\n\t}\n\n\tpath, ok := env.m[\"PATH\"]\n\tif ok {\n\t\tev.searchPaths = strings.Split(path, \":\")\n\t\t// fmt.Printf(\"Search paths are %v\\n\", search_paths)\n\t} else {\n\t\tev.searchPaths = []string{\"/bin\"}\n\t}\n\n\treturn ev\n}",
"func NewEval() *Eval {\n\tbot, err := NewRobot()\n\tif err != nil {\n\t\tlog.Printf(err.Error())\n\t}\n\tenv := Env{\n\t\t// Robot control function map: WASD for treads, IJKL for camera pod\n\t\t\"w\": controlFunc{Fn: bot.Forward, Param: 1},\n\t\t\"ww\": controlFunc{Fn: bot.Forward, Param: 3},\n\t\t\"a\": controlFunc{Fn: bot.Left, Param: 1},\n\t\t\"aa\": controlFunc{Fn: bot.Left, Param: 3},\n\t\t\"s\": controlFunc{Fn: bot.Backward, Param: 1},\n\t\t\"ss\": controlFunc{Fn: bot.Backward, Param: 3},\n\t\t\"d\": controlFunc{Fn: bot.Right, Param: 1},\n\t\t\"dd\": controlFunc{Fn: bot.Right, Param: 3},\n\t\t\"j\": controlFunc{Fn: bot.Yaw, Param: -1},\n\t\t\"l\": controlFunc{Fn: bot.Yaw, Param: 1},\n\t\t\"k\": controlFunc{Fn: bot.Pitch, Param: -1},\n\t\t\"i\": controlFunc{Fn: bot.Pitch, Param: 1},\n\t}\n\tp := parser{}\n\te := Eval{env: env, parser: p}\n\treturn &e\n}",
"func NewEvaluator(m *big.Int) *Evaluator {\n\treturn &Evaluator{\n\t\tstate: make(map[ast.Variable]*big.Int),\n\t\tm: m,\n\t}\n}",
"func NewEvaler(st *store.Store) *Evaler {\n\t// Construct searchPaths\n\tvar searchPaths []string\n\tif path := os.Getenv(\"PATH\"); path != \"\" {\n\t\tsearchPaths = strings.Split(path, \":\")\n\t} else {\n\t\tsearchPaths = []string{\"/bin\"}\n\t}\n\n\t// Construct initial global namespace\n\tpid := String(strconv.Itoa(syscall.Getpid()))\n\tpaths := NewList()\n\tpaths.appendStrings(searchPaths)\n\tglobal := ns{\n\t\t\"pid\": newPtrVariable(pid),\n\t\t\"ok\": newPtrVariable(OK),\n\t\t\"true\": newPtrVariable(Bool(true)),\n\t\t\"false\": newPtrVariable(Bool(false)),\n\t\t\"paths\": newPtrVariable(paths),\n\t}\n\tfor _, b := range builtinFns {\n\t\tglobal[FnPrefix+b.Name] = newPtrVariable(b)\n\t}\n\n\treturn &Evaler{global, map[string]ns{}, searchPaths, st, nil}\n}",
"func NewEvaluator(params *Parameters) Evaluator {\n\n\tvar err error\n\n\tvar q, qm, p *ring.Ring\n\tif q, err = ring.NewRing(params.N(), params.qi); err != nil {\n\t\tpanic(err)\n\t}\n\n\tqiMul := ring.GenerateNTTPrimesP(61, 2*params.N(), uint64(len(params.qi)))\n\n\tif qm, err = ring.NewRing(params.N(), qiMul); err != nil {\n\t\tpanic(err)\n\t}\n\n\tpoolQ := make([][]*ring.Poly, 4)\n\tpoolQmul := make([][]*ring.Poly, 4)\n\tfor i := 0; i < 4; i++ {\n\t\tpoolQ[i] = make([]*ring.Poly, 6)\n\t\tpoolQmul[i] = make([]*ring.Poly, 6)\n\t\tfor j := 0; j < 6; j++ {\n\t\t\tpoolQ[i][j] = q.NewPoly()\n\t\t\tpoolQmul[i][j] = qm.NewPoly()\n\t\t}\n\t}\n\n\tvar baseconverter *ring.FastBasisExtender\n\tvar decomposer *ring.Decomposer\n\tvar poolQKS [4]*ring.Poly\n\tvar poolPKS [3]*ring.Poly\n\tif len(params.pi) != 0 {\n\n\t\tif p, err = ring.NewRing(params.N(), params.pi); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tbaseconverter = ring.NewFastBasisExtender(q, p)\n\t\tdecomposer = ring.NewDecomposer(q.Modulus, p.Modulus)\n\t\tpoolQKS = [4]*ring.Poly{q.NewPoly(), q.NewPoly(), q.NewPoly(), q.NewPoly()}\n\t\tpoolPKS = [3]*ring.Poly{p.NewPoly(), p.NewPoly(), p.NewPoly()}\n\t}\n\n\treturn &evaluator{\n\t\tparams: params.Copy(),\n\t\tringQ: q,\n\t\tringQMul: qm,\n\t\tringP: p,\n\t\tbaseconverterQ1Q2: ring.NewFastBasisExtender(q, qm),\n\t\tbaseconverterQ1P: baseconverter,\n\t\tdecomposer: decomposer,\n\t\tt: params.t,\n\t\tpHalf: new(big.Int).Rsh(qm.ModulusBigint, 1),\n\t\tdeltaMont: GenLiftParams(q, params.t),\n\t\tpoolQ: poolQ,\n\t\tpoolQmul: poolQmul,\n\t\tpoolQKS: poolQKS,\n\t\tpoolPKS: poolPKS,\n\t\ttmpPt: NewPlaintext(params),\n\t\tgalElRotColLeft: ring.GenGaloisParams(params.N(), GaloisGen),\n\t\tgalElRotColRight: ring.GenGaloisParams(params.N(), ring.ModExp(GaloisGen, 2*params.N()-1, 2*params.N())),\n\t\tgalElRotRow: 2*params.N() - 1,\n\t}\n}",
"func NewPolicyEval() Evaluator {\n\treturn &policyEval{}\n}",
"func (n Number) Eval() Number {\n\treturn n\n}",
"func NewEvaluators(params *Parameters, evaluationKey EvaluationKey, n int) []Evaluator {\n\tif n <= 0 {\n\t\treturn []Evaluator{}\n\t}\n\tevas := make([]Evaluator, n, n)\n\tfor i := range evas {\n\t\tif i == 0 {\n\t\t\tevas[0] = NewEvaluator(params, evaluationKey)\n\t\t} else {\n\t\t\tevas[i] = evas[i-1].ShallowCopy()\n\t\t}\n\t}\n\treturn evas\n}",
"func GetEvaluator(i int) (FunctionEvaluator, error) {\n\tif i < 0 || i >= len(typeList) {\n\t\treturn nil, errors.New(\"Invalid index\")\n\t}\n\tv := reflect.New(typeList[i])\n\treturn v.Interface().(FunctionEvaluator), nil\n}",
"func (c Calculation) Eval() Number {\n\tevalA := c.a.Eval()\n\tevalB := c.b.Eval()\n\tswitch c.op {\n\tcase opAdd:\n\t\treturn Number(evalA + evalB)\n\tcase opSub:\n\t\treturn Number(evalA - evalB)\n\tcase opMul:\n\t\treturn Number(evalA * evalB)\n\tcase opDiv:\n\t\treturn Number(evalA / evalB)\n\tdefault:\n\t\tpanic(\"Unknown operator: \" + strconv.Itoa(int(c.op)))\n\t}\n}",
"func (in *Evaluator) DeepCopy() *Evaluator {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Evaluator)\n\tin.DeepCopyInto(out)\n\treturn out\n}",
"func NewEvalValues(index int) (ret *EvalValues) {\n\tif index <= 0 {\n\t\treturn\n\t}\n\tret = new(EvalValues)\n\tret.values = make([]int, index)\n\tret.counts = make([]int, index)\n\tret.evalFunc = make([]func(int, int) int, index)\n\tfor index := range ret.evalFunc {\n\t\tret.evalFunc[index] = Max\n\t}\n\treturn\n}",
"func (fnc Function) Eval(val float64) float64 {\n\tnum := strconv.FormatFloat(val, 'G', -1, 64)\n\tresult, err := compute.Evaluate(strings.Replace(fnc.F, \"x\", num, -1))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn result\n}",
"func New(in string) (*Expression, error) {\n\ttokens := Tokenize(in)\n\tif len(tokens) == 0 {\n\t\treturn nil, ErrInvalidExpression\n\t}\n\treturn NewFromTokens(tokens), nil\n}",
"func (calc *Calculator) Eval(stmt string) float64 {\n\tcalc.idx = 0\n\tcalc.slen = len(stmt)\n\tcalc.stmt = stmt\n\n\tcalc.skipWhite()\n\n\tres := calc.evalExpression()\n\n\tif calc.idx != calc.slen {\n\t\tpanic(fmt.Errorf(\"Syntax error. Unexpected: %c\", calc.peekRune()))\n\t}\n\n\treturn res\n}",
"func (env *Environment) Eval(v Val) Val {\n\treturn eval(v, env, true)\n}",
"func Eval(s string) (interface{}, error) {\n\tb := expr.CreateBuffer(s)\n\te := expr.ArithmeticExpression()\n\texpr.Parse(e, b)\n\ta := ast.CreateAST(b.Code.Code)\n\treturn a.Evaluate()\n}",
"func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error) {}",
"func NewEvaluation(ctx *pulumi.Context,\n\tname string, args *EvaluationArgs, opts ...pulumi.ResourceOption) (*Evaluation, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.EvaluationId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'EvaluationId'\")\n\t}\n\treplaceOnChanges := pulumi.ReplaceOnChanges([]string{\n\t\t\"evaluationId\",\n\t\t\"location\",\n\t\t\"project\",\n\t})\n\topts = append(opts, replaceOnChanges)\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Evaluation\n\terr := ctx.RegisterResource(\"google-native:workloadmanager/v1:Evaluation\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Item.Glob() Wraps getting the compiled glob of Item.Val to ensure it is compiled properly. Do NOT access globVal directly as it won't be compiled until the first call to Item.Glob()
|
func (i *Item) Glob() *glob.Glob {
if i.globVal == nil && !i.globCompFail {
newVal := escapeSigmaForGlob(i.Val)
newGlob, err := glob.Compile(newVal)
if err != nil {
i.globCompFail = true
return nil
}
i.globVal = &newGlob
}
return i.globVal
}
|
[
"func (OS) Glob(pattern string) ([]string, error) {\n\treturn filepath.Glob(pattern)\n}",
"func Glob(pattern string) []string {\n\tvtroot := os.Getenv(\"VTROOT\")\n\tif vtroot == \"\" {\n\t\tpanic(fmt.Errorf(\"VTROOT is not set\"))\n\t}\n\tdir := path.Join(vtroot, \"data\", \"test\")\n\tif exists, err := exists(dir); !exists {\n\t\tpanic(err)\n\t}\n\tresolved := path.Join(dir, pattern)\n\tout, err := filepath.Glob(resolved)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn out\n}",
"func Glob(tb testing.TB, pattern string, excludes ...string) []string {\n\ttb.Helper()\n\n\tfiles, err := filepath.Glob(pattern)\n\tif err != nil {\n\t\ttb.Fatal(\"Can't glob files:\", err)\n\t}\n\n\tif len(excludes) == 0 {\n\t\treturn files\n\t}\n\n\tvar filtered []string\nnextFile:\n\tfor _, file := range files {\n\t\tbase := filepath.Base(file)\n\t\tfor _, exclude := range excludes {\n\t\t\tif matched, err := filepath.Match(exclude, base); err != nil {\n\t\t\t\ttb.Fatal(err)\n\t\t\t} else if matched {\n\t\t\t\tcontinue nextFile\n\t\t\t}\n\t\t}\n\t\tfiltered = append(filtered, file)\n\t}\n\n\treturn filtered\n}",
"func (t *Template) ParseGlob(pattern string) (*Template, error) {}",
"func Glob(fs billy.Filesystem, pattern string) (matches []string, err error) {\n\tif !hasMeta(pattern) {\n\t\tif _, err = fs.Lstat(pattern); err != nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn []string{pattern}, nil\n\t}\n\n\tdir, file := filepath.Split(pattern)\n\t// Prevent infinite recursion. See issue 15879.\n\tif dir == pattern {\n\t\treturn nil, filepath.ErrBadPattern\n\t}\n\n\tvar m []string\n\tm, err = Glob(fs, cleanGlobPath(dir))\n\tif err != nil {\n\t\treturn\n\t}\n\tfor _, d := range m {\n\t\tmatches, err = glob(fs, d, file, matches)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}",
"func TestGlob(t *testing.T) {\n\tb := initBucket(t, fsFiles)\n\tdefer b.Close()\n\n\ttests := []struct {\n\t\tPattern string\n\t\tWant []string\n\t}{\n\t\t{\n\t\t\tPattern: \"*\",\n\t\t\tWant: []string{\"a\", \"baz.txt\", \"bazfoo.txt\", \"dir\", \"foo.txt\", \"foobar.txt\"},\n\t\t},\n\t\t{\n\t\t\tPattern: \"foo*\",\n\t\t\tWant: []string{\"foo.txt\", \"foobar.txt\"},\n\t\t},\n\t\t{\n\t\t\tPattern: \"*foo*\",\n\t\t\tWant: []string{\"bazfoo.txt\", \"foo.txt\", \"foobar.txt\"},\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\tt.Run(test.Pattern, func(t *testing.T) {\n\t\t\tif got, err := fs.Glob(b, test.Pattern); err != nil {\n\t\t\t\tt.Fatalf(\"Failed to glob: %v\", err)\n\t\t\t} else if diff := cmp.Diff(got, test.Want); diff != \"\" {\n\t\t\t\tt.Error(diff)\n\t\t\t}\n\t\t})\n\t}\n}",
"func (n *fsNode) RegExpGlob(pattern string) ([]string, error) {\n\tvar result []string\n\tvar expression = regexp.MustCompile(pattern)\n\terr := n.WalkMe(func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !info.IsDir() {\n\t\t\tif expression.MatchString(path) {\n\t\t\t\tresult = append(result, path)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Strings(result)\n\treturn result, nil\n}",
"func (a *apiServer) GlobFile(request *pfs.GlobFileRequest, respServer pfs.API_GlobFileServer) (retErr error) {\n\treturn a.driver.globFile(respServer.Context(), request.Commit, request.Pattern, request.PathRange, func(fi *pfs.FileInfo) error {\n\t\treturn errors.EnsureStack(respServer.Send(fi))\n\t})\n}",
"func Compile(pattern string) (*Glob, error) {\n\tr, err := globToRegex(pattern)\n\treturn &Glob{r}, err\n}",
"func (v *SourceLanguage) GetGlobs() []string {\n\treturn toGoStringArray(C.gtk_source_language_get_globs(v.native()))\n}",
"func Glob(ctx context.Context, dir string, matcher Matcher, opts ...GlobOption) (map[string]os.FileInfo, error) {\n\tvar options globOptions\n\tfor _, o := range opts {\n\t\terr := o(&options)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tmatches := make(map[string]os.FileInfo)\n\n\tvar m sync.Mutex\n\n\tignoreErrors := walker.WithErrorCallback(func(pathname string, err error) error {\n\t\treturn nil\n\t})\n\n\twalkFn := func(pathname string, fi os.FileInfo) error {\n\t\trel := strings.TrimPrefix(pathname, dir)\n\t\trel = strings.TrimPrefix(filepath.ToSlash(rel), \"/\")\n\t\tif rel == \"\" {\n\t\t\treturn nil\n\t\t}\n\n\t\tif fi.IsDir() {\n\t\t\trel += \"/\"\n\t\t}\n\n\t\tif options.PathTransform != nil {\n\t\t\trel = options.PathTransform(rel)\n\t\t}\n\n\t\tresult, err := matcher.Match(rel)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif result == Matched {\n\t\t\tm.Lock()\n\t\t\tdefer m.Unlock()\n\n\t\t\tmatches[pathname] = fi\n\t\t}\n\n\t\tfollow := result == Matched || result == Follow\n\t\tif fi.IsDir() && !follow {\n\t\t\treturn filepath.SkipDir\n\t\t}\n\n\t\treturn nil\n\t}\n\n\treturn matches, walker.WalkWithContext(ctx, dir, walkFn, ignoreErrors)\n}",
"func glob(fs billy.Filesystem, dir, pattern string, matches []string) (m []string, e error) {\n\tm = matches\n\tfi, err := fs.Stat(dir)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif !fi.IsDir() {\n\t\treturn\n\t}\n\n\tnames, _ := readdirnames(fs, dir)\n\tsort.Strings(names)\n\n\tfor _, n := range names {\n\t\tmatched, err := filepath.Match(pattern, n)\n\t\tif err != nil {\n\t\t\treturn m, err\n\t\t}\n\t\tif matched {\n\t\t\tm = append(m, filepath.Join(dir, n))\n\t\t}\n\t}\n\treturn\n}",
"func GlobOne(glob string) (string, error) {\n\tmatches, err := filepath.Glob(glob)\n\tif err != nil {\n\t\treturn \"\", errors.WithStack(err)\n\t}\n\tif len(matches) != 1 {\n\t\treturn \"\", errors.Errorf(\"expected exactly one file but found %s\", strings.Join(matches, \", \"))\n\t}\n\treturn matches[0], nil\n}",
"func (g *glob) doGlob(fsys fs.FS, pattern string, m []string, firstSegment, beforeMeta bool) (matches []string, err error) {\n\tmatches = m\n\tpatternStart := indexMeta(pattern)\n\tif patternStart == -1 {\n\t\t// pattern doesn't contain any meta characters - does a file matching the\n\t\t// pattern exist?\n\t\t// The pattern may contain escaped wildcard characters for an exact path match.\n\t\tpath := unescapeMeta(pattern)\n\t\tpathInfo, pathExists, pathErr := g.exists(fsys, path, beforeMeta)\n\t\tif pathErr != nil {\n\t\t\treturn nil, pathErr\n\t\t}\n\n\t\tif pathExists && (!firstSegment || !g.filesOnly || !pathInfo.IsDir()) {\n\t\t\tmatches = append(matches, path)\n\t\t}\n\n\t\treturn\n\t}\n\n\tdir := \".\"\n\tsplitIdx := lastIndexSlashOrAlt(pattern)\n\tif splitIdx != -1 {\n\t\tif pattern[splitIdx] == '}' {\n\t\t\topeningIdx := indexMatchedOpeningAlt(pattern[:splitIdx])\n\t\t\tif openingIdx == -1 {\n\t\t\t\t// if there's no matching opening index, technically Match() will treat\n\t\t\t\t// an unmatched `}` as nothing special, so... we will, too!\n\t\t\t\tsplitIdx = lastIndexSlash(pattern[:splitIdx])\n\t\t\t\tif splitIdx != -1 {\n\t\t\t\t\tdir = pattern[:splitIdx]\n\t\t\t\t\tpattern = pattern[splitIdx+1:]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// otherwise, we have to handle the alts:\n\t\t\t\treturn g.globAlts(fsys, pattern, openingIdx, splitIdx, matches, firstSegment, beforeMeta)\n\t\t\t}\n\t\t} else {\n\t\t\tdir = pattern[:splitIdx]\n\t\t\tpattern = pattern[splitIdx+1:]\n\t\t}\n\t}\n\n\t// if `splitIdx` is less than `patternStart`, we know `dir` has no meta\n\t// characters. They would be equal if they are both -1, which means `dir`\n\t// will be \".\", and we know that doesn't have meta characters either.\n\tif splitIdx <= patternStart {\n\t\treturn g.globDir(fsys, dir, pattern, matches, firstSegment, beforeMeta)\n\t}\n\n\tvar dirs []string\n\tdirs, err = g.doGlob(fsys, dir, matches, false, beforeMeta)\n\tif err != nil {\n\t\treturn\n\t}\n\tfor _, d := range dirs {\n\t\tmatches, err = g.globDir(fsys, d, pattern, matches, firstSegment, false)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}",
"func GlobFS(fsys fs.FS, patterns ...string) ([]string, error) {\n\tvar filenames []string\n\tfor _, pattern := range patterns {\n\t\tlist, err := fs.Glob(fsys, pattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfilenames = append(filenames, list...)\n\t}\n\treturn Unique(filenames), nil\n}",
"func Glob(t *testing.T, pattern string, f func(*testing.T, string)) {\n\tfilenames, err := filepath.Glob(pattern)\n\trequire.NoError(t, err)\n\tfor _, filename := range filenames {\n\t\tt.Run(filename, func(t *testing.T) {\n\t\t\tf(t, filename)\n\t\t})\n\t}\n}",
"func Parse(pattern string) (*Glob, error) {\n\tg, _, err := parse(pattern, false)\n\treturn g, err\n}",
"func Globs(pattern string) (c []string) {\n\tif strings.ContainsAny(pattern, \"*?[]\") {\n\t\tif globs, err := filepath.Glob(pattern); err == nil {\n\t\t\tc = globs\n\t\t}\n\t\treturn\n\t}\n\tfi, err := os.Stat(pattern)\n\tif err == nil && !fi.IsDir() {\n\t\treturn\n\t}\n\tpattern += \"*\"\n\tglobs, err := filepath.Glob(pattern)\n\tif err != nil {\n\t\tglobs = globs[:0]\n\t}\n\tfor _, name := range globs {\n\t\tfi, err := os.Stat(name)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t} else if fi.IsDir() {\n\t\t\tc = append(c, name+string(os.PathSeparator))\n\t\t} else {\n\t\t\tt, err := filepath.Match(pattern, name)\n\t\t\tif err == nil && t {\n\t\t\t\tc = append(c, name)\n\t\t\t}\n\t\t}\n\t}\n\tif len(c) == 1 && c[0][len(c[0])-1] == os.PathSeparator {\n\t\tc = append(c, Globs(c[0])...)\n\t}\n\treturn\n}",
"func (g *GlobPath) Match() []string {\n\t// This string replacement is for backwards compatibility support\n\t// The original implementation allowed **.txt but the double star package requires **/**.txt\n\tg.path = strings.ReplaceAll(g.path, \"**/**\", \"**\")\n\tg.path = strings.ReplaceAll(g.path, \"**\", \"**/**\")\n\n\tfiles, _ := doublestar.Glob(g.path)\n\treturn files\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
String documents human readable textual value of token For visual debugging, so symbols will be written out and everything is uppercased
|
func (t Token) String() string {
switch t {
case TokIdentifier:
return "IDENT"
case TokIdentifierWithWildcard:
return "WILDCARDIDENT"
case TokIdentifierAll:
return "THEM"
case TokSepLpar:
return "LPAR"
case TokSepRpar:
return "RPAR"
case TokSepPipe:
return "PIPE"
case TokOpEq:
return "EQ"
case TokOpGt:
return "GT"
case TokOpGte:
return "GTE"
case TokOpLt:
return "LT"
case TokOpLte:
return "LTE"
case TokKeywordAnd:
return "AND"
case TokKeywordOr:
return "OR"
case TokKeywordNot:
return "NOT"
case TokStAll:
return "ALL"
case TokStOne:
return "ONE"
case TokKeywordAgg:
return "AGG"
case TokLitEof:
return "EOF"
case TokErr:
return "ERR"
case TokUnsupp:
return "UNSUPPORTED"
case TokBegin:
return "BEGINNING"
case TokNil:
return "NIL"
default:
return "Unk"
}
}
|
[
"func (t token) string() string {\n\treturn t.tokenString\n}",
"func (kind TokenKind) String() string {\r\n\r\n\tswitch kind {\r\n\r\n\tcase PREFIX:\r\n\t\treturn \"PREFIX\"\r\n\tcase NUMERIC:\r\n\t\treturn \"NUMERIC\"\r\n\tcase BOOLEAN:\r\n\t\treturn \"BOOLEAN\"\r\n\tcase STRING:\r\n\t\treturn \"STRING\"\r\n\tcase PATTERN:\r\n\t\treturn \"PATTERN\"\r\n\tcase TIME:\r\n\t\treturn \"TIME\"\r\n\tcase VARIABLE:\r\n\t\treturn \"VARIABLE\"\r\n\tcase FUNCTION:\r\n\t\treturn \"FUNCTION\"\r\n\tcase SEPARATOR:\r\n\t\treturn \"SEPARATOR\"\r\n\tcase COMPARATOR:\r\n\t\treturn \"COMPARATOR\"\r\n\tcase LOGICALOP:\r\n\t\treturn \"LOGICALOP\"\r\n\tcase MODIFIER:\r\n\t\treturn \"MODIFIER\"\r\n\tcase CLAUSE:\r\n\t\treturn \"CLAUSE\"\r\n\tcase CLAUSE_CLOSE:\r\n\t\treturn \"CLAUSE_CLOSE\"\r\n\tcase TERNARY:\r\n\t\treturn \"TERNARY\"\r\n\t}\r\n\r\n\treturn \"UNKNOWN\"\r\n}",
"func (t TokenKind) String() string {\n\treturn [...]string{\n\t\t\"COMMENT\",\n\t\t\"CHAR\",\n\t\t\"WORD\"}[t]\n}",
"func getTokenString(name string, value string) string {\n\tif len(value) == 0 {\n\t\treturn name\n\t}\n\n\treturn fmt.Sprintf(\"%s=%s\", name, value)\n}",
"func (t OAuthToken) String() string {\n\treturn t.RawToken\n}",
"func (m *Manager) DebugToken() string {\n\tclaims := jwt.MapClaims{\n\t\t\"aud\": \"globber\",\n\t\t\"exp\": time.Now().Add(time.Hour * 1).Unix(),\n\t\t\"sub\": \"-1\",\n\t\t\"name\": \"superuser\",\n\t}\n\n\ttoken := jwt.NewWithClaims(signingMethod, claims)\n\ttokenString, err := token.SignedString(m.signingSecret)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn tokenString\n}",
"func (ut UserToken) String() string {\n\treturn hex.EncodeToString(ut[:])\n}",
"func (t *Token) ToString() string {\n\treturn t.tokenType + \" \" + t.lexeme + \" \" + string(t.line)\n}",
"func (t *Token) Symbol() string { return t.tk.Symbol }",
"func (ft FixedToken) GetToken() (string, error) { return string(ft), nil }",
"func TokenName(t TokenType) string {\n\tr := \"unknown\"\n\tswitch t {\n\tcase LPAREN:\n\t\tr = \"LPAREN\"\n\tcase RPAREN:\n\t\tr = \"RPAREN\"\n\tcase MINUS:\n\t\tr = \"MINUS\"\n\tcase PLUS:\n\t\tr = \"PLUS\"\n\tcase MULT:\n\t\tr = \"MULT\"\n\tcase DIVIDE:\n\t\tr = \"DIVIDE\"\n\tcase CONSTANT:\n\t\tr = \"CONSTANT\"\n\tcase EOL:\n\t\tr = \"EOL\"\n\tcase EOF:\n\t\tr = \"EOF\"\n\t}\n\treturn r\n}",
"func TokenName(t TokenType) string {\n\tr := \"unknown\"\n\tswitch t {\n\tcase LPAREN:\n\t\tr = \"LPAREN\"\n\tcase RPAREN:\n\t\tr = \"RPAREN\"\n\tcase NOT:\n\t\tr = \"NOT\"\n\tcase AND:\n\t\tr = \"AND\"\n\tcase OR:\n\t\tr = \"OR\"\n\tcase IMPLIES:\n\t\tr = \"IMPLIES\"\n\tcase EQUIV:\n\t\tr = \"EQUIV\"\n\tcase IDENT:\n\t\tr = \"IDENT\"\n\tcase EOL:\n\t\tr = \"EOL\"\n\tcase EOF:\n\t\tr = \"EOF\"\n\t}\n\treturn r\n}",
"func (s Symbols) String() string {\n\treturn fmt.Sprintf(\"Info: %s Success: %s Warning: %s Error: %s\", s.Info, s.Success, s.Warning, s.Error)\n}",
"func (p *syncToken) String() string {\n\tposStr := make([]string, len(p.Positions))\n\tfor i := range p.Positions {\n\t\tposStr[i] = strconv.FormatInt(int64(p.Positions[i]), 10)\n\t}\n\n\treturn fmt.Sprintf(\"%s%s\", p.Type, strings.Join(posStr, \"_\"))\n}",
"func (f *function) String() string {\n\treturn fmt.Sprintf(\"ecal.function: %v (%v)\", f.name, f.declaration.Token.PosString())\n}",
"func (approval *TokenAllowance) String() string {\n\tvar owner string\n\tvar spender string\n\tvar token string\n\n\tif approval.OwnerAccountID != nil {\n\t\towner = approval.OwnerAccountID.String()\n\t}\n\n\tif approval.SpenderAccountID != nil {\n\t\tspender = approval.SpenderAccountID.String()\n\t}\n\n\tif approval.TokenID != nil {\n\t\ttoken = approval.TokenID.String()\n\t}\n\n\treturn fmt.Sprintf(\"OwnerAccountID: %s, SpenderAccountID: %s, TokenID: %s, Amount: %s\", owner, spender, token, HbarFromTinybar(approval.Amount).String())\n}",
"func (err SyntaxError) Token() string {\n\treturn err.token\n}",
"func (this OperatorSymbol) String() string {\n\n\tswitch this {\n\tcase NOOP:\n\t\treturn \"NOOP\"\n\tcase VALUE:\n\t\treturn \"VALUE\"\n\tcase EQ:\n\t\treturn \"=\"\n\tcase NEQ:\n\t\treturn \"!=\"\n\tcase GT:\n\t\treturn \">\"\n\tcase LT:\n\t\treturn \"<\"\n\tcase GTE:\n\t\treturn \">=\"\n\tcase LTE:\n\t\treturn \"<=\"\n\tcase REQ:\n\t\treturn \"=~\"\n\tcase NREQ:\n\t\treturn \"!~\"\n\tcase AND:\n\t\treturn \"&&\"\n\tcase OR:\n\t\treturn \"||\"\n\tcase IN:\n\t\treturn \"in\"\n\tcase BITWISE_AND:\n\t\treturn \"&\"\n\tcase BITWISE_OR:\n\t\treturn \"|\"\n\tcase BITWISE_XOR:\n\t\treturn \"^\"\n\tcase BITWISE_LSHIFT:\n\t\treturn \"<<\"\n\tcase BITWISE_RSHIFT:\n\t\treturn \">>\"\n\tcase PLUS:\n\t\treturn \"+\"\n\tcase MINUS:\n\t\treturn \"-\"\n\tcase MULTIPLY:\n\t\treturn \"*\"\n\tcase DIVIDE:\n\t\treturn \"/\"\n\tcase MODULUS:\n\t\treturn \"%\"\n\tcase EXPONENT:\n\t\treturn \"**\"\n\tcase NEGATE:\n\t\treturn \"-\"\n\tcase INVERT:\n\t\treturn \"!\"\n\tcase BITWISE_NOT:\n\t\treturn \"~\"\n\tcase TERNARY_TRUE:\n\t\treturn \"?\"\n\tcase TERNARY_FALSE:\n\t\treturn \":\"\n\tcase COALESCE:\n\t\treturn \"??\"\n\t}\n\treturn \"\"\n}",
"func (k SymbolTag) String() string {\n\tswitch k {\n\tcase SymbolTagDeprecated:\n\t\treturn \"Deprecated\"\n\tdefault:\n\t\treturn strconv.FormatFloat(float64(k), 'f', -10, 64)\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Literal documents plaintext values of a token Uses special symbols and expressions, as used in a rule
|
func (t Token) Literal() string {
switch t {
case TokIdentifier, TokIdentifierWithWildcard:
return "keywords"
case TokIdentifierAll:
return "them"
case TokSepLpar:
return "("
case TokSepRpar:
return ")"
case TokSepPipe:
return "|"
case TokOpEq:
return "="
case TokOpGt:
return ">"
case TokOpGte:
return ">="
case TokOpLt:
return "<"
case TokOpLte:
return "<="
case TokKeywordAnd:
return "and"
case TokKeywordOr:
return "or"
case TokKeywordNot:
return "not"
case TokStAll:
return "all of"
case TokStOne:
return "1 of"
case TokLitEof, TokNil:
return ""
default:
return "Err"
}
}
|
[
"func (es *ExpressionStatementNode) TokenLiteral() string { return es.Token.Literal }",
"func (ie *InfixExpressionNode) TokenLiteral() string { return ie.Token.Literal }",
"func (ps *MartStatement) TokenLiteral() string { return ps.Token.Literal }",
"func (fl *FunctionLiteralNode) TokenLiteral() string { return fl.Token.Literal }",
"func (b *BooleanNode) TokenLiteral() string { return b.Token.Literal }",
"func (ls *LetStatementNode) TokenLiteral() string { return ls.Token.Literal }",
"func (i *IdentifierNode) TokenLiteral() string { return i.Token.Literal }",
"func (pe *PrefixExpressionNode) TokenLiteral() string { return pe.Token.Literal }",
"func (sn *StringLiteralNode) TokenLiteral() string { return sn.Token.Literal }",
"func (ce *CallExpressionNode) TokenLiteral() string { return ce.Token.Literal }",
"func Literal(cfg *Config, word *syntax.Word) (string, error) {\n\tif word == nil {\n\t\treturn \"\", nil\n\t}\n\tcfg = prepareConfig(cfg)\n\tfield, err := cfg.wordField(word.Parts, quoteNone)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn cfg.fieldJoin(field), nil\n}",
"func (il *IntegerLiteralNode) TokenLiteral() string { return il.Token.Literal }",
"func (cs *LabelStatement) TokenLiteral() string { return cs.Token.Literal }",
"func (bs *BlockStatementNode) TokenLiteral() string { return bs.Token.Literal }",
"func (ie *IfExpressionNode) TokenLiteral() string { return ie.Token.Literal }",
"func (ss *SwitchStatement) TokenLiteral() string { return ss.Token.Literal }",
"func (rs *ReturnStatementNode) TokenLiteral() string { return rs.Token.Literal }",
"func (pe *PrimeExpr) SetLiteral(literal []rune) { pe.Literal = string(literal) }",
"func (is *IfStatement) TokenLiteral() string { return is.Token.Literal }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
validTokenSequence detects invalid token sequences not meant to be a perfect validator, simply a quick check before parsing
|
func validTokenSequence(t1, t2 Token) bool {
switch t2 {
case TokStAll, TokStOne:
switch t1 {
case TokBegin, TokSepLpar, TokKeywordAnd, TokKeywordOr, TokKeywordNot:
return true
}
case TokIdentifierAll:
switch t1 {
case TokStAll, TokStOne:
return true
}
case TokIdentifier, TokIdentifierWithWildcard:
switch t1 {
case TokSepLpar, TokBegin, TokKeywordAnd, TokKeywordOr, TokKeywordNot, TokStOne, TokStAll:
return true
}
case TokKeywordAnd, TokKeywordOr:
switch t1 {
case TokIdentifier, TokIdentifierAll, TokIdentifierWithWildcard, TokSepRpar:
return true
}
case TokKeywordNot:
switch t1 {
case TokKeywordAnd, TokKeywordOr, TokSepLpar, TokBegin:
return true
}
case TokSepLpar:
switch t1 {
case TokKeywordAnd, TokKeywordOr, TokKeywordNot, TokBegin, TokSepLpar:
return true
}
case TokSepRpar:
switch t1 {
case TokIdentifier, TokIdentifierAll, TokIdentifierWithWildcard, TokSepLpar, TokSepRpar:
return true
}
case TokLitEof:
switch t1 {
case TokIdentifier, TokIdentifierAll, TokIdentifierWithWildcard, TokSepRpar:
return true
}
case TokSepPipe:
switch t1 {
case TokIdentifier, TokIdentifierAll, TokIdentifierWithWildcard, TokSepRpar:
return true
}
}
return false
}
|
[
"func TestParserSequenceErr(t *testing.T) {\n\tt.Run(\"UnexpectedTokenTermExact\", func(t *testing.T) {\n\t\tpr := parser.NewParser()\n\t\tlx := newLexer(\"foo\")\n\t\texpectedKind := parser.FragmentKind(100)\n\t\tmainFrag, err := pr.Parse(lx, &parser.Rule{\n\t\t\tDesignation: \"foobar\",\n\t\t\tPattern: parser.Sequence{\n\t\t\t\tparser.TermExact{\n\t\t\t\t\tKind: TestFrBar,\n\t\t\t\t\tExpectation: []rune(\"bar\"),\n\t\t\t\t},\n\t\t\t\ttestR_foo,\n\t\t\t},\n\t\t\tKind: expectedKind,\n\t\t})\n\n\t\trequire.Error(t, err)\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\t\"unexpected token 'f', expected {'bar'} at test.txt:1:1\",\n\t\t\terr.Error(),\n\t\t)\n\t\trequire.Nil(t, mainFrag)\n\t})\n\tt.Run(\"UnexpectedTokenChecked\", func(t *testing.T) {\n\t\tpr := parser.NewParser()\n\t\tlx := newLexer(\"foo foo\")\n\t\texpectedKind := parser.FragmentKind(100)\n\t\tmainFrag, err := pr.Parse(lx, &parser.Rule{\n\t\t\tDesignation: \"foobar\",\n\t\t\tPattern: parser.Sequence{\n\t\t\t\ttestR_foo,\n\t\t\t\tparser.Term(misc.FrSpace),\n\t\t\t\tparser.Checked{\n\t\t\t\t\tDesignation: \"checked token\",\n\t\t\t\t\tFn: func(str []rune) bool {\n\t\t\t\t\t\treturn rncmp(str, []rune(\"bar\"))\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tKind: expectedKind,\n\t\t})\n\n\t\trequire.Error(t, err)\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\t\"unexpected token 'foo', expected {checked token} at test.txt:1:5\",\n\t\t\terr.Error(),\n\t\t)\n\t\trequire.Nil(t, mainFrag)\n\t})\n}",
"func isValidToken(token string) (bool, error) {\n\t// Minimum length is dummy, maximum from documentation\n\t// Source: https://cloud.google.com/iam/docs/reference/sts/rest/v1/TopLevel/token#response-body\n\tconst minSize, maxSize = 100, 12288\n\tif len(token) < minSize || len(token) > maxSize {\n\t\treturn false, fmt.Errorf(\"invalid token size, assert %d <= %d <= %d\",\n\t\t\tminSize, len(token), maxSize)\n\t}\n\tif !tokenMatch(token) {\n\t\treturn false, fmt.Errorf(\"token failed validation against %q\", tokenRegex)\n\t}\n\treturn true, nil\n}",
"func validate(seqSet *SequenceSet) error {\n\tif len(seqSet.Seqs) == 0 {\n\t\treturn errors.New(\"no sequence is found\")\n\t}\n\tif len(seqSet.Seqs) > maxSequencePerFile {\n\t\treturn fmt.Errorf(\"too many sequences are found: %d > %d\",\n\t\t\tlen(seqSet.Seqs), maxSequencePerFile)\n\t}\n\n\texpectedChars := map[rune]bool{\n\t\t'T': true,\n\t\t'C': true,\n\t\t'G': true,\n\t\t'A': true,\n\t}\n\tfor _, seq := range seqSet.Seqs {\n\t\tif len(seq) == 0 {\n\t\t\treturn errors.New(\"sequence must have at least one character\")\n\t\t}\n\t\tif len(seq) > maxLengthPerSeq {\n\t\t\treturn fmt.Errorf(\"too long sequence found: %d > %d\", len(seq), maxLengthPerSeq)\n\t\t}\n\t\tfor _, c := range seq {\n\t\t\tif !expectedChars[c] {\n\t\t\t\treturn fmt.Errorf(\"unexpected character %c\", c)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}",
"func IsDeviceTokenValid(s string) bool {\n\t// TODO: In 2016, they may be growing up to 100 bytes (200 hexadecimal digits).\n\tif len(s) < 64 || len(s) > 200 {\n\t\treturn false\n\t}\n\t_, err := hex.DecodeString(s)\n\treturn err == nil\n}",
"func IsValidToken(token string) bool {\n\n\tif len(token) < 3 {\n\t\treturn false\n\t}\n\n\titem := strings.ToLower(token)\n\tfor _, alphabet := range item {\n\t\tif alphabet < 'a' || alphabet > 'z' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func TokenHasValidFormat(t Token) bool {\n\treturn tokenFormat.Match([]byte(t))\n}",
"func IsTokenValid(tok string) (id int) {\n\tgetId := fmt.Sprintf(\"select id from %s where auth_token='%s'\", dbCfg.Token, tok)\n\n\t// Execute the query to get id\n\terr = db.QueryRow(getId).Scan(&id)\n\tif cmn.IsError(err) {\n\t\tid = 0\n\t}\n\treturn\n}",
"func ValidKeyToken(s string) bool {\n\tif !utf8.ValidString(s) {\n\t\treturn false\n\t}\n\tfor _, r := range s {\n\t\tif !unicode.IsPrint(r) || r == unicode.ReplacementChar {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func checkValid(data []byte, scan *scanner) error {\n\tscan.reset()\n\tfor _, c := range data {\n\t\tscan.bytes++\n\t\tv := scan.step(scan, int(c))\n\t\tif v == scanError {\n\t\t\treturn scan.err\n\t\t}\n\t}\n\tif scan.eof() == scanError {\n\t\treturn scan.err\n\t}\n\treturn nil\n}",
"func (st MajorStatus) UnseqToken() bool {\n\treturn st&field_GSS_S_UNSEQ_TOKEN != 0\n}",
"func isTokenValid(ovirt *Ovirt) bool {\n\tresp, err := ovirt.clientDo(http.MethodGet, ovirt.Connection.Url, strings.NewReader(\"\"))\n\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode > 200 {\n\t\treturn false\n\t}\n\treturn true\n}",
"func isTokenValid(token string) (expired bool) {\n\t// Parse token\n\tclaims := jwt.MapClaims{}\n\n\tparsedToken, _, err := new(jwt.Parser).ParseUnverified(token, claims)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\terr = parsedToken.Claims.Valid()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn true\n}",
"func ValidKeyTokens(name string, tags Tags) bool {\n\tif !ValidKeyToken(name) {\n\t\treturn false\n\t}\n\tfor _, tag := range tags {\n\t\tif !ValidKeyToken(string(tag.Key)) || !ValidKeyToken(string(tag.Value)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func (l *lexer) addInvalidToken(t token.Token) {\n\tl.addToken(t, false)\n}",
"func tok_expect(s []byte) {\n\tif tok_jmp(s) != 0 {\n\t\t// check the next token\n\t\tnoarch.Fprintf(noarch.Stderr, []byte(\"neateqn: expected %s bot got %s\\n\\x00\"), s, tok_get())\n\t\tnoarch.Exit(1)\n\t}\n}",
"func validateStackSequences(pushed []int, popped []int) bool {\n\n\tstack := make([]int, 0)\n\tpopindex := 0\n\tfor _, item := range pushed {\n\t\tstack = append(stack, item)\n\t\tfor len(stack) != 0 && stack[len(stack)-1] == popped[popindex] {\n\t\t\tstack = stack[:len(stack)-1]\n\t\t\tpopindex++\n\t\t}\n\t}\n\treturn len(stack) == 0\n}",
"func (env *Env) ValidToken(req *http.Request) bool {\n\tif !env.token.Valid(env.lock.MaxTokenAge) {\n\t\tfmt.Println(env.token.Timestamp, \"To Old\")\n\t\tenv.lock.Close()\n\t\treturn false\n\t}\n\tauthSuccess := env.token.Data == req.Header.Get(\"Authorization\")\n\tif authSuccess {\n\t\tenv.lock.FailedAuthAttempts = 0\n\t} else {\n\t\tenv.lock.RegisterFail()\n\t}\n\treturn authSuccess\n}",
"func (g *GramSequencer) GenerateValidSequences() error {\n var newGrams []string\n\n // special handling for characters of length of \"1\"\n if len(g.Sequence) > 0 && len(g.Sequence) == 1 {\n newGrams = append(newGrams, g.Sequence)\n g.populateValidSequenceMap(newGrams)\n\n } else if len(g.Sequence) == 2 {\n newGrams = make([]string, 2)\n newGrams = append(newGrams, g.Sequence)\n newGrams = append(newGrams, fmt.Sprintf(\"%v%v\", g.Sequence[1:], g.Sequence[0:1]))\n g.populateValidSequenceMap(newGrams)\n\n } else {\n newGrams, err := g.shuffleRule.Shuffle(g.Sequence)\n if err != nil {\n return err\n }\n if len(newGrams) == 0 {\n return fmt.Errorf(\"length of the words created after the shuffle should be at least 1~ [%v]\", g.Sequence)\n }\n err = g.populateValidSequenceMap(newGrams)\n if err != nil {\n return err\n }\n }\n return nil\n}",
"func TestLexerTokenize(t *testing.T) {\n\n\t// Positive test cases\n\tfor _, test := range lexerTokenizeTestsPositive {\n\n\t\tactual, _ := Tokenize(strings.NewReader(test.input), false)\n\n\t\tif len(actual) < 1 {\n\t\t\tt.Errorf(\"Tokenize(%s): Returned no tokens\", test.input)\n\t\t}\n\n\t\tif len(actual) != len(test.expected) {\n\t\t\tt.Errorf(\"Lexer(%s): expected %v, actual %v\", test.input, test.expected, actual)\n\t\t} else {\n\t\t\tfor i := 0; i < len(actual); i++ {\n\t\t\t\tif !reflect.DeepEqual(test.expected[i], actual[i]) {\n\t\t\t\t\tt.Errorf(\"Lexer(%s): expected %v, actual %v\", test.input, test.expected, actual)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Negative test cases\n\tfor _, test := range lexerTokenizeNegativeTests {\n\t\t_, actual := Tokenize(strings.NewReader(test.input), false)\n\n\t\tif actual == nil {\n\t\t\tt.Errorf(\"Tokenize(%s): Expected error, but was nil\", test.input)\n\t\t}\n\n\t\tif !reflect.DeepEqual(test.expected, actual) {\n\t\t\tt.Errorf(\"Tokenize(%s): Expected error '%s', but got error '%s'\", test.input, test.expected, actual)\n\t\t}\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewRTM returns a RTM, which provides a fully managed connection to Slack's websocketbased RealTime Messaging protocol.
|
func newRTM(api *Client) *RTM {
return &RTM{
Client: *api,
pings: make(map[int]time.Time),
IncomingEvents: make(chan SlackEvent, 50),
outgoingMessages: make(chan OutgoingMessage, 20),
}
}
|
[
"func (m *MockSlackAPI) NewRTM() *slack.RTM {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NewRTM\")\n\tret0, _ := ret[0].(*slack.RTM)\n\treturn ret0\n}",
"func NewSlackRTMController(ctx context.Context) *controller.SlackRTMController {\n\treturn &controller.SlackRTMController{\n\t\tInteractor: &usecase.ChatInteractor{\n\t\t\tGitInfrastructure: &github.GitInfrastructure{\n\t\t\t\tClient: &http.Client{Timeout: time.Duration(10) * time.Second},\n\t\t\t\tUser: ghUser,\n\t\t\t\tToken: ghToken,\n\t\t\t\tLogger: &Logger{},\n\t\t\t},\n\t\t\tDatabaseInfrastructure: &mysql.DatabaseInfrastructure{\n\t\t\t\tDB: db,\n\t\t\t\tLogger: &Logger{},\n\t\t\t},\n\t\t\tChatInfrastructure: &slackrepo.ChatInfrastructure{\n\t\t\t\tClient: slackClient,\n\t\t\t\tChannel: slackDefaultChannel,\n\t\t\t\tLogger: &Logger{},\n\t\t\t},\n\t\t\tCalendarInfrastructure: &googlecalendar.CalendarInfrastructure{\n\t\t\t\tID: calendarID,\n\t\t\t\tService: calendarService,\n\t\t\t\tLogger: &Logger{},\n\t\t\t},\n\t\t\tImageInfrastructure: &image.ImageInfrastructure{\n\t\t\t\tPath: currentPath + \"/images\",\n\t\t\t},\n\t\t\tLogger: &Logger{},\n\t\t},\n\t\tLogger: &Logger{},\n\t}\n}",
"func New(c *config.Config, slack *slackApp.SlackListener) (*SlackBot, error) {\n\t//TODO add validation\n\tclient := slackapi.New(c.BotToken)\n\trtm := client.NewRTM()\n\treturn &SlackBot{rtm: rtm, slack: slack}, nil\n}",
"func (mr *MockSlackAPIMockRecorder) NewRTM() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"NewRTM\", reflect.TypeOf((*MockSlackAPI)(nil).NewRTM))\n}",
"func New(config Config) (node *RaftNode) {\n\n\t// register object type, so as to send via Inbox\n\tgob.Register(AppendEntriesReqEv{})\n\tgob.Register(AppendEntriesRespEv{})\n\tgob.Register(VoteReqEv{})\n\tgob.Register(VoteRespEv{})\n\n\tvar rnode *RaftNode = new(RaftNode) // objectinstance\n\trnode.nodeId = config.Id // node id\n\trnode.eventCh = make(chan interface{}, 10000) //event channel, get append request from here\n\trnode.timeoutCh = make(chan interface{}, 100000) // timeout channel, get timeout events\n\trnode.commitCh = make(chan CommitInfo, 10000) // commit channel, reply to client\n\n\t// State machine instance\n\trnode.Sm = StateMachine{id: rnode.nodeId,\n\t\tleaderId: -1,\n\t\tState: \"FOLLOWER\",\n\t\tcommitIndex: -1,\n\t\tlastApplied: -1}\n\n\trnode.Sm.currentTerm = 0 // strting term with 0\n\trnode.Sm.votedFor = make(map[int]int) // voted to which node for which term\n\trnode.Sm.nextIndex = make([]int64, 6) // next index of others nodes\n\trnode.Sm.matchedIndex = make([]int64, 6) // matched index to others\n\trnode.Sm.voteCount = make([]int, 2) // success or fail vote count\n\trnode.logDirectory = config.LogDir // my log location\n\trnode.peers = Mcluster.Servers[rnode.nodeId].Peers() // peer id list\n\trnode.electionTimeout = config.ElectionTimeout // timeout\n\trnode.heartbeatTimeout = config.HeartbeatTimeout // timeout\n\trnode.nodeTimer = getNewTimer(rnode.electionTimeout) // handle to timer\n\trnode.server = Mcluster.Servers[rnode.nodeId] // server instance\n\trnode.Sm.log, _ = log.Open(rnode.logDirectory) // node's log\n\trnode.Sm.log.RegisterSampleEntry(Entry{}) // register log entry type\n\terr := rnode.Sm.log.Append(Entry{Term: 0, Command: nil}) // Dummy entry added to log's 0th index\n\t_ = err\n\trnode.Sm.commitIndex = 0 // commit index\n\tfor _, j := range rnode.peers {\n\t\trnode.Sm.nextIndex[j] = rnode.Sm.log.GetLastIndex() + 1 // initializa nextIndex to other node\n\t}\n\treturn rnode // return initialized Raftnode\n}",
"func NewRTMContex(l sync.Locker) *RTMContext {\n\treturn &RTMContext{\n\t\tlock: l,\n\t}\n}",
"func newRaftWrapper(\n\thost host.Host,\n\tcfg *ClusterRaftConfig,\n\tfsm hraft.FSM,\n\trepo repo.LockedRepo,\n\tstaging bool,\n) (*raftWrapper, error) {\n\n\traftW := &raftWrapper{}\n\traftW.config = cfg\n\traftW.host = host\n\traftW.staging = staging\n\traftW.repo = repo\n\t// Set correct LocalID\n\tcfg.RaftConfig.LocalID = hraft.ServerID(host.ID().String())\n\n\tdf := cfg.GetDataFolder(repo)\n\terr := makeDataFolder(df)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = raftW.makeServerConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = raftW.makeTransport()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = raftW.makeStores()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\traftLogger.Debug(\"creating Raft\")\n\traftW.raft, err = hraft.NewRaft(\n\t\tcfg.RaftConfig,\n\t\tfsm,\n\t\traftW.logStore,\n\t\traftW.stableStore,\n\t\traftW.snapshotStore,\n\t\traftW.transport,\n\t)\n\tif err != nil {\n\t\traftLogger.Error(\"initializing raft: \", err)\n\t\treturn nil, err\n\t}\n\n\traftW.ctx, raftW.cancel = context.WithCancel(context.Background())\n\n\treturn raftW, nil\n}",
"func New(accessToken string, client *http.Client) Slack {\n\treturn Slack{\n\t\taccessToken: accessToken,\n\t\tclient: client,\n\t}\n}",
"func NewRaft(peers []*utils.ClientEnd, me int, persister store.Persister, log *store.LogStorage, applyCh chan *ApplyMsg) *Raft {\n\trf := new(Raft)\n\trf.peers = peers\n\trf.me = me\n\trf.applyCh = applyCh\n\n\trf.log = log\n\trf.requestVoteChan = make(chan *RequestVoteSession, 10)\n\trf.appendEntriesCh = make(chan *AppendEntriesSession, 100)\n\trf.shutdownCh = make(chan bool)\n\trf.termChangedCh = make(chan bool, 10)\n\trf.submitedCh = make(chan int, 10)\n\trf.state = makeRaftState(log, persister, applyCh, len(peers), me)\n\n\tglog.Infof(\"%s Created raft instance: %s\", rf, rf.String())\n\tgo rf.startStateMachine()\n\trf.registerDebugHandler()\n\n\treturn rf\n}",
"func NewRaft(listenAddress string, listenPort int, clusterNodes []string) *Raft {\n\traftNode := Raft{\n\t\tlistenTCPPort: listenPort,\n\t\tlistenAddress: listenAddress,\n\t\telectionTimeOut: 10 * time.Second,\n\t\tlastEntry: time.Now().UnixNano(),\n\t\tcurrentTerm: 1,\n\t\tclusterNodes: clusterNodes,\n\t\tvoteRequestCh: make(chan RequestVoteRequest),\n\t\tvotesReceivedCh: make(chan RequestVoteResponse),\n\t\tappendEntriesCh: make(chan AppendEntriesRequest),\n\t\tlastVoteTerm: 0,\n\t}\n\n\t// start raft node as follower\n\traftNode.setState(FOLLOWER)\n\tgo raftNode.listen()\n\tgo raftNode.runFSM()\n\n\treturn &raftNode\n}",
"func NewMultiRaft(nodeID NodeID, config *Config) (*MultiRaft, error) {\n\tif !nodeID.isSet() {\n\t\treturn nil, util.Error(\"Invalid NodeID\")\n\t}\n\terr := config.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif config.Clock == nil {\n\t\tconfig.Clock = RealClock\n\t}\n\n\tm := &MultiRaft{\n\t\tConfig: *config,\n\t\tnodeID: nodeID,\n\t\tEvents: make(chan interface{}, 1000),\n\t\tops: make(chan interface{}, 100),\n\t\trequests: make(chan *rpc.Call, 100),\n\t\tstopped: make(chan struct{}),\n\t}\n\n\terr = m.Transport.Listen(nodeID, m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, nil\n}",
"func NewSlack() (*Slack, error) {\n\tvar s = &Slack{\n\t\tPayload: Payload{},\n\t\tURL: \"\",\n\t}\n\n\tbuf, err := s.readConfigToml()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := toml.Unmarshal(buf, s); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s, nil\n}",
"func NewRhymenConn(timeout time.Duration) (*RhymenConn, error) {\n\twac, err := whatsapp.NewConn(timeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RhymenConn{wac: wac}, nil\n}",
"func (rtdb *RTDB) RTDBNew (hostName string, port int, userName string, password string, defaultDB int, jsonField string) {\n\trtdb.hostName = hostName\n\trtdb.port = port\n\trtdb.userName = userName\n\trtdb.password = password\n\trtdb.defaultDB = defaultDB\n\trtdb.client = nil\n\trtdb.isConnected = false\n\trtdb.jsonField = jsonField\n}",
"func (h *Handler) HandleRTMStart(w http.ResponseWriter, r *http.Request) {\n\tif err := r.ParseForm(); err != nil {\n\t\thttp.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif !h.validateToken(r) {\n\t\thttp.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden)\n\t\treturn\n\t}\n\tvar c slack.RTMStartCall\n\tif err := c.FromValues(r.Form); err != nil {\n\t\thttp.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n\t\treturn\n\t}\n\tvar buf bytes.Buffer\n\tif err := json.NewEncoder(&buf).Encode(StockResponse(\"rtm.start\")); err != nil {\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Set(`Content-Type`, `application/json; charset=utf-8`)\n\tw.WriteHeader(http.StatusOK)\n\tbuf.WriteTo(w)\n}",
"func NewRTMContexDefault() *RTMContext {\n\treturn &RTMContext{\n\t\tlock: new(sync.Mutex),\n\t}\n}",
"func New(endpoint, consumerKey, consumerSecret, accessToken, accessTokenSecret string) (tl *TimelineListen, e error) {\n\ttl = &TimelineListen{\n\t\tclient: initAPI(\n\t\t\tconsumerKey,\n\t\t\tconsumerSecret,\n\t\t\taccessToken,\n\t\t\taccessTokenSecret,\n\t\t),\n\t}\n\tresponse, e := tl.client.Get(\n\t\tendpoint,\n\t\tmap[string]string{},\n\t)\n\ttl.response = response\n\ttl.stream = make(chan Tweet, 1024*100)\n\treturn\n}",
"func NewAPIRtDevice(m *macaron.Macaron) error {\n\n\t//bind := binding.Bind\n\n\tm.Group(\"/api/rt/device\", func() {\n\t\tm.Get(\"/info/\", reqSignedIn, RTGetInfo)\n\t\tm.Get(\"/info/:id\", reqSignedIn, RTGetInfo)\n\t\tm.Put(\"/status/activate/:id\", reqSignedIn, RTActivateDev)\n\t\tm.Put(\"/status/deactivate/:id\", reqSignedIn, RTDeactivateDev)\n\t\tm.Put(\"/debug/activate/:id\", reqSignedIn, RTActSnmpDebugDev)\n\t\tm.Put(\"/debug/deactivate/:id\", reqSignedIn, RTDeactSnmpDebugDev)\n\t\tm.Get(\"/snmpreset/:id/:mode\", reqSignedIn, RTSnmpReset)\n\t\tm.Get(\"/forcegather/:id\", reqSignedIn, RTForceGather)\n\t\tm.Put(\"/log/setloglevel/:id/:level\", reqSignedIn, RTSetLogLevelDev)\n\t\tm.Get(\"/log/getdevicelog/:id\", reqSignedIn, RTGetLogFileDev)\n\t\tm.Get(\"/filter/forcefltupdate/:id\", reqSignedIn, RTForceFltUpdate)\n\t\tm.Get(\"/snmpmaxrep/:id/:maxrep\", reqSignedIn, RTSnmpSetMaxRep)\n\t})\n\n\treturn nil\n}",
"func NewSession(token string) *NeppedSession {\r\n return &NeppedSession{\r\n Token: token,\r\n }\r\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
GetInfo returns the info structure received when calling "startrtm", holding all channels, groups and other metadata needed to implement a full chat client. It will be nonnil after a call to StartRTM().
|
func (rtm *RTM) GetInfo() *Info {
return rtm.info
}
|
[
"func (b *Bot) GetInfo() Info {\n\tb.mx.Lock()\n\tdefer b.mx.Unlock()\n\treturn Info{\n\t\tState: b.state,\n\t\tStarted: b.started,\n\t}\n}",
"func (c *Conductor) GetInfo(ctx context.Context, req *pb.GetInfoRequest) (*pb.GetInfoResponse, error) {\n\tresp := &pb.GetInfoResponse{\n\t\tIsConductor: c.IsRunning(),\n\t}\n\treturn resp, nil\n}",
"func (ch *ClientHandler) GetClientInfo(cConn *net.TCPConn) {\n\n\tmessage := network.Message{\n\t\tType: \"Getinfo\",\n\t\tFrom: ch.id,\n\t}\n\tmessageByte, err := json.Marshal(message)\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n\t_, err = cConn.Write(messageByte)\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n}",
"func GetInfo(ctx context.Context) *ServerInfo {\n\tif v := ctx.Value(serverInfoKey{}); v != nil {\n\t\treturn v.(*ServerInfo)\n\t}\n\treturn nil\n}",
"func loadInfo() {\n\tinfo = &slack.RTMStartReply{}\n\tchannels, err := s.ChannelList(false)\n\tcheck(err)\n\tinfo.Channels = channels.Channels\n\tgroups, err := s.GroupList(false)\n\tcheck(err)\n\tinfo.Groups = groups.Groups\n\tims, err := s.IMList()\n\tcheck(err)\n\tinfo.IMS = ims.IMs\n\tusers, err := s.UserList()\n\tcheck(err)\n\tinfo.Users = users.Members\n}",
"func (s *Session) GetInfoReply() *xmpp.DiscoveryReply {\n\treply := xmpp.DiscoveryReply{\n\t\tNode: NODE, // add verification string later\n\t\tIdentities: []xmpp.DiscoveryIdentity{\n\t\t\t{\n\t\t\t\tCategory: \"client\",\n\t\t\t\tType: \"pc\",\n\t\t\t\tName: BOTNAME,\n\t\t\t},\n\t\t},\n\t\tFeatures: []xmpp.DiscoveryFeature{\n\t\t\t{Var: \"http://jabber.org/disco#info\"},\n\t\t\t{Var: \"http://jabber.org/protocol/caps\"},\n\t\t\t{Var: \"http://jabber.org/protocol/muc\"},\n\t\t\t{Var: \"jabber:iq:time\"},\n\t\t\t{Var: \"jabber:iq:version\"},\n\t\t\t{Var: \"urn:xmpp:ping\"},\n\t\t\t{Var: \"urn:xmpp:time\"},\n\t\t},\n\t}\n\tif vstr, err := reply.VerificationString(); err == nil {\n\t\treply.Node = NODE + \"#\" + vstr\n\t}\n\treturn &reply\n}",
"func (c *Client) Info() *models.Info {\n\treturn c.FeatureMap().Dcdr.Info\n}",
"func (gateway *Gateway) Info() (*InfoMsg, error) {\n\treq, ch := newRequest(\"info\")\n\tgateway.send(req, ch)\n\n\tmsg := <-ch\n\tswitch msg := msg.(type) {\n\tcase *InfoMsg:\n\t\treturn msg, nil\n\tcase *ErrorMsg:\n\t\treturn nil, msg\n\t}\n\n\treturn nil, unexpected(\"info\")\n}",
"func getInfo() {\n\topts := []grpc.DialOption{grpc.WithInsecure()}\n\tfmt.Println(\"Connecting to server...\")\n\tconn, err := grpc.Dial(*serverAddr, opts...)\n\tbail(err, \"failed to dial\")\n\n\tdefer conn.Close()\n\tctx := context.Background()\n\tclient := pb.NewBuildRepoManagerClient(conn)\n\tglv := &pb.GetLatestVersionRequest{\n\t\tRepository: *reponame,\n\t\tBranch: *branchname,\n\t}\n\tglr, err := client.GetLatestVersion(ctx, glv)\n\tbail(err, \"failed to get latest version\")\n\tfmt.Printf(\"Latest Version: %d\\n\", glr.BuildID)\n}",
"func (c *Client) GetInfo() (*AgentInfo, error) {\n\tresponse, err := processRequest(string(\"/info\"), &AgentInfo{}, nil, \"GET\")\n\treturn response.(*AgentInfo), err\n}",
"func (s *Server) ServerInfo() *ServerInfo {\n\tinfo := &ServerInfo{\n\t\tMethods: []string{\"*\"},\n\t\tMetrics: make(map[string]any),\n\t\tStartTime: s.start,\n\t}\n\tserverMetrics.Do(func(kv expvar.KeyValue) {\n\t\tinfo.Metrics[kv.Key] = json.RawMessage(kv.Value.String())\n\t})\n\tif n, ok := s.mux.(Namer); ok {\n\t\tinfo.Methods = n.Names()\n\t}\n\treturn info\n}",
"func (c *DockerClient) Info(ctx context.Context) (types.Info, error) {\n\tvar err error\n\tdockerInfoOnce.Do(func() {\n\t\tdockerInfo, err = c.Client.Info(ctx)\n\t\tif err != nil {\n\t\t\t// reset the state of the sync.Once so that the next call to Info will try again\n\t\t\tdockerInfoOnce = sync.Once{}\n\t\t\treturn\n\t\t}\n\n\t\tinfoMessage := `%v - Connected to docker: \n Server Version: %v\n API Version: %v\n Operating System: %v\n Total Memory: %v MB\n Resolved Docker Host: %s\n Resolved Docker Socket Path: %s\n`\n\n\t\tLogger.Printf(infoMessage, packagePath,\n\t\t\tdockerInfo.ServerVersion, c.Client.ClientVersion(),\n\t\t\tdockerInfo.OperatingSystem, dockerInfo.MemTotal/1024/1024,\n\t\t\ttestcontainersdocker.ExtractDockerHost(ctx),\n\t\t\ttestcontainersdocker.ExtractDockerSocket(ctx),\n\t\t)\n\t})\n\n\treturn dockerInfo, err\n}",
"func (nc NSQDCollector) GetInfo() (Info, error) {\n\tvar info Info\n\n\tbody, err := nc.GetFetcher().Fetch(\"info\")\n\tif err != nil {\n\t\treturn info, err\n\t}\n\n\terr = json.Unmarshal(body, &info)\n\tif err != nil {\n\t\treturn info, err\n\t}\n\n\tif info.StatusCode != 200 {\n\t\treturn info, fmt.Errorf(\"response code was %d\", info.StatusCode)\n\t}\n\n\treturn info, nil\n}",
"func (this *LongLiveConn) GetMultiInfo(infoType string, ids []int64, sparameter []byte) bool {\n\tif len(infoType) == 0 {\n\t\treturn false\n\t}\n\treturn this.queueMessage(this.makeGetMulInfo(infoType, ids, sparameter))\n}",
"func GetInfo(node *node.Node) accessory.Info {\n\treturn accessory.Info{\n\t\tName: node.Name,\n\t\tSerialNumber: node.SerialNumber,\n\t\tManufacturer: node.Manufacturer,\n\t\tModel: node.Model,\n\t\tFirmwareRevision: \"0.0\",\n\t}\n}",
"func showInfo(c *cli.Context, w io.Writer) error {\n\terr := checkArgCount(c, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient.Photonclient, err = client.GetClient(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo, err := client.Photonclient.Info.Get()\n\n\tif utils.NeedsFormatting(c) {\n\t\tutils.FormatObject(info, w, c)\n\t} else {\n\t\tfmt.Printf(\"Version: '%s'\\n\", info.FullVersion)\n\t\tfmt.Printf(\"Network Type: '%s'\\n\", info.NetworkType)\n\t}\n\n\treturn nil\n}",
"func (node *Iridiumd) GetInfo() (map[string]interface{}, error) {\n\tresp, err := node.makeGetRequest(\"getinfo\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp.(map[string]interface{}), nil\n}",
"func handleGetInfo(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {\n\tret := &rpcmodel.InfoDAGResult{\n\t\tVersion: version.Version(),\n\t\tProtocolVersion: int32(maxProtocolVersion),\n\t\tBlocks: s.cfg.DAG.BlockCount(),\n\t\tConnections: s.cfg.ConnMgr.ConnectedCount(),\n\t\tProxy: config.ActiveConfig().Proxy,\n\t\tDifficulty: getDifficultyRatio(s.cfg.DAG.CurrentBits(), s.cfg.DAGParams),\n\t\tTestnet: config.ActiveConfig().Testnet,\n\t\tDevnet: config.ActiveConfig().Devnet,\n\t\tRelayFee: config.ActiveConfig().MinRelayTxFee.ToKAS(),\n\t}\n\n\treturn ret, nil\n}",
"func (res *UDP) GetInfo() *string {\n\ttmp := fmt.Sprintf(\"%s:%s:%d\", TypeUDP, res.ip, res.port)\n\treturn &tmp\n}",
"func (c *Client) info() (Info, error) {\n\tu := fmt.Sprintf(\"%s/api/v1/info\", c.atcurl)\n\tvar info Info\n\n\tr, err := c.conn.Get(u)\n\tif err != nil {\n\t\treturn info, err\n\t}\n\tif r.StatusCode != 200 {\n\t\treturn info, fmt.Errorf(\"could not get info from Concourse: status code %d\", r.StatusCode)\n\t}\n\tjson.NewDecoder(r.Body).Decode(&info)\n\n\treturn info, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Validate validates this o b write payment details response1
|
func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateLinks(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLocalInstrument(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReason(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReasonDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentTransactionID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusDetail(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusUpdateDateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (pa *Payment) VerifyCustomerForPayment(body ValidateCustomerRequest) (ValidateCustomerResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyCustomerForPaymentResponse ValidateCustomerResponse\n\t )\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/payment/customer/validation\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return ValidateCustomerResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyCustomerForPaymentResponse)\n if err != nil {\n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n return verifyCustomerForPaymentResponse, nil\n \n }",
"func (m *Payment) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAccount(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateChanges(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankAddress(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCity(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCode(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCurrency(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateKid(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePostings(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateReceiverReference(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSourceVoucher(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *PaymentMethodResponse) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateExpiryDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastIdentifyTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastSuccessChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLockExpiresAt(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateValidFromDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *CreditCardResponse) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateErrors(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *GetReleaseDetailV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *GetVersionDetailV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (h *Contract) PostPaymentAct(w http.ResponseWriter, r *http.Request) {\n\t// Initial response handler\n\tvar res response.OrderPaymentResponse\n\n\t// Binding request\n\treq := request.OrderPaymentReq{}\n\tif err := h.Bind(r, &req); err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Validate request of struct request\n\tif err := h.Validator.Driver.Struct(req); err != nil {\n\t\th.SendRequestValidationError(w, err.(validator.ValidationErrors))\n\t\treturn\n\t}\n\n\t// Check db context\n\tctx := context.Background()\n\tdb, err := h.DB.Acquire(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\tdefer db.Release()\n\n\t// Model db transaction\n\tm := model.Contract{App: h.App}\n\ttx, err := db.Begin(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Check paid by order\n\tmemberCode := h.GetUserCode(r.Context())\n\tmember, _ := m.GetMemberByCode(db, ctx, memberCode)\n\tif member.ID == 0 {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Member %s not found.\", memberCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Check order data exist\n\torderExist, _ := m.GetOrderByOrderCode(db, ctx, req.OrderCode)\n\tif orderExist.ID == 0 {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Order %s not found.\", req.OrderCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Check paid by order by request auth\n\tif member.ID != orderExist.PaidBy {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Order paid by %s is invalid.\", memberCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Create order payment default set expired date\n\torderPaymentSetter := model.OrderPaymentEnt{\n\t\tOrderID: orderExist.ID,\n\t\tAmount: int64(req.Amount),\n\t\tPaymentStatus: model.PAYMENT_STATUS_PROCESS,\n\t}\n\n\t// Update url snap url midtrans\n\tpaymentService := payment.New(h.App)\n\torderCode := orderExist.OrderCode\n\torderAmount := int64(req.Amount)\n\tparamMidtrans := paymentService.SetMidtransParam(member.Email, member.Name, orderCode, orderAmount)\n\tmidtransResponse, err := paymentService.GetMidtransPaymentURL(paramMidtrans)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tif midtransResponse[\"redirect_url\"] == \"\" {\n\t\th.SendBadRequest(w, \"failed to get snap url midtrans.\")\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\torderPaymentSetter.PaymentURL = midtransResponse[\"redirect_url\"]\n\n\t// Check order payment exist then saved, if exist = renew payment\n\torderPaymentSaved := model.OrderPaymentEnt{}\n\torderPayment, _ := m.GetPaymentOrderByOrderID(db, ctx, orderExist.ID)\n\tif orderPayment.ID != 0 {\n\t\torderPaymentSetter.PaymentType = orderPayment.PaymentType\n\t\torderPaymentSetter.ExpiredDate = orderPayment.ExpiredDate\n\t\torderPaymentSetter.Payloads = orderPayment.Payloads\n\t\torderPaymentSaved, err = m.UpdateOrderPayment(tx, ctx, orderPaymentSetter, orderExist.ID)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\torderPaymentSaved.CreatedDate = orderPayment.CreatedDate\n\t\torderPaymentSaved.ExpiredDate = orderPayment.ExpiredDate\n\t} else {\n\t\torderPaymentSaved, err = m.AddOrderPayment(db, ctx, tx, orderPaymentSetter)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t}\n\torderPaymentSaved.OrderCode = orderExist.OrderCode\n\n\t// Activity user logging in process\n\tlog := model.LogActivityUserEnt{\n\t\tUserID: int64(member.ID),\n\t\tRole: h.GetUserRole(r.Context()),\n\t\tTitle: \"Update Order\",\n\t\tActivity: fmt.Sprintf(\"Update Order Payment Trip Itin For %s\", member.Name),\n\t\tEventType: r.Method,\n\t}\n\t_, err = m.AddLogActivity(tx, ctx, log)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Send Notifications - To User (Admin, TC)\n\tuserPlayers, err := m.GetListPlayerByUserCodeAndRole(db, ctx, \"\", \"\")\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tnotifContentUser := model.NotificationContent{\n\t\tSubject: model.NOTIF_SUBJ_ORDER_HISTORY,\n\t\tTripName: orderExist.MemberItin.Title,\n\t\tStatusPayment: model.PAYMENT_STATUS_PROCESS_METHOD_DESC,\n\t}\n\t_, err = m.SendNotifications(tx, db, ctx, userPlayers, notifContentUser)\n\tif err != nil {\n\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Commit transaction\n\terr = tx.Commit(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\th.SendSuccess(w, res.Transform(orderPaymentSaved), nil)\n}",
"func (pa *Payment) VerifyOtpAndAddBeneficiaryForWallet(body WalletOtpRequest) (WalletOtpResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyOtpAndAddBeneficiaryForWalletResponse WalletOtpResponse\n\t )\n\n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/refund/verification/wallet\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return WalletOtpResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyOtpAndAddBeneficiaryForWalletResponse)\n if err != nil {\n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n return verifyOtpAndAddBeneficiaryForWalletResponse, nil\n \n }",
"func (m *RollbackReleaseV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *InstallReleaseV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *AddGateResponse) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\treturn nil\n}",
"func (m *AcqRightResponse) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for Success\n\n\treturn nil\n}",
"func (pa *Payment) VerifyOtpAndAddBeneficiaryForBank(body AddBeneficiaryViaOtpVerificationRequest) (AddBeneficiaryViaOtpVerificationResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyOtpAndAddBeneficiaryForBankResponse AddBeneficiaryViaOtpVerificationResponse\n\t )\n\n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return AddBeneficiaryViaOtpVerificationResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return AddBeneficiaryViaOtpVerificationResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/refund/verification/bank\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return AddBeneficiaryViaOtpVerificationResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyOtpAndAddBeneficiaryForBankResponse)\n if err != nil {\n return AddBeneficiaryViaOtpVerificationResponse{}, common.NewFDKError(err.Error())\n }\n return verifyOtpAndAddBeneficiaryForBankResponse, nil\n \n }",
"func validateResponse(initialResponse *http.Response, request *http.Request, parser *parser.Parser) (bool, error) {\n\n\tresponse, err := parser.Do(request)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tdata1, err := httputil.DumpResponse(initialResponse, true)\n\tif err != nil {\n\t\tlogrus.Warn(fmt.Sprintf(\"Failed to dump response 1: %s\", err))\n\t\treturn false, err\n\t}\n\n\tdata2, err := httputil.DumpResponse(response, true)\n\tif err != nil {\n\t\tlogrus.Warn(fmt.Sprintf(\"Failed to dump response 2: %s\", err))\n\t\treturn false, err\n\t}\n\n\tif len(data1) != len(data2) {\n\t\treturn false, nil\n\t}\n\n\treturn true, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ContextValidate validate this o b write payment details response1 based on the context it is used
|
func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLinks(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLocalInstrument(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRisk(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateStatusDetail(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *PaymentMethodResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.ContextValidate(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *CoinInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (o *GetWalletOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateAuthorisation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtor(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSCASupportData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (o *GetPolicyOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBBCAData1ProductDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6DataMultiAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtor(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMultiAuthorisation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRefund(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *RateEnginePostalCodePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *PTXServiceDTORailSpecificationV2THSRODFare) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *SiteIdentificationDetail1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m PaginatedAPIResponse) ContextValidate(ctx ccontext.Context, formats strfmt.Registry) error {\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Validate validates this o b write payment details response1 data
|
func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePaymentStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLocalInstrument(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReason(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReasonDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentTransactionID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusDetail(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusUpdateDateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *CreditCardResponse) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateErrors(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *GetVersionDetailV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (pa *Payment) VerifyCustomerForPayment(body ValidateCustomerRequest) (ValidateCustomerResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyCustomerForPaymentResponse ValidateCustomerResponse\n\t )\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/payment/customer/validation\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return ValidateCustomerResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyCustomerForPaymentResponse)\n if err != nil {\n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n return verifyCustomerForPaymentResponse, nil\n \n }",
"func (m *GetReleaseDetailV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *Payment) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAccount(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateChanges(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankAddress(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCity(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCode(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCurrency(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateKid(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePostings(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateReceiverReference(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSourceVoucher(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *PaymentMethodResponse) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateExpiryDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastIdentifyTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastSuccessChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLockExpiresAt(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateValidFromDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *RollbackReleaseV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *InstallReleaseV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func validateResponse(initialResponse *http.Response, request *http.Request, parser *parser.Parser) (bool, error) {\n\n\tresponse, err := parser.Do(request)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tdata1, err := httputil.DumpResponse(initialResponse, true)\n\tif err != nil {\n\t\tlogrus.Warn(fmt.Sprintf(\"Failed to dump response 1: %s\", err))\n\t\treturn false, err\n\t}\n\n\tdata2, err := httputil.DumpResponse(response, true)\n\tif err != nil {\n\t\tlogrus.Warn(fmt.Sprintf(\"Failed to dump response 2: %s\", err))\n\t\treturn false, err\n\t}\n\n\tif len(data1) != len(data2) {\n\t\treturn false, nil\n\t}\n\n\treturn true, nil\n}",
"func (m *CreateV1Response) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\treturn nil\n}",
"func (m *HealthDetailsFreeIpaV1Response) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateCrn(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateEnvironmentCrn(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateNodeHealthDetails(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBBCAData1ProductDetails) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateFeeFreeLengthPeriod(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateNotes(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSegment(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *CDPEventV1Response) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLdapDetails(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateRdsDetails(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *AddGateResponse) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ContextValidate validate this o b write payment details response1 data based on the context it is used
|
func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePaymentStatus(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLocalInstrument(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateStatusDetail(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRisk(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateAuthorisation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtor(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSCASupportData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtor(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMultiAuthorisation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRefund(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBBCAData1ProductDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *CoinInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *PaymentMethodResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.ContextValidate(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBBCAData1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCreditInterest(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateOtherFeesCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateOverdraft(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateProductDetails(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6DataMultiAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6DataInitiation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCreditorAccount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtorAccount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateFinalPaymentAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateFirstPaymentAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRecurringPaymentAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (o *GetWalletOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *SiteIdentificationDetail1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiationDebtorAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateIdentification(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSchemeName(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSecondaryIdentification(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Validate validates this o b write payment details response1 data payment status items0
|
func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePaymentTransactionID(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatusDetail(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatusUpdateDateTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLocalInstrument(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReason(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReasonDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateStatusDetail(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLocalInstrument(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *Payment) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAccount(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateChanges(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankAddress(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCity(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCode(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCurrency(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateKid(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePostings(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateReceiverReference(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSourceVoucher(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (pa *Payment) CheckAndUpdatePaymentStatus(body PaymentStatusUpdateRequest) (PaymentStatusUpdateResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n checkAndUpdatePaymentStatusResponse PaymentStatusUpdateResponse\n\t )\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return PaymentStatusUpdateResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return PaymentStatusUpdateResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/payment/confirm/polling\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return PaymentStatusUpdateResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &checkAndUpdatePaymentStatusResponse)\n if err != nil {\n return PaymentStatusUpdateResponse{}, common.NewFDKError(err.Error())\n }\n return checkAndUpdatePaymentStatusResponse, nil\n \n }",
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (h *Contract) PostPaymentAct(w http.ResponseWriter, r *http.Request) {\n\t// Initial response handler\n\tvar res response.OrderPaymentResponse\n\n\t// Binding request\n\treq := request.OrderPaymentReq{}\n\tif err := h.Bind(r, &req); err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Validate request of struct request\n\tif err := h.Validator.Driver.Struct(req); err != nil {\n\t\th.SendRequestValidationError(w, err.(validator.ValidationErrors))\n\t\treturn\n\t}\n\n\t// Check db context\n\tctx := context.Background()\n\tdb, err := h.DB.Acquire(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\tdefer db.Release()\n\n\t// Model db transaction\n\tm := model.Contract{App: h.App}\n\ttx, err := db.Begin(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Check paid by order\n\tmemberCode := h.GetUserCode(r.Context())\n\tmember, _ := m.GetMemberByCode(db, ctx, memberCode)\n\tif member.ID == 0 {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Member %s not found.\", memberCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Check order data exist\n\torderExist, _ := m.GetOrderByOrderCode(db, ctx, req.OrderCode)\n\tif orderExist.ID == 0 {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Order %s not found.\", req.OrderCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Check paid by order by request auth\n\tif member.ID != orderExist.PaidBy {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Order paid by %s is invalid.\", memberCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Create order payment default set expired date\n\torderPaymentSetter := model.OrderPaymentEnt{\n\t\tOrderID: orderExist.ID,\n\t\tAmount: int64(req.Amount),\n\t\tPaymentStatus: model.PAYMENT_STATUS_PROCESS,\n\t}\n\n\t// Update url snap url midtrans\n\tpaymentService := payment.New(h.App)\n\torderCode := orderExist.OrderCode\n\torderAmount := int64(req.Amount)\n\tparamMidtrans := paymentService.SetMidtransParam(member.Email, member.Name, orderCode, orderAmount)\n\tmidtransResponse, err := paymentService.GetMidtransPaymentURL(paramMidtrans)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tif midtransResponse[\"redirect_url\"] == \"\" {\n\t\th.SendBadRequest(w, \"failed to get snap url midtrans.\")\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\torderPaymentSetter.PaymentURL = midtransResponse[\"redirect_url\"]\n\n\t// Check order payment exist then saved, if exist = renew payment\n\torderPaymentSaved := model.OrderPaymentEnt{}\n\torderPayment, _ := m.GetPaymentOrderByOrderID(db, ctx, orderExist.ID)\n\tif orderPayment.ID != 0 {\n\t\torderPaymentSetter.PaymentType = orderPayment.PaymentType\n\t\torderPaymentSetter.ExpiredDate = orderPayment.ExpiredDate\n\t\torderPaymentSetter.Payloads = orderPayment.Payloads\n\t\torderPaymentSaved, err = m.UpdateOrderPayment(tx, ctx, orderPaymentSetter, orderExist.ID)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\torderPaymentSaved.CreatedDate = orderPayment.CreatedDate\n\t\torderPaymentSaved.ExpiredDate = orderPayment.ExpiredDate\n\t} else {\n\t\torderPaymentSaved, err = m.AddOrderPayment(db, ctx, tx, orderPaymentSetter)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t}\n\torderPaymentSaved.OrderCode = orderExist.OrderCode\n\n\t// Activity user logging in process\n\tlog := model.LogActivityUserEnt{\n\t\tUserID: int64(member.ID),\n\t\tRole: h.GetUserRole(r.Context()),\n\t\tTitle: \"Update Order\",\n\t\tActivity: fmt.Sprintf(\"Update Order Payment Trip Itin For %s\", member.Name),\n\t\tEventType: r.Method,\n\t}\n\t_, err = m.AddLogActivity(tx, ctx, log)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Send Notifications - To User (Admin, TC)\n\tuserPlayers, err := m.GetListPlayerByUserCodeAndRole(db, ctx, \"\", \"\")\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tnotifContentUser := model.NotificationContent{\n\t\tSubject: model.NOTIF_SUBJ_ORDER_HISTORY,\n\t\tTripName: orderExist.MemberItin.Title,\n\t\tStatusPayment: model.PAYMENT_STATUS_PROCESS_METHOD_DESC,\n\t}\n\t_, err = m.SendNotifications(tx, db, ctx, userPlayers, notifContentUser)\n\tif err != nil {\n\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Commit transaction\n\terr = tx.Commit(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\th.SendSuccess(w, res.Transform(orderPaymentSaved), nil)\n}",
"func (o *PostSysbusNMCGetWANStatusOKBodyResultData) Validate(formats strfmt.Registry) error {\n\treturn nil\n}",
"func (po *PosCart) ValidateCouponForPayment(xQuery PosCartValidateCouponForPaymentXQuery) (PaymentCouponValidate, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n validateCouponForPaymentResponse PaymentCouponValidate\n\t )\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n //API call\n rawRequest = NewRequest(\n po.config,\n \"get\",\n \"/service/application/pos/cart/v1.0/payment/validate/\",\n nil,\n xQuery,\n nil)\n response, err = rawRequest.Execute()\n if err != nil {\n return PaymentCouponValidate{}, err\n\t }\n \n err = json.Unmarshal(response, &validateCouponForPaymentResponse)\n if err != nil {\n return PaymentCouponValidate{}, common.NewFDKError(err.Error())\n }\n return validateCouponForPaymentResponse, nil\n \n }",
"func (m *OBWriteDomesticStandingOrderResponse6DataInitiationFirstPaymentAmount) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAmount(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCurrency(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *RefundPaymentsItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}",
"func (o *UpdateCartLineItemOKBodyLineItemsItems0PhysicalItemsItems0DiscountsItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataInitiationFirstPaymentAmount) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAmount(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCurrency(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (pa *Payment) VerifyOtpAndAddBeneficiaryForWallet(body WalletOtpRequest) (WalletOtpResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyOtpAndAddBeneficiaryForWalletResponse WalletOtpResponse\n\t )\n\n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/refund/verification/wallet\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return WalletOtpResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyOtpAndAddBeneficiaryForWalletResponse)\n if err != nil {\n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n return verifyOtpAndAddBeneficiaryForWalletResponse, nil\n \n }",
"func (m *PaymentMethodResponse) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateExpiryDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastIdentifyTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastSuccessChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLockExpiresAt(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateValidFromDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (o *InventoryOKBodyItems0) Validate(formats strfmt.Registry) error {\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ContextValidate validate this o b write payment details response1 data payment status items0 based on the context it is used
|
func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateStatusDetail(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLocalInstrument(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentTransactionID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusDetail(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusUpdateDateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLocalInstrument(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReason(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReasonDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataChargesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateChargeBearer(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateType(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m InvoicePaymentReminderStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6DataChargesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateChargeBearer(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateType(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m PurchaseStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *PaymentMethodResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.ContextValidate(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBStatement2BasicStatementFeeItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateCreditDebitIndicator(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDescription(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateFrequency(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRate(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRateType(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateType(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (o *InventoryOKBodyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBBCAData1ProductDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6DataMultiAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (o *ListPolicyOKBodyResultsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m InvoiceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtor(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMultiAuthorisation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRefund(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRisk(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Validate validates this o b write payment details response1 data payment status items0 status detail
|
func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLocalInstrument(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatusReason(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatusReasonDescription(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentTransactionID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusDetail(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusUpdateDateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateStatusDetail(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateLocalInstrument(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *Payment) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAccount(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateChanges(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankAddress(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankName(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCity(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCreditorBankPostalCode(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateCurrency(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateKid(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePostings(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateReceiverReference(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSourceVoucher(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (pa *Payment) CheckAndUpdatePaymentStatus(body PaymentStatusUpdateRequest) (PaymentStatusUpdateResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n checkAndUpdatePaymentStatusResponse PaymentStatusUpdateResponse\n\t )\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return PaymentStatusUpdateResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return PaymentStatusUpdateResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/payment/confirm/polling\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return PaymentStatusUpdateResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &checkAndUpdatePaymentStatusResponse)\n if err != nil {\n return PaymentStatusUpdateResponse{}, common.NewFDKError(err.Error())\n }\n return checkAndUpdatePaymentStatusResponse, nil\n \n }",
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (h *Contract) PostPaymentAct(w http.ResponseWriter, r *http.Request) {\n\t// Initial response handler\n\tvar res response.OrderPaymentResponse\n\n\t// Binding request\n\treq := request.OrderPaymentReq{}\n\tif err := h.Bind(r, &req); err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Validate request of struct request\n\tif err := h.Validator.Driver.Struct(req); err != nil {\n\t\th.SendRequestValidationError(w, err.(validator.ValidationErrors))\n\t\treturn\n\t}\n\n\t// Check db context\n\tctx := context.Background()\n\tdb, err := h.DB.Acquire(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\tdefer db.Release()\n\n\t// Model db transaction\n\tm := model.Contract{App: h.App}\n\ttx, err := db.Begin(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Check paid by order\n\tmemberCode := h.GetUserCode(r.Context())\n\tmember, _ := m.GetMemberByCode(db, ctx, memberCode)\n\tif member.ID == 0 {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Member %s not found.\", memberCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Check order data exist\n\torderExist, _ := m.GetOrderByOrderCode(db, ctx, req.OrderCode)\n\tif orderExist.ID == 0 {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Order %s not found.\", req.OrderCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Check paid by order by request auth\n\tif member.ID != orderExist.PaidBy {\n\t\th.SendNotfound(w, fmt.Sprintf(\"Order paid by %s is invalid.\", memberCode))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Create order payment default set expired date\n\torderPaymentSetter := model.OrderPaymentEnt{\n\t\tOrderID: orderExist.ID,\n\t\tAmount: int64(req.Amount),\n\t\tPaymentStatus: model.PAYMENT_STATUS_PROCESS,\n\t}\n\n\t// Update url snap url midtrans\n\tpaymentService := payment.New(h.App)\n\torderCode := orderExist.OrderCode\n\torderAmount := int64(req.Amount)\n\tparamMidtrans := paymentService.SetMidtransParam(member.Email, member.Name, orderCode, orderAmount)\n\tmidtransResponse, err := paymentService.GetMidtransPaymentURL(paramMidtrans)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tif midtransResponse[\"redirect_url\"] == \"\" {\n\t\th.SendBadRequest(w, \"failed to get snap url midtrans.\")\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\torderPaymentSetter.PaymentURL = midtransResponse[\"redirect_url\"]\n\n\t// Check order payment exist then saved, if exist = renew payment\n\torderPaymentSaved := model.OrderPaymentEnt{}\n\torderPayment, _ := m.GetPaymentOrderByOrderID(db, ctx, orderExist.ID)\n\tif orderPayment.ID != 0 {\n\t\torderPaymentSetter.PaymentType = orderPayment.PaymentType\n\t\torderPaymentSetter.ExpiredDate = orderPayment.ExpiredDate\n\t\torderPaymentSetter.Payloads = orderPayment.Payloads\n\t\torderPaymentSaved, err = m.UpdateOrderPayment(tx, ctx, orderPaymentSetter, orderExist.ID)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\torderPaymentSaved.CreatedDate = orderPayment.CreatedDate\n\t\torderPaymentSaved.ExpiredDate = orderPayment.ExpiredDate\n\t} else {\n\t\torderPaymentSaved, err = m.AddOrderPayment(db, ctx, tx, orderPaymentSetter)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t}\n\torderPaymentSaved.OrderCode = orderExist.OrderCode\n\n\t// Activity user logging in process\n\tlog := model.LogActivityUserEnt{\n\t\tUserID: int64(member.ID),\n\t\tRole: h.GetUserRole(r.Context()),\n\t\tTitle: \"Update Order\",\n\t\tActivity: fmt.Sprintf(\"Update Order Payment Trip Itin For %s\", member.Name),\n\t\tEventType: r.Method,\n\t}\n\t_, err = m.AddLogActivity(tx, ctx, log)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Send Notifications - To User (Admin, TC)\n\tuserPlayers, err := m.GetListPlayerByUserCodeAndRole(db, ctx, \"\", \"\")\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tnotifContentUser := model.NotificationContent{\n\t\tSubject: model.NOTIF_SUBJ_ORDER_HISTORY,\n\t\tTripName: orderExist.MemberItin.Title,\n\t\tStatusPayment: model.PAYMENT_STATUS_PROCESS_METHOD_DESC,\n\t}\n\t_, err = m.SendNotifications(tx, db, ctx, userPlayers, notifContentUser)\n\tif err != nil {\n\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Commit transaction\n\terr = tx.Commit(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\th.SendSuccess(w, res.Transform(orderPaymentSaved), nil)\n}",
"func (o *PostSysbusNMCGetWANStatusOKBodyResultData) Validate(formats strfmt.Registry) error {\n\treturn nil\n}",
"func (pa *Payment) VerifyOtpAndAddBeneficiaryForWallet(body WalletOtpRequest) (WalletOtpResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyOtpAndAddBeneficiaryForWalletResponse WalletOtpResponse\n\t )\n\n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/refund/verification/wallet\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return WalletOtpResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyOtpAndAddBeneficiaryForWalletResponse)\n if err != nil {\n return WalletOtpResponse{}, common.NewFDKError(err.Error())\n }\n return verifyOtpAndAddBeneficiaryForWalletResponse, nil\n \n }",
"func (po *PosCart) ValidateCouponForPayment(xQuery PosCartValidateCouponForPaymentXQuery) (PaymentCouponValidate, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n validateCouponForPaymentResponse PaymentCouponValidate\n\t )\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n //API call\n rawRequest = NewRequest(\n po.config,\n \"get\",\n \"/service/application/pos/cart/v1.0/payment/validate/\",\n nil,\n xQuery,\n nil)\n response, err = rawRequest.Execute()\n if err != nil {\n return PaymentCouponValidate{}, err\n\t }\n \n err = json.Unmarshal(response, &validateCouponForPaymentResponse)\n if err != nil {\n return PaymentCouponValidate{}, common.NewFDKError(err.Error())\n }\n return validateCouponForPaymentResponse, nil\n \n }",
"func (m *GetVersionDetailV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *GetReleaseDetailV1Resp) Validate() error {\n\treturn m.validate(false)\n}",
"func (m *PaymentMethodResponse) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.Validate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateExpiryDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastIdentifyTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastSuccessChallengeTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLockExpiresAt(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateValidFromDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m PurchaseStatus) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validatePurchaseStatusEnum(\"\", \"body\", m); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (pa *Payment) VerifyOtpAndAddBeneficiaryForBank(body AddBeneficiaryViaOtpVerificationRequest) (AddBeneficiaryViaOtpVerificationResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyOtpAndAddBeneficiaryForBankResponse AddBeneficiaryViaOtpVerificationResponse\n\t )\n\n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return AddBeneficiaryViaOtpVerificationResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return AddBeneficiaryViaOtpVerificationResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/refund/verification/bank\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return AddBeneficiaryViaOtpVerificationResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyOtpAndAddBeneficiaryForBankResponse)\n if err != nil {\n return AddBeneficiaryViaOtpVerificationResponse{}, common.NewFDKError(err.Error())\n }\n return verifyOtpAndAddBeneficiaryForBankResponse, nil\n \n }",
"func (pa *Payment) VerifyCustomerForPayment(body ValidateCustomerRequest) (ValidateCustomerResponse, error){\n var (\n rawRequest *RawRequest\n response []byte\n err error\n verifyCustomerForPaymentResponse ValidateCustomerResponse\n\t )\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n //Parse req body to map\n var reqBody map[string]interface{}\n reqBodyJSON, err := json.Marshal(body)\n if err != nil {\n \n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n err = json.Unmarshal([]byte(reqBodyJSON), &reqBody)\n if err != nil {\n \n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n \n //API call\n rawRequest = NewRequest(\n pa.config,\n \"post\",\n \"/service/application/payment/v1.0/payment/customer/validation\",\n nil,\n nil,\n reqBody)\n response, err = rawRequest.Execute()\n if err != nil {\n return ValidateCustomerResponse{}, err\n\t }\n \n err = json.Unmarshal(response, &verifyCustomerForPaymentResponse)\n if err != nil {\n return ValidateCustomerResponse{}, common.NewFDKError(err.Error())\n }\n return verifyCustomerForPaymentResponse, nil\n \n }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ContextValidate validate this o b write payment details response1 data payment status items0 status detail based on the context it is used
|
func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateLocalInstrument(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
[
"func (m *OBWritePaymentDetailsResponse1Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidatePaymentStatus(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateStatusDetail(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateData(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateLinks(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMeta(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0StatusDetail) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateLocalInstrument(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReason(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusReasonDescription(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1Data) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1DataPaymentStatusItems0) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validatePaymentTransactionID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatus(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusDetail(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStatusUpdateDateTime(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m InvoicePaymentReminderStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m PurchaseStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m InvoiceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWritePaymentDetailsResponse1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLinks(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMeta(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *PaymentMethodResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\t// validation for a type composition with Entity\n\tif err := m.Entity.ContextValidate(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBBCAData1ProductDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (o *A1ControllerGetPolicyInstanceStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (o *GetWalletOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6DataMultiAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataChargesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateAmount(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateChargeBearer(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateType(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderResponse6Data) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateCharges(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateDebtor(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateInitiation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateMultiAuthorisation(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateRefund(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}",
"func (m OpenbankingBrasilStatus1) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}",
"func (m *OBWriteDomesticStandingOrderConsentResponse6DataAuthorisation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
HandleOutbound handles outbound didexchange messages.
|
func (s *Service) HandleOutbound(_ service.DIDCommMsg, _, _ string) (string, error) {
return "", errors.New("not implemented")
}
|
[
"func (d *DProxyClient) handleOutboundMessage(resp *services.DynamicReplay) {\n\td.log.Debugf(\"received message for replay '%s'\", resp.ReplayId)\n\n\toutbound := resp.GetOutboundMessage()\n\n\t// Ignore\n\tif outbound.Last {\n\t\treturn\n\t}\n\n\td.OutboundMessageCh <- outbound\n}",
"func (o *LoggingObserver) AfterOutbound(ctx context.Context, env endpoint.OutboundEnvelope, err error) {\n\tif err != nil {\n\t\to.logError(outboundErrorIcon, env.Envelope, err)\n\t}\n}",
"func (m *InjectableEndpoint) InjectOutbound(dest tcpip.Address, packet *buffer.View) tcpip.Error {\n\tendpoint, ok := m.routes[dest]\n\tif !ok {\n\t\treturn &tcpip.ErrHostUnreachable{}\n\t}\n\treturn endpoint.InjectOutbound(dest, packet)\n}",
"func (*Messenger) HandleInbound(msg service.DIDCommMsgMap, myDID, theirDID string) error {\n\treturn nil\n}",
"func (p Plugin) OnOutboundListener(in *plugin.InputParams, mutable *networking.MutableObjects) error {\n\treturn buildFilter(mutable)\n}",
"func (i *SessionTransport) SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (sec.SecureConn, error) {\n\treturn newSecureSession(i.t, ctx, insecure, p, i.prologue, i.initiatorEarlyDataHandler, i.responderEarlyDataHandler, true, !i.disablePeerIDCheck)\n}",
"func messagesOutbound() {\n\tlogger.Println(\"Receiving outbound messages\")\n\n\tmessages, err := apiRequestMessagesOutbounds()\n\tif err != nil {\n\t\tlogger.Errorln(\"Failed to get outbound messages, api request error\", err)\n\t\treturn\n\t}\n\n\tlogger.Debugf(\"Attempting to send %d messages\", len(messages))\n\n\tvar (\n\t\tmessageIDs []uint\n\t\tmessageErrors []typeMailMessageError\n\t)\n\n\tfor _, message := range messages {\n\t\trelations := message.To\n\t\trelations = append(relations, message.Cc...)\n\t\trelations = append(relations, message.Bcc...)\n\n\t\tmessageEncoded, err := messageBuild(message)\n\t\tif err != nil {\n\t\t\tlogger.Errorln(\"Failed to convert message to smtp\", message.MessageID, err)\n\t\t\tmessageErrors = append(messageErrors, typeMailMessageError{\n\t\t\t\tMailMessageID: message.ID,\n\t\t\t\tError: fmt.Sprintf(\"email format error: %s\", err.Error()),\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\tmailHostsSent := make(map[string]bool)\n\t\tfor _, relation := range relations {\n\t\t\taddress := relation.Address\n\n\t\t\tif strings.LastIndex(address, \"@\") <= 0 {\n\t\t\t\terr := fmt.Errorf(`email address \"%s\" is not valid`, address)\n\t\t\t\tlogger.Errorln(\"Failed to get email address host\", message.MessageID, err)\n\t\t\t\tmessageErrors = append(messageErrors, typeMailMessageError{\n\t\t\t\t\tMailMessageID: message.ID,\n\t\t\t\t\tError: fmt.Sprintf(`email address format error: %s`, err.Error()),\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tmailHost := strings.Split(address, \"@\")[1]\n\t\t\tif _, ok := mailHostsSent[mailHost]; ok {\n\t\t\t\t// Mail already sent to the mail host. If there are multiple\n\t\t\t\t// emails with the same mail host, only send it once.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmailHostsSent[mailHost] = true\n\n\t\t\tmxRecords, err := net.LookupMX(mailHost)\n\t\t\tif err != nil {\n\t\t\t\terr = fmt.Errorf(`email address \"%s\" host's MX lookup failed due to %s`, address, err.Error())\n\t\t\t\tlogger.Errorln(\"Failed to lookup MX records for\", message.MessageID, err)\n\t\t\t\tmessageErrors = append(messageErrors, typeMailMessageError{\n\t\t\t\t\tMailMessageID: message.ID,\n\t\t\t\t\tError: fmt.Sprintf(\"email address host error: %s\", err.Error()),\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvar upstreams []typeMailUpstream\n\t\t\tfor _, mx := range mxRecords {\n\t\t\t\tupstreams = append(upstreams, typeMailUpstream{\n\t\t\t\t\tTarget: mx.Host,\n\t\t\t\t\tPriority: int(mx.Pref),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif err := smtpSend(messageEncoded, upstreams); err != nil {\n\t\t\t\terr = fmt.Errorf(`email address \"%s\" delivery failed due to %s`, address, err.Error())\n\t\t\t\tlogger.Errorln(\"Failed to lookup MX records\", message.MessageID, err)\n\t\t\t\tmessageErrors = append(messageErrors, typeMailMessageError{\n\t\t\t\t\tMailMessageID: message.ID,\n\t\t\t\t\tError: fmt.Sprintf(\"email address delivery error: %s\", err.Error()),\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tmessageIDs = append(messageIDs, message.ID)\n\t}\n}",
"func (client *IntegrationRuntimesClient) listOutboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response) (IntegrationRuntimesClientListOutboundNetworkDependenciesEndpointsResponse, error) {\n\tresult := IntegrationRuntimesClientListOutboundNetworkDependenciesEndpointsResponse{RawResponse: resp}\n\tif err := runtime.UnmarshalAsJSON(resp, &result.IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse); err != nil {\n\t\treturn IntegrationRuntimesClientListOutboundNetworkDependenciesEndpointsResponse{}, err\n\t}\n\treturn result, nil\n}",
"func (a *Association) gatherOutbound() ([][]byte, bool) {\n\ta.lock.Lock()\n\tdefer a.lock.Unlock()\n\n\tif a.willSendAbort {\n\t\tpkt, err := a.gatherAbortPacket()\n\t\tif err != nil {\n\t\t\ta.log.Warnf(\"[%s] failed to serialize an abort packet\", a.name)\n\t\t\treturn nil, false\n\t\t}\n\n\t\treturn [][]byte{pkt}, false\n\t}\n\n\trawPackets := [][]byte{}\n\n\tif a.controlQueue.size() > 0 {\n\t\tfor _, p := range a.controlQueue.popAll() {\n\t\t\traw, err := p.marshal()\n\t\t\tif err != nil {\n\t\t\t\ta.log.Warnf(\"[%s] failed to serialize a control packet\", a.name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trawPackets = append(rawPackets, raw)\n\t\t}\n\t}\n\n\tstate := a.getState()\n\n\tok := true\n\n\tswitch state {\n\tcase established:\n\t\trawPackets = a.gatherDataPacketsToRetransmit(rawPackets)\n\t\trawPackets = a.gatherOutboundDataAndReconfigPackets(rawPackets)\n\t\trawPackets = a.gatherOutboundFastRetransmissionPackets(rawPackets)\n\t\trawPackets = a.gatherOutboundSackPackets(rawPackets)\n\t\trawPackets = a.gatherOutboundForwardTSNPackets(rawPackets)\n\tcase shutdownPending, shutdownSent, shutdownReceived:\n\t\trawPackets = a.gatherDataPacketsToRetransmit(rawPackets)\n\t\trawPackets = a.gatherOutboundFastRetransmissionPackets(rawPackets)\n\t\trawPackets = a.gatherOutboundSackPackets(rawPackets)\n\t\trawPackets, ok = a.gatherOutboundShutdownPackets(rawPackets)\n\tcase shutdownAckSent:\n\t\trawPackets, ok = a.gatherOutboundShutdownPackets(rawPackets)\n\t}\n\n\treturn rawPackets, ok\n}",
"func authenticationOutbound(info auth.CreateAuthInfo) OutboundMiddlewareFunc {\n\tauthClient := auth.Load(info)\n\tserviceName := info.Config().Get(config.ServiceNameKey).AsString()\n\treturn func(req *http.Request, next Executor) (resp *http.Response, err error) {\n\t\tctx := req.Context()\n\t\t// Client needs to know what service it is to authenticate\n\t\tauthCtx := authClient.SetAttribute(ctx, auth.ServiceAuth, serviceName)\n\n\t\tauthCtx, err = authClient.Authenticate(authCtx)\n\t\tif err != nil {\n\t\t\tulog.Logger(ctx).Error(auth.ErrAuthentication, zap.Error(err))\n\t\t\treturn nil, err\n\t\t}\n\n\t\tspan := opentracing.SpanFromContext(authCtx)\n\t\tif err := injectSpanIntoHeaders(req.Header, span); err != nil {\n\t\t\tulog.Logger(authCtx).Error(\"Error injecting auth context\", zap.Error(err))\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn next.Execute(req.WithContext(authCtx))\n\t}\n}",
"func (f OutboundMiddlewareFunc) Handle(r *http.Request, next Executor) (resp *http.Response, err error) {\n\treturn f(r, next)\n}",
"func (a OutboundApi) GetOutboundEvents(pageSize int, pageNumber int, filterType string, category string, level string, sortBy string, sortOrder string) (*Dialerevententitylisting, *APIResponse, error) {\n\tvar httpMethod = \"GET\"\n\t// create path and map variables\n\tpath := a.Configuration.BasePath + \"/api/v2/outbound/events\"\n\tdefaultReturn := new(Dialerevententitylisting)\n\tif true == false {\n\t\treturn defaultReturn, nil, errors.New(\"This message brought to you by the laws of physics being broken\")\n\t}\n\n\n\theaderParams := make(map[string]string)\n\tqueryParams := make(map[string]string)\n\tformParams := url.Values{}\n\tvar postBody interface{}\n\tvar postFileName string\n\tvar fileBytes []byte\n\t// authentication (PureCloud OAuth) required\n\n\t// oauth required\n\tif a.Configuration.AccessToken != \"\"{\n\t\theaderParams[\"Authorization\"] = \"Bearer \" + a.Configuration.AccessToken\n\t}\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\theaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\t\n\tqueryParams[\"pageSize\"] = a.Configuration.APIClient.ParameterToString(pageSize, \"\")\n\t\n\tqueryParams[\"pageNumber\"] = a.Configuration.APIClient.ParameterToString(pageNumber, \"\")\n\t\n\tqueryParams[\"filterType\"] = a.Configuration.APIClient.ParameterToString(filterType, \"\")\n\t\n\tqueryParams[\"category\"] = a.Configuration.APIClient.ParameterToString(category, \"\")\n\t\n\tqueryParams[\"level\"] = a.Configuration.APIClient.ParameterToString(level, \"\")\n\t\n\tqueryParams[\"sortBy\"] = a.Configuration.APIClient.ParameterToString(sortBy, \"\")\n\t\n\tqueryParams[\"sortOrder\"] = a.Configuration.APIClient.ParameterToString(sortOrder, \"\")\n\t\n\n\t// Find an replace keys that were altered to avoid clashes with go keywords \n\tcorrectedQueryParams := make(map[string]string)\n\tfor k, v := range queryParams {\n\t\tif k == \"varType\" {\n\t\t\tcorrectedQueryParams[\"type\"] = v\n\t\t\tcontinue\n\t\t}\n\t\tcorrectedQueryParams[k] = v\n\t}\n\tqueryParams = correctedQueryParams\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"application/json\", }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tvar successPayload *Dialerevententitylisting\n\tresponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, postFileName, fileBytes)\n\tif err != nil {\n\t\t// Nothing special to do here, but do avoid processing the response\n\t} else if err == nil && response.Error != nil {\n\t\terr = errors.New(response.ErrorMessage)\n\t} else if response.HasBody {\n\t\tif \"Dialerevententitylisting\" == \"string\" {\n\t\t\tcopy(response.RawBody, &successPayload)\n\t\t} else {\n\t\t\terr = json.Unmarshal(response.RawBody, &successPayload)\n\t\t}\n\t}\n\treturn successPayload, response, err\n}",
"func (peerConn *PeerConn) outMessageHandler(rw *bufio.ReadWriter) {\n\tfor {\n\t\tselect {\n\t\tcase outMsg := <-peerConn.sendMessageQueue:\n\t\t\t{\n\t\t\t\tvar sendString string\n\t\t\t\tif outMsg.rawBytes != nil && len(*outMsg.rawBytes) > 0 {\n\t\t\t\t\tLogger.log.Debugf(\"OutMessageHandler with raw bytes\")\n\t\t\t\t\tmessage := hex.EncodeToString(*outMsg.rawBytes)\n\t\t\t\t\tmessage += delimMessageStr\n\t\t\t\t\tsendString = message\n\t\t\t\t\tLogger.log.Debugf(\"Send a messageHex raw bytes to %s\", peerConn.remotePeer.GetPeerID().Pretty())\n\t\t\t\t} else {\n\t\t\t\t\t// Create and send messageHex\n\t\t\t\t\tmessageBytes, err := outMsg.message.JsonSerialize()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tLogger.log.Error(\"Can not serialize json format for messageHex:\" + outMsg.message.MessageType())\n\t\t\t\t\t\tLogger.log.Error(err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add 24 bytes headerBytes into messageHex\n\t\t\t\t\theaderBytes := make([]byte, wire.MessageHeaderSize)\n\t\t\t\t\t// add command type of message\n\t\t\t\t\tcmdType, messageErr := wire.GetCmdType(reflect.TypeOf(outMsg.message))\n\t\t\t\t\tif messageErr != nil {\n\t\t\t\t\t\tLogger.log.Error(\"Can not get cmd type for \" + outMsg.message.MessageType())\n\t\t\t\t\t\tLogger.log.Error(messageErr)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tcopy(headerBytes[:], []byte(cmdType))\n\t\t\t\t\t// add forward type of message at 13st byte\n\t\t\t\t\tcopy(headerBytes[wire.MessageCmdTypeSize:], []byte{outMsg.forwardType})\n\t\t\t\t\tif outMsg.forwardValue != nil {\n\t\t\t\t\t\t// add forward value at 14st byte\n\t\t\t\t\t\tcopy(headerBytes[wire.MessageCmdTypeSize+1:], []byte{*outMsg.forwardValue})\n\t\t\t\t\t}\n\t\t\t\t\tmessageBytes = append(messageBytes, headerBytes...)\n\t\t\t\t\tLogger.log.Debugf(\"OutMessageHandler TYPE %s CONTENT %s\", cmdType, string(messageBytes))\n\n\t\t\t\t\t// zip data before send\n\t\t\t\t\tmessageBytes, err = common.GZipFromBytes(messageBytes)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tLogger.log.Error(\"Can not gzip for messageHex:\" + outMsg.message.MessageType())\n\t\t\t\t\t\tLogger.log.Error(err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tmessageHex := hex.EncodeToString(messageBytes)\n\t\t\t\t\t//Logger.log.Debugf(\"Content in hex encode: %s\", string(messageHex))\n\t\t\t\t\t// add end character to messageHex (delim '\\n')\n\t\t\t\t\tmessageHex += delimMessageStr\n\n\t\t\t\t\t// send on p2p stream\n\t\t\t\t\tLogger.log.Debugf(\"Send a messageHex %s to %s\", outMsg.message.MessageType(), peerConn.remotePeer.GetPeerID().Pretty())\n\t\t\t\t\tsendString = messageHex\n\t\t\t\t}\n\t\t\t\t// MONITOR OUTBOUND MESSAGE\n\t\t\t\tif outMsg.message != nil {\n\t\t\t\t\tstoreOutboundPeerMessage(outMsg.message, time.Now().Unix(), peerConn.remotePeer.GetPeerID())\n\t\t\t\t}\n\n\t\t\t\t_, err := rw.Writer.WriteString(sendString)\n\t\t\t\tif err != nil {\n\t\t\t\t\tLogger.log.Critical(\"OutMessageHandler WriteString error\", err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\terr = rw.Writer.Flush()\n\t\t\t\tif err != nil {\n\t\t\t\t\tLogger.log.Critical(\"OutMessageHandler Flush error\", err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\tcase <-peerConn.cWrite:\n\t\t\tLogger.log.Debugf(\"OutMessageHandler QUIT %s %s\", peerConn.remotePeerID.Pretty(), peerConn.remotePeer.GetRawAddress())\n\n\t\t\tpeerConn.setIsConnected(false)\n\n\t\t\tclose(peerConn.cDisconnect)\n\n\t\t\tif peerConn.HandleDisconnected != nil {\n\t\t\t\tgo peerConn.HandleDisconnected(peerConn)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\t}\n}",
"func (m *CrossTenantAccessPolicyConfigurationPartner) SetB2bDirectConnectOutbound(value CrossTenantAccessPolicyB2BSettingable)() {\n m.b2bDirectConnectOutbound = value\n}",
"func NewOutboundNetworkProcessor() *OutboundNetworkProcessor {\n\treturn &OutboundNetworkProcessor{}\n}",
"func buildOutboundListeners(mesh *meshconfig.MeshConfig, node model.Proxy, proxyInstances []*model.ServiceInstance,\n\tservices []*model.Service, config model.IstioConfigStore) ([]*xdsapi.Listener, v1.Clusters) {\n\tlisteners, clusters := buildOutboundTCPListeners(mesh, node, services)\n\n\tegressTCPListeners, egressTCPClusters := buildEgressTCPListeners(mesh, node, config)\n\tlisteners = append(listeners, egressTCPListeners...)\n\tclusters = append(clusters, egressTCPClusters...)\n\n\texternalServiceTCPListeners, externalServiceTCPClusters := buildExternalServiceTCPListeners(mesh, config)\n\tlisteners = append(listeners, externalServiceTCPListeners...)\n\tclusters = append(clusters, externalServiceTCPClusters...)\n\n\t// note that outbound HTTP routes are supplied through RDS\n\thttpOutbound := buildOutboundHTTPRoutes(mesh, node, proxyInstances, services, config)\n\thttpOutbound = v1.BuildEgressHTTPRoutes(mesh, node, proxyInstances, config, httpOutbound)\n\thttpOutbound = v1.BuildExternalServiceHTTPRoutes(mesh, node, proxyInstances, config, httpOutbound)\n\n\tfor port, routeConfig := range httpOutbound {\n\t\toperation := http_conn.EGRESS\n\t\tuseRemoteAddress := false\n\n\t\tif node.Type == model.Router {\n\t\t\t// if this is in Router mode, then use ingress style trace operation, and remote address settings\n\t\t\tuseRemoteAddress = true\n\t\t\toperation = http_conn.INGRESS\n\t\t}\n\n\t\tlisteners = append(listeners, buildHTTPListener(buildHTTPListenerOpts{\n\t\t\tmesh: mesh,\n\t\t\tproxy: node,\n\t\t\tproxyInstances: proxyInstances,\n\t\t\trouteConfig: routeConfig,\n\t\t\tip: v1.WildcardAddress,\n\t\t\tport: port,\n\t\t\trds: fmt.Sprintf(\"%d\", port),\n\t\t\tuseRemoteAddress: useRemoteAddress,\n\t\t\tdirection: operation,\n\t\t\toutboundListener: true,\n\t\t\tstore: config,\n\t\t}))\n\t\tclusters = append(clusters, routeConfig.Clusters()...)\n\t}\n\n\treturn listeners, clusters\n}",
"func (eh disconnectEventHandler) Handle(s *Session, i interface{}) {\r\n\tif t, ok := i.(*Disconnect); ok {\r\n\t\teh(s, t)\r\n\t}\r\n}",
"func (c *Client) processOutgoingQueue() {\n\tfor c.status != ClientDisconnected {\n\t\tsending := <-messageOutgoingChan\n\t\tc.conn.Write(sending.CompressToBytes())\n\t\tdefer updateLastSent() //@todo why is this deferred?\n\t}\n\tlog.Printf(\"client: server could not be reached\")\n}",
"func (v *Variation) QueryOutboundDeals() *OutboundDealQuery {\n\treturn (&VariationClient{config: v.config}).QueryOutboundDeals(v)\n}",
"func NewOutboundApi() *OutboundApi {\n\tfmt.Sprintf(strings.Title(\"\"), \"\")\n\tconfig := GetDefaultConfiguration()\n\treturn &OutboundApi{\n\t\tConfiguration: config,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
sendActionEvent triggers the action event. This function stores the state of current processing and passes a callback function in the event message.
|
func (s *Service) sendActionEvent(internalMsg *message, aEvent chan<- service.DIDCommAction) error {
// save data to support AcceptExchangeRequest APIs (when client will not be able to invoke the callback function)
err := s.storeEventProtocolStateData(internalMsg)
if err != nil {
return fmt.Errorf("send action event : %w", err)
}
if aEvent != nil {
// trigger action event
aEvent <- service.DIDCommAction{
ProtocolName: DIDExchange,
Message: internalMsg.Msg.Clone(),
Continue: func(args interface{}) {
switch v := args.(type) {
case opts:
internalMsg.Options = &options{
publicDID: v.PublicDID(),
label: v.Label(),
routerConnections: v.RouterConnections(),
}
default:
// nothing to do
}
s.processCallback(internalMsg)
},
Stop: func(err error) {
// sets an error to the message
internalMsg.err = err
s.processCallback(internalMsg)
},
Properties: createEventProperties(internalMsg.ConnRecord.ConnectionID, internalMsg.ConnRecord.InvitationID),
}
logger.Debugf("dispatched action for msg: %+v", internalMsg.Msg)
}
return nil
}
|
[
"func (i *IRC) SendAction(channel, message string) error {\n\ti.Conn.Action(channel, message)\n\treturn nil\n}",
"func SendFediverseAction(eventType string, userAccountName string, image *string, body string, link string) error {\n\tmessage := events.FediverseEngagementEvent{\n\t\tEvent: events.Event{\n\t\t\tType: eventType,\n\t\t},\n\t\tMessageEvent: events.MessageEvent{\n\t\t\tBody: body,\n\t\t},\n\t\tUserAccountName: userAccountName,\n\t\tImage: image,\n\t\tLink: link,\n\t}\n\n\tmessage.SetDefaults()\n\tmessage.RenderBody()\n\n\tif err := Broadcast(&message); err != nil {\n\t\tlog.Errorln(\"error sending system message\", err)\n\t\treturn err\n\t}\n\n\tsaveFederatedAction(message)\n\n\treturn nil\n}",
"func (ep *AgentEndpoint) Send(action *agent.Action) {\n\tep.actionCh <- action\n}",
"func (ch *Channel) SendAction(msgID string, formData map[string]string) (*Message, error) {\n\tswitch {\n\tcase msgID == \"\":\n\t\treturn nil, errors.New(\"message ID is empty\")\n\tcase len(formData) == 0:\n\t\treturn nil, errors.New(\"form data is empty\")\n\t}\n\n\tp := path.Join(\"messages\", url.PathEscape(msgID), \"action\")\n\n\tdata := sendActionRequest{MessageID: msgID, FormData: formData}\n\n\tvar resp messageResponse\n\n\terr := ch.client.makeRequest(http.MethodPost, p, nil, data, &resp)\n\treturn resp.Message, err\n}",
"func (core *coreService) SendAction(ctx context.Context, in *iotextypes.Action) (string, error) {\n\tlog.Logger(\"api\").Debug(\"receive send action request\")\n\tselp, err := (&action.Deserializer{}).ActionToSealedEnvelope(in)\n\tif err != nil {\n\t\treturn \"\", status.Error(codes.InvalidArgument, err.Error())\n\t}\n\n\t// reject action if chainID is not matched at KamchatkaHeight\n\tif err := core.validateChainID(in.GetCore().GetChainID()); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Add to local actpool\n\tctx = protocol.WithRegistry(ctx, core.registry)\n\thash, err := selp.Hash()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tl := log.Logger(\"api\").With(zap.String(\"actionHash\", hex.EncodeToString(hash[:])))\n\tif err = core.ap.Add(ctx, selp); err != nil {\n\t\ttxBytes, serErr := proto.Marshal(in)\n\t\tif serErr != nil {\n\t\t\tl.Error(\"Data corruption\", zap.Error(serErr))\n\t\t} else {\n\t\t\tl.With(zap.String(\"txBytes\", hex.EncodeToString(txBytes))).Error(\"Failed to accept action\", zap.Error(err))\n\t\t}\n\t\tst := status.New(codes.Internal, err.Error())\n\t\tbr := &errdetails.BadRequest{\n\t\t\tFieldViolations: []*errdetails.BadRequest_FieldViolation{\n\t\t\t\t{\n\t\t\t\t\tField: \"Action rejected\",\n\t\t\t\t\tDescription: action.LoadErrorDescription(err),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\tst, err := st.WithDetails(br)\n\t\tif err != nil {\n\t\t\tlog.Logger(\"api\").Panic(\"Unexpected error attaching metadata\", zap.Error(err))\n\t\t}\n\t\treturn \"\", st.Err()\n\t}\n\t// If there is no error putting into local actpool,\n\t// Broadcast it to the network\n\tif err = core.broadcastHandler(ctx, core.bc.ChainID(), in); err != nil {\n\t\tl.Warn(\"Failed to broadcast SendAction request.\", zap.Error(err))\n\t}\n\treturn hex.EncodeToString(hash[:]), nil\n}",
"func (f *FSMType) FSMPostEvent(event int, arg interface{}) (err int) {\n var callback FSMTransitionCallback\n var newState int\n var i int\n\n f.FSMLog (\"Received event %s(%d) in state %s(%d)\\n\", \n f.FSMGetEventName(event), event,\n f.FSMGetStateName(f.currState), f.currState);\n\n /* Loop through and Get the next state from the transition table */\n for i = 0; i < f.transitionCount; i++ {\n if f.transitionTable[i].State == f.currState && \n f.transitionTable[i].Event == event {\n newState = f.transitionTable[i].NewState\n callback = f.transitionTable[i].Callback\n break\n }\n }\n\n if i == f.transitionCount {\n /* event not found in the transition table */\n f.FSMLog(\"Couldn't find event %s(%d) in state %s(%d) in transition table\\n\",\n f.FSMGetEventName(event), event, f.FSMGetStateName(f.currState),\n f.currState);\n\n return -1\n }\n\n /* Execute the action assosiated with the event */\n if callback != nil {\n f.FSMLog(\"Executing action for event %s(%d)\\n\",\n f.FSMGetEventName(event), event);\n callback(f.fsmId, arg)\n }\n\n f.FSMLog(\"Changing state to %s(%d)\\n\",\n f.FSMGetStateName(newState), newState);\n\n return f.FSMChangeState(&event, newState)\n}",
"func (fsm *FSM) SendEvent(event Event) error {\n\t// Find the transition that matches the state/event\n\t// fmt.Println(\"SendEvent:\", event.Action, event.Param)\n\tfor _, t := range fsm.Transitions {\n\t\tif t.From == fsm.CurrentState.Name && t.Event == event.Action {\n\t\t\tfsm.beginTransition(t, event)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"Error: No transition supports the current state ('%s') and the sent event ('%s')\", fsm.CurrentState.Name, event.Action)\n}",
"func (t *TelegramMock) SendAction(chatID int, action string) int {\n\tt.Calls.SendAction++\n\tstatusCode := 200\n\treturn statusCode\n}",
"func (p *Provider) ExecuteEventAction(ctx context.Context, action event.Action) interactive.GenericMessage {\n\te := p.executorFactory.NewDefault(execute.NewDefaultInput{\n\t\tConversation: execute.Conversation{\n\t\t\tIsAuthenticated: true,\n\t\t\tExecutorBindings: action.ExecutorBindings,\n\t\t\tCommandOrigin: command.AutomationOrigin,\n\t\t\tAlias: unknownValue,\n\t\t\tID: unknownValue,\n\t\t},\n\t\tCommGroupName: unknownValue,\n\t\tPlatform: unknownValue,\n\t\tNotifierHandler: &universalNotifierHandler{},\n\t\tMessage: strings.TrimSpace(strings.TrimPrefix(action.Command, universalBotNamePlaceholder)),\n\t\tUser: fmt.Sprintf(\"Automation %q\", action.DisplayName),\n\t})\n\tresponse := e.Execute(ctx)\n\n\treturn &genericMessage{response: response}\n}",
"func (t *eftlTrigger) RunAction(actionId string, payload string, destination string, subject string) {\n\tlog.Debug(\"Starting new Process Instance\")\n\tlog.Debugf(\"Action Id: %s\", actionId)\n\n\treq := t.constructStartRequest(payload, destination, subject)\n\n\tstartAttrs, _ := t.metadata.OutputsToAttrs(req.Data, false)\n\n\taction := action.Get(actionId)\n\n\tcontext := trigger.NewContext(context.Background(), startAttrs)\n\n\t_, replyData, err := t.runner.Run(context, action, actionId, nil)\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\n\tlog.Debugf(\"Ran action: [%s]\", actionId)\n\tlog.Debugf(\"Reply data: [%v]\", replyData)\n\n}",
"func (m *Machine) SendEvent(o Object, e Event) ([]ActionResult, error) {\n\ttrs, err := m.AvailableTransitions(o, e)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(trs) != 1 {\n\t\treturn nil, fmt.Errorf(\"SendEvent: expected 1 transition in SendEvent, but got %d; input: %v, %v\", len(trs), o, e)\n\t}\n\n\tt := trs[0]\n\n\tvar actionResults []ActionResult\n\n\tfor _, tAction := range t.Actions {\n\t\taction, err := m.md.getActionByName(tAction.Name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult := action.F(m.ctx, o, tAction.Params, actionResults)\n\t\tif result.Err != nil {\n\t\t\t// TODO use wrapped errors and wrap it with action name\n\t\t\treturn nil, result.Err\n\t\t}\n\t\tactionResults = append(actionResults, result)\n\t}\n\n\to.SetStatus(t.To)\n\treturn actionResults, nil\n}",
"func SendSystemAction(text string, ephemeral bool) error {\n\tmessage := events.ActionEvent{\n\t\tMessageEvent: events.MessageEvent{\n\t\t\tBody: text,\n\t\t},\n\t}\n\n\tmessage.SetDefaults()\n\tmessage.RenderBody()\n\n\tif err := Broadcast(&message); err != nil {\n\t\tlog.Errorln(\"error sending system chat action\")\n\t}\n\n\tif !ephemeral {\n\t\tsaveEvent(message.ID, nil, message.Body, message.GetMessageType(), nil, message.Timestamp, nil, nil, nil, nil)\n\t}\n\n\treturn nil\n}",
"func (fsm *FSM) callAction(event Event) bool {\n\tobj := reflect.ValueOf(fsm)\n\tmethod := obj.MethodByName(fsm.CurrentState.Action)\n\t// Convert to a function with the right signature\n\tcallable := method.Interface().(func(string, http.ResponseWriter) bool)\n\treturn callable(event.Param, event.Writer)\n}",
"func SendAction(url string, action *iotextypes.Action) error {\n\tconn, err := ConnectToEndpoint(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\tcli := iotexapi.NewAPIServiceClient(conn)\n\treq := &iotexapi.SendActionRequest{Action: action}\n\tif _, err = cli.SendAction(context.Background(), req); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (c *Component) sendMessage(messageToSend messagePredicate, mid int) int {\n\t//if _, isFP := messageToSend.predicate.(False); isFP{\n\t//\treturn -1\n\t//}\n\t//mid := c.ncomm.getMessageId()\n\tvar msgWithMid Message\n\tif messageToSend.invalid {\n\t\tmsgWithMid = Message{\n\t\t\tMessage: NewTuple(),\n\t\t\tPred: False(),\n\t\t\tId: mid,\n\t\t}\n\t} else {\n\t\tmsgWithMid = Message{\n\t\t\tMessage: decodeTuple(messageToSend.message),\n\t\t\tPred: messageToSend.predicate,\n\t\t\tId: mid,\n\t\t}\n\t}\n\tc.chnEvtMessageSent <- mid\n\tif _, ok := msgWithMid.Pred.(_false); !ok {\n\t\tdprintln(\"Sending\", c.agent.GetComponentId(), \"->\", msgWithMid.Message, \"[\", msgWithMid.Id, \"]\")\n\t}\n\t//c.ncomm.chnOutbox <- msgWithMid\n\tc.agent.Outbox() <- msgWithMid\n\treturn mid\n}",
"func SendEvent(i int, e bar.Event) {\n\tt := instance.Load().(*TestBar)\n\tif i >= len(t.names) {\n\t\tassert.Fail(t, \"Cannot send event\",\n\t\t\t\"Clicked on segment %d, but only have %d\",\n\t\t\ti, len(t.names))\n\t\treturn\n\t}\n\tt.eventEncoder.Encode(struct {\n\t\tbar.Event\n\t\tName string `json:\"name\"`\n\t}{\n\t\tEvent: e,\n\t\tName: t.names[i],\n\t})\n\tt.stdin.WriteString(\",\\n\")\n}",
"func (a ActionFunc) Execute(ctx context.Context, state *Peco, e termbox.Event) {\n\ta(ctx, state, e)\n}",
"func (mock *MockEngine) Action(eventKey *tcell.EventKey) {\n\tmock.Called(eventKey)\n}",
"func (m *StateMachine) Trigger(currentState State, event Event, args ...interface{}) error {\n\ttrans := m.findTransMatching(currentState, event)\n\tif trans == nil {\n\t\treturn smError{event, currentState}\n\t}\n\n\tvar err error\n\t//if trans.PreAction != \"\" {\n\terr = m.delegate.HandleEvent(trans.PreAction,trans.NextAction, currentState, trans.To, args)\n\t//}\n\treturn err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
AcceptInvitation accepts/approves connection invitation.
|
func (s *Service) AcceptInvitation(connectionID, publicDID, label string, routerConnections []string) error {
return s.accept(connectionID, publicDID, label, StateIDInvited,
"accept exchange invitation", routerConnections)
}
|
[
"func (c *Client) AcceptInvitation(i *Invitation, myLabel string) (string, error) {\n\tcast := outofband.Invitation(*i)\n\n\tconnID, err := c.oobService.AcceptInvitation(&cast, myLabel)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"out-of-band service failed to accept invitation : %w\", err)\n\t}\n\n\treturn connID, err\n}",
"func (s *Service) AcceptInvitation(i *Invitation, myLabel string) (string, error) {\n\tconnID, err := s.handleCallback(&callback{\n\t\tmsg: service.NewDIDCommMsgMap(i),\n\t\toptions: &userOptions{myLabel: myLabel},\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to accept invitation : %w\", err)\n\t}\n\n\treturn connID, nil\n}",
"func (client *Client) AcceptFabricInvitation(request *AcceptFabricInvitationRequest) (response *AcceptFabricInvitationResponse, err error) {\n\tresponse = CreateAcceptFabricInvitationResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}",
"func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/repository_invitations/%v\", invitationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: remove custom Accept header when this API fully launches.\n\treq.Header.Set(\"Accept\", mediaTypeRepositoryInvitationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}",
"func (client *Client) AcceptFabricInvitationWithCallback(request *AcceptFabricInvitationRequest, callback func(response *AcceptFabricInvitationResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *AcceptFabricInvitationResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.AcceptFabricInvitation(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}",
"func (c *Client) AcceptRequest(piID string, msg *IssueCredential) error {\n\treturn c.service.ActionContinue(piID, WithIssueCredential(msg))\n}",
"func acceptSecurityHubMemberInvitation(s SecurityHubMemberClient, masterAccountID *string) error {\n\tinvitations, err := s.ListInvitations(nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error retrieving list of invitations: %w\", err)\n\t}\n\tvar invitationID *string\n\tfor _, inv := range invitations.Invitations {\n\t\tif *inv.AccountId == *masterAccountID {\n\t\t\tinvitationID = inv.InvitationId\n\t\t\tbreak\n\t\t}\n\t}\n\tif invitationID == nil {\n\t\treturn fmt.Errorf(\"can't find invitation from master account\")\n\t}\n\n\t_, err = s.AcceptInvitation(&securityhub.AcceptInvitationInput{\n\t\tInvitationId: invitationID,\n\t\tMasterId: masterAccountID,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error accepting invitation: %w\", err)\n\t}\n\n\treturn nil\n}",
"func (client *Client) AcceptFabricInvitationWithChan(request *AcceptFabricInvitationRequest) (<-chan *AcceptFabricInvitationResponse, <-chan error) {\n\tresponseChan := make(chan *AcceptFabricInvitationResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.AcceptFabricInvitation(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}",
"func (r *ProposalResponder) Accept(ctx context.Context, acc ChannelProposalAccept) (*Channel, error) {\n\tif ctx == nil {\n\t\treturn nil, errors.New(\"context must not be nil\")\n\t}\n\n\tif !r.called.TrySet() {\n\t\tlog.Panic(\"multiple calls on proposal responder\")\n\t}\n\n\treturn r.client.handleChannelProposalAcc(ctx, r.peer, r.req, acc)\n}",
"func (lobby *Lobby) Invite(conn *Connection, inv *Invitation) {\n\tlobby.s.DoWithOther(conn, func() {\n\t\tinv.From = conn.User\n\t\tinv.Message.User = conn.User\n\t\tinv.Message.Time = time.Now().In(lobby.location())\n\t\tif inv.All {\n\t\t\tlobby.sendInvitation(inv, All)\n\t\t\tlobby.sendInvitationCallback(conn, nil)\n\t\t} else {\n\n\t\t\tvar find *Connection\n\t\t\tit := NewConnectionsIterator(lobby.Waiting)\n\t\t\tfor it.Next() {\n\t\t\t\twaiter := it.Value()\n\t\t\t\tif waiter.User.Name == inv.To {\n\t\t\t\t\tfind = conn\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif find != nil {\n\t\t\t\tlobby.sendInvitation(inv, Me(find))\n\t\t\t\tlobby.sendInvitationCallback(conn, nil)\n\t\t\t} else {\n\t\t\t\tlobby.sendInvitationCallback(conn, re.ErrorUserNotFound())\n\t\t\t}\n\t\t}\n\t})\n}",
"func AcceptInviteHandler(w http.ResponseWriter, r *http.Request) {\n\tproject := &models.Project{}\n\tctx := r.Context()\n\ttoken := ctx.Value(\"tokenuid\")\n\ttokenStruct := token.(*auth.Token)\n\tuserDetails, err := utils.GetUserDetails(tokenStruct.UID)\n\tif err != nil {\n\t\tlog.Println(\"AcceptInviteHandler: <Error while fetching user details> \", err)\n\t\tresponses.ERROR(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\n\terr = json.NewDecoder(r.Body).Decode(&project)\n\tif err != nil {\n\t\tlog.Println(\"AcceptInviteHandler: <Error while decoding request body> \", err)\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\n\terr = project.AcceptInvite(userDetails)\n\tif err != nil {\n\t\tlog.Println(\"AcceptInviteHandler: \", err)\n\t\tresponses.ERROR(w, http.StatusBadRequest, errors.New(\"failed to accept invitation\"))\n\t\treturn\n\t}\n\tresponses.JSON(w, http.StatusOK, \"Project Invitation Accepted\")\n}",
"func (mr *MockRAMAPIMockRecorder) AcceptResourceShareInvitation(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"AcceptResourceShareInvitation\", reflect.TypeOf((*MockRAMAPI)(nil).AcceptResourceShareInvitation), arg0)\n}",
"func (s *Service) SaveInvitation(i *Invitation) error {\n\ttarget, err := chooseTarget(i.Service)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to choose a target to connect against : %w\", err)\n\t}\n\n\t// TODO where should we save this invitation? - https://github.com/hyperledger/aries-framework-go/issues/1547\n\terr = s.connections.SaveInvitation(i.ID+\"-TODO\", i)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to save oob invitation : %w\", err)\n\t}\n\n\terr = s.didSvc.SaveInvitation(&didexchange.OOBInvitation{\n\t\tID: uuid.New().String(),\n\t\tThreadID: i.ID,\n\t\tTheirLabel: i.Label,\n\t\tTarget: target,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"the didexchange service failed to save the oob invitation : %w\", err)\n\t}\n\n\treturn nil\n}",
"func (mr *MockRAMAPIMockRecorder) AcceptResourceShareInvitationRequest(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"AcceptResourceShareInvitationRequest\", reflect.TypeOf((*MockRAMAPI)(nil).AcceptResourceShareInvitationRequest), arg0)\n}",
"func (c *Client) AcceptProposal(piID string, msg *OfferCredential) error {\n\treturn c.service.ActionContinue(piID, WithOfferCredential(msg))\n}",
"func (c *Client) HandleRequestWithInvitation(msg service.DIDCommMsg,\n\tinv *didexchange.Invitation, to *introduce.To) error {\n\tthID, err := msg.ThreadID()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"handle request with invitation threadID: %w\", err)\n\t}\n\n\treturn c.saveInvitationEnvelope(thID, InvitationEnvelope{\n\t\tInv: inv,\n\t\tRecps: []*introduce.Recipient{{To: to}},\n\t})\n}",
"func (_BasicTournament *BasicTournamentSession) AcceptAscensionChallenge(commitment [32]byte) (*types.Transaction, error) {\n\treturn _BasicTournament.Contract.AcceptAscensionChallenge(&_BasicTournament.TransactOpts, commitment)\n}",
"func (a *api) AcceptCandidate(w http.ResponseWriter, req *http.Request) {\n\tparams := mux.Vars(req)\n\tid := params[\"id\"]\n\n\terr := a.CandidateService.AcceptCandidate(req.Context(), id)\n\tif err != nil {\n\t\tif err == model.ErrCandidateDoesNotExist || err == model.ErrMeetingCountNotEnough {\n\t\t\ta.ReturnBadRequest(w, err)\n\t\t\treturn\n\t\t}\n\t\ta.ReturnInternalServerError(w, err)\n\t\treturn\n\t}\n\n\ta.ReturnOk(w, \"Successfully accepted candidate\", id)\n\tlog.Println(\"Successfully accepted candidate with id: \", id)\n}",
"func CreateAcceptFabricInvitationRequest() (request *AcceptFabricInvitationRequest) {\n\trequest = &AcceptFabricInvitationRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Baas\", \"2018-12-21\", \"AcceptFabricInvitation\", \"baas\", \"openAPI\")\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
AcceptExchangeRequest accepts/approves connection request.
|
func (s *Service) AcceptExchangeRequest(connectionID, publicDID, label string, routerConnections []string) error {
return s.accept(connectionID, publicDID, label, StateIDRequested,
"accept exchange request", routerConnections)
}
|
[
"func (c *Client) AcceptRequest(piID string, msg *IssueCredential) error {\n\treturn c.service.ActionContinue(piID, WithIssueCredential(msg))\n}",
"func (c *Client) AcceptRequest(r *Request, myLabel string) (string, error) {\n\tcast := outofband.Request(*r)\n\n\tconnID, err := c.oobService.AcceptRequest(&cast, myLabel)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"out-of-band service failed to accept request : %w\", err)\n\t}\n\n\treturn connID, err\n}",
"func (conn *Conn) handleConnectionRequest(b *bytes.Buffer) error {\n\tpacket := &connectionRequest{}\n\tif err := binary.Read(b, binary.BigEndian, packet); err != nil {\n\t\treturn fmt.Errorf(\"error reading connection request: %v\", err)\n\t}\n\tb.Reset()\n\n\tif err := b.WriteByte(idConnectionRequestAccepted); err != nil {\n\t\treturn fmt.Errorf(\"error writing connection request accepted ID: %v\", err)\n\t}\n\taddr := rakAddr(*conn.addr.(*net.UDPAddr))\n\tdata, err := (&addr).MarshalBinary()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error encoding connection request accepted client address: %v\", err)\n\t}\n\tif _, err := b.Write(data); err != nil {\n\t\treturn fmt.Errorf(\"error writing connection request accepted client address: %v\", err)\n\t}\n\t_ = binary.Write(b, binary.BigEndian, int16(0))\n\tfor i := 0; i < 20; i++ {\n\t\t// The middle of the connection request accepted packet has 20 system addresses. We write these\n\t\t// separately.\n\t\tvar addr *rakAddr\n\t\tencodedAddr, err := addr.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error encoding connection request accepted system address: %v\", err)\n\t\t}\n\t\tif _, err := b.Write(encodedAddr); err != nil {\n\t\t\treturn fmt.Errorf(\"error writing connection request accepted system address: %v\", err)\n\t\t}\n\t}\n\tresponse := &connectionRequestAccepted{RequestTimestamp: packet.RequestTimestamp, AcceptedTimestamp: timestamp()}\n\tif err := binary.Write(b, binary.BigEndian, response); err != nil {\n\t\treturn fmt.Errorf(\"error writing connection request accepted: %v\", err)\n\t}\n\tif _, err := conn.Write(b.Bytes()); err != nil {\n\t\treturn fmt.Errorf(\"error sending connection request accepted: %v\", err)\n\t}\n\n\treturn nil\n}",
"func (px *Paxos) Accept(args *AcceptArgs, reply *AcceptReply) error {\n *reply = *px.doAccept(args)\n return nil\n}",
"func (s *Service) AcceptRequest(r *Request, myLabel string) (string, error) {\n\tconnID, err := s.handleCallback(&callback{\n\t\tmsg: service.NewDIDCommMsgMap(r),\n\t\toptions: &userOptions{myLabel: myLabel},\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to accept request : %w\", err)\n\t}\n\n\treturn connID, err\n}",
"func (client *Client) AcceptCall(request *AcceptCallRequest) (*Ok, error) {\n\t// Unlock receive function at the end of this function to mark received event as processed\n\tdefer client.Unlock(\"AcceptCall\")\n\tresult, err := client.Send(Request{\n\t\tmeta: meta{\n\t\t\tType: \"acceptCall\",\n\t\t},\n\t\tData: map[string]interface{}{\n\t\t\t\"call_id\": request.CallID,\n\t\t\t\"protocol\": request.Protocol,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.Type == \"error\" {\n\t\treturn nil, buildResponseError(result.Data)\n\t}\n\n\treturn UnmarshalOk(result.Data)\n}",
"func (u *testUpstream) Exchange(m *dns.Msg) (resp *dns.Msg, err error) {\n\tresp = &dns.Msg{}\n\tresp.SetReply(m)\n\n\tif u.ans != nil {\n\t\tresp.Answer = append(resp.Answer, u.ans...)\n\t}\n\n\tecs, _ := ecsFromMsg(m)\n\tif ecs != nil {\n\t\tu.ecsReqIP = ecs.IP\n\t\tu.ecsReqMask, _ = ecs.Mask.Size()\n\t}\n\tif u.ecsIP != nil {\n\t\tsetECS(resp, u.ecsIP, 24)\n\t}\n\n\treturn resp, nil\n}",
"func (r *ProposalResponder) Accept(ctx context.Context, acc ChannelProposalAccept) (*Channel, error) {\n\tif ctx == nil {\n\t\treturn nil, errors.New(\"context must not be nil\")\n\t}\n\n\tif !r.called.TrySet() {\n\t\tlog.Panic(\"multiple calls on proposal responder\")\n\t}\n\n\treturn r.client.handleChannelProposalAcc(ctx, r.peer, r.req, acc)\n}",
"func (s *KVServer) Accept(c context.Context, r *Proposer) (*Acceptor, error) {\n\n\tpretty.Logf(\"Acceptor: recv Accept-request: %v\", r)\n\n\tv := s.getLockedVersion(r.Id)\n\tdefer v.mu.Unlock()\n\n\t// a := &X{}\n\t// `b := &*a` does not deref the reference, b and a are the same pointer.\n\td := *v.acceptor.LastBal\n\treply := Acceptor{\n\t\tLastBal: &d,\n\t}\n\n\tif r.Bal.GE(v.acceptor.LastBal) {\n\t\tv.acceptor.LastBal = r.Bal\n\t\tv.acceptor.Val = r.Val\n\t\tv.acceptor.VBal = r.Bal\n\t}\n\n\treturn &reply, nil\n}",
"func (a *ACL) Request(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error) {\n\tctx = WithConfig(ctx) // Guarantees we will retrieve a non-nil VppAgentConfig from context.Context\n\tvppAgentConfig := Config(ctx)\n\n\tctx = WithConnectionMap(ctx) // Guarantees we will retrieve a non-nil Connectionmap from context.Context\n\tconnectionMap := ConnectionMap(ctx)\n\n\tiface := connectionMap[request.GetConnection().GetId()]\n\n\tif iface == nil || iface.Name == \"\" {\n\t\terr := errors.New(\"found empty incoming connection name\")\n\t\treturn nil, err\n\t}\n\n\terr := a.appendDataChange(vppAgentConfig, iface.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif endpoint.Next(ctx) != nil {\n\t\treturn endpoint.Next(ctx).Request(ctx, request)\n\t}\n\n\treturn request.GetConnection(), nil\n}",
"func (conn *Conn) handleConnectionRequestAccepted(b *bytes.Buffer) error {\n\tb.Reset()\n\n\tif err := b.WriteByte(idNewIncomingConnection); err != nil {\n\t\treturn fmt.Errorf(\"error writing new incoming connection ID: %v\", err)\n\t}\n\taddr := rakAddr(*conn.addr.(*net.UDPAddr))\n\tdata, err := (&addr).MarshalBinary()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error encoding new incoming ocnnection server address: %v\", err)\n\t}\n\tif _, err := b.Write(data); err != nil {\n\t\treturn fmt.Errorf(\"error writing new incoming connection server address: %v\", err)\n\t}\n\tfor i := 0; i < 20; i++ {\n\t\t// The middle of the connection request accepted packet has 20 system addresses. We write these\n\t\t// separately.\n\t\tvar addr *rakAddr\n\t\tencodedAddr, err := addr.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error encoding new incoming connection system address: %v\", err)\n\t\t}\n\t\tif _, err := b.Write(encodedAddr); err != nil {\n\t\t\treturn fmt.Errorf(\"error writing new incoming connection system address: %v\", err)\n\t\t}\n\t}\n\t// We fill out nonsense timestamps as RakNet doesn't REALLY care about these.\n\tresponse := &newIncomingConnection{RequestTimestamp: timestamp(), AcceptedTimestamp: timestamp()}\n\tif err := binary.Write(b, binary.BigEndian, response); err != nil {\n\t\treturn fmt.Errorf(\"error writing new incoming connection: %v\", err)\n\t}\n\tif _, err := conn.Write(b.Bytes()); err != nil {\n\t\treturn fmt.Errorf(\"error sending new incoming connection: %v\", err)\n\t}\n\n\tconn.finishSequence()\n\treturn nil\n}",
"func (auth *HorizonAuthenticate) authenticateWithExchange(otherOrg string, appKey string, appSecret string, exURL string) (int, string, string) {\n\tif log.IsLogging(logger.DEBUG) {\n\t\tlog.Debug(cssALS(fmt.Sprintf(\"received exchange authentication request for URL Path %v user %v\", otherOrg, appKey)))\n\t}\n\n\t// Assume the request will be rejected.\n\tauthCode := security.AuthFailed\n\tauthOrg := \"\"\n\tauthId := \"\"\n\n\t// If the appKey is shaped like a node identity, then let's make sure it is a node identity.\n\tif parts := strings.Split(appKey, \"/\"); len(parts) == 3 {\n\n\t\t// A 3 part '/' delimited identity has to be a node identity.\n\t\tif trace.IsLogging(logger.TRACE) {\n\t\t\ttrace.Debug(cssALS(fmt.Sprintf(\"authentication request for user %v appears to be a node identity\", appKey)))\n\t\t}\n\n\t\tif err := auth.verifyNodeIdentity(parts[2], parts[0], appSecret, ExchangeURL()); err != nil {\n\t\t\tif log.IsLogging(logger.ERROR) {\n\t\t\t\tlog.Error(cssALS(fmt.Sprintf(\"unable to verify identity %v, error %v\", appKey, err)))\n\t\t\t}\n\t\t} else {\n\t\t\tauthCode = security.AuthEdgeNode\n\t\t\tauthOrg = parts[0] //orgId\n\t\t\tauthId = parts[1] + \"/\" + parts[2] //destinationType/destinationId (pattern/nodeId)\n\t\t}\n\n\t} else if parts := strings.Split(appKey, \"/\"); len(parts) == 2 {\n\t\t// If the appKey is shaped like a user identity, a node user identity or an agbot identity, then let's make sure it is one of these.\n\t\t// The identity is checked for agbot first because it is expected to be an agbot most of the time.\n\n\t\t// A 2 part '/' delimited identity could be an agbot identity.\n\t\tif trace.IsLogging(logger.TRACE) {\n\t\t\ttrace.Debug(cssALS(fmt.Sprintf(\"attempting authentication request as an agbot %v\", appKey)))\n\t\t}\n\n\t\t// Agbots are admins by default. If an error is returned, check if the identity is a user.\n\t\tif err := auth.verifyAgbotIdentity(parts[1], parts[0], appSecret, ExchangeURL()); err == nil {\n\t\t\t// We have a valid agbot identity.\n\t\t\tauthCode = security.AuthSyncAdmin // This makes the agbot a super user in the CSS so that it can query multiple orgs.\n\t\t\tauthOrg = parts[0]\n\t\t\tauthId = parts[1]\n\n\t\t} else {\n\t\t\t// Check if the identity is a user, since we know its not an agbot. If an error is returned, check if the identity is a node user.\n\t\t\tif trace.IsLogging(logger.WARNING) {\n\t\t\t\tlog.Warning(cssALS(fmt.Sprintf(\"unable to verify identity %v as agbot, error %v\", appKey, err)))\n\t\t\t}\n\t\t\tif trace.IsLogging(logger.TRACE) {\n\t\t\t\ttrace.Debug(cssALS(fmt.Sprintf(\"attempting authentication request as a user %v\", appKey)))\n\t\t\t}\n\t\t\t// appkey: {org}/{username} or {org}/iamapikey.\n\t\t\t// parts[1] is {username} or iamapikey, parts[0] is {orgId}\n\t\t\tif exchangeRole, username, err := auth.verifyUserIdentity(parts[1], parts[0], appSecret, ExchangeURL()); err != nil {\n\t\t\t\tif log.IsLogging(logger.WARNING) {\n\t\t\t\t\tlog.Warning(cssALS(fmt.Sprintf(\"unable to verify identity %v as user, error %v\", appKey, err)))\n\t\t\t\t}\n\t\t\t\tif trace.IsLogging(logger.TRACE) {\n\t\t\t\t\ttrace.Debug(cssALS(fmt.Sprintf(\"attempting authentication request as an exchange node %v\", appKey)))\n\t\t\t\t}\n\t\t\t\t// Check if the identity is an exchange node\n\t\t\t\t// appkey: {org}/{nodeId}. appSecret is {nodeToken}.\n\t\t\t\t// parts[0] is {orgId}, parts[1] is {nodeId}\n\t\t\t\tif err := auth.verifyNodeIdentity(parts[1], parts[0], appSecret, ExchangeURL()); err != nil {\n\t\t\t\t\tif log.IsLogging(logger.ERROR) {\n\t\t\t\t\t\tlog.Error(cssALS(fmt.Sprintf(\"unable to verify identity %v as exchange node, error %v\", appKey, err)))\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// exchange node is AuthNodeUser. Without configuring ACLs, AuthNodeUser only has read access to public objects of any org, and have read access to manifest under its own org\n\t\t\t\t\tauthCode = security.AuthNodeUser\n\t\t\t\t\tauthOrg = parts[0]\n\t\t\t\t\tauthId = parts[1]\n\t\t\t\t}\n\t\t\t} else if exchangeRole == EX_ROOT_USER || exchangeRole == EX_HUB_ADMIN {\n\t\t\t\t// root/root:{pwd} and hub admin are super users across all orgs\n\t\t\t\tauthCode = security.AuthSyncAdmin\n\t\t\t\tauthOrg = parts[0]\n\t\t\t\tauthId = username\n\t\t\t} else if exchangeRole == EX_ORG_ADMIN {\n\t\t\t\t// exchange org admin are authAdmin, have write/read acess to MMS objects and manifests under its own org\n\t\t\t\tauthCode = security.AuthAdmin\n\t\t\t\tauthOrg = parts[0]\n\t\t\t\tauthId = username\n\t\t\t} else {\n\t\t\t\t// exchange regular users are always mapped to AuthObjectAdmin, have write/read access to all MMS objects under its own org\n\t\t\t\t// It also gives them read access to public objects in other orgs without needing an ACL. AuthObjectAdmin doesn't have write access to manifests\n\t\t\t\tauthCode = security.AuthObjectAdmin\n\t\t\t\tauthOrg = parts[0]\n\t\t\t\tauthId = username\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\tif log.IsLogging(logger.ERROR) {\n\t\t\tlog.Error(cssALS(fmt.Sprintf(\"request identity %v is not in a supported format, must be either <org>/<destination type>/<destination id> for a node, <org>/<agbot id> for an agbot, <org>/<user id> for a user, or <org>/<node id> for a node user.\", appKey)))\n\t\t}\n\t}\n\n\t// Log the results of the authentication.\n\tif log.IsLogging(logger.DEBUG) {\n\t\tlog.Debug(cssALS(fmt.Sprintf(\"returned exchange authentication result code %v org %v id %v\", authCode, authOrg, authId)))\n\t}\n\treturn authCode, authOrg, authId\n}",
"func (px *Paxos) local_accept(agreement_number int, proposal *Proposal) *AcceptReply {\n px.mu.Lock()\n defer px.mu.Unlock()\n var reply AcceptReply\n\n _, present := px.state[agreement_number]\n if !present {\n //fmt.Println(\"AgreementState should exist in local_accept!!!\")\n px.state[agreement_number] = px.make_default_agreementstate()\n } \n\n if proposal.Number >= px.state[agreement_number].highest_promised {\n px.state[agreement_number].set_highest_promised(proposal.Number)\n px.state[agreement_number].set_accepted_proposal(proposal)\n reply.Accept_ok = true\n reply.Highest_done = px.done[px.peers[px.me]]\n //fmt.Printf(\"Accept_ok (%s): agree_num: %d, prop: %d, val: %v, h_done: %d\\n\", short_name(px.peers[px.me], 7), agreement_number, proposal.Number, proposal.Value, reply.Highest_done)\n return &reply\n }\n reply.Accept_ok = false\n reply.Highest_done = px.done[px.peers[px.me]]\n //fmt.Printf(\"Accept_no (%s): agree_num: %d, prop: %d, h_done: %d\\n\", short_name(px.peers[px.me], 7), agreement_number, proposal.Number, reply.Highest_done)\n return &reply\n}",
"func (c *Client) confirmRequest(request *Request) {\n\tselect {\n\tcase request.confirmed <- struct{}{}:\n\t\treturn\n\tcase <-time.After(chanSendWaitTime):\n\t\tc.errorLog(\"nobody is waiting for confirmation on: %s\", stringifyRequestForLog(request))\n\t}\n}",
"func (s *Stream) Accept(w http.ResponseWriter, r *http.Request, channelKey string) error {\n\ts.u.CheckOrigin = func(r *http.Request) bool { return true }\n\n\tconn, err := s.u.Upgrade(w, r, nil)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to upgrade connection\")\n\t}\n\n\tcl := NewChannel(s.ctx, conn, channelKey)\n\ts.store(cl)\n\n\treturn nil\n}",
"func (s *session) approveFileTransferRequest(params *rsession.FileTransferDecisionParams, scx *ServerContext) (*fileTransferRequest, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tfileTransferReq := s.fileTransferRequests[params.RequestID]\n\tif fileTransferReq == nil {\n\t\treturn nil, trace.NotFound(\"File Transfer Request %s not found\", params.RequestID)\n\t}\n\n\tvar approver *party\n\tfor _, p := range s.parties {\n\t\tif p.ctx.ID() == scx.ID() {\n\t\t\tapprover = p\n\t\t}\n\t}\n\tif approver == nil {\n\t\treturn nil, trace.AccessDenied(\"cannot approve file transfer requests if not in the current moderated session\")\n\t}\n\n\tfileTransferReq.approvers[approver.user] = approver\n\ts.BroadcastMessage(\"%s approved file transfer request %s\", scx.Identity.TeleportUser, fileTransferReq.id)\n\n\t// check if policy is fulfilled\n\tapproved, err := s.checkIfFileTransferApproved(fileTransferReq)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tvar eventType FileTransferRequestEvent\n\tif approved {\n\t\teventType = FileTransferApproved\n\t} else {\n\t\teventType = FileTransferUpdate\n\t}\n\n\ts.registry.NotifyFileTransferRequest(fileTransferReq, eventType, scx)\n\n\treturn fileTransferReq, nil\n}",
"func (u *testDNSSECUpstream) Exchange(m *dns.Msg) (resp *dns.Msg, err error) {\n\tresp = &dns.Msg{}\n\tresp.SetReply(m)\n\n\tq := m.Question[0]\n\tswitch q.Qtype {\n\tcase dns.TypeA:\n\t\tresp.Answer = append(resp.Answer, u.a)\n\tcase dns.TypeTXT:\n\t\tresp.Answer = append(resp.Answer, u.txt)\n\tcase dns.TypeDS:\n\t\tresp.Answer = append(resp.Answer, u.ds)\n\tdefault:\n\t\t// Go on. The RRSIG resource record is added afterward. This\n\t\t// upstream.Upstream implementation doesn't handle explicit\n\t\t// requests for it.\n\t}\n\n\tif len(resp.Answer) > 0 {\n\t\tresp.Answer[0].Header().Ttl = defaultTestTTL\n\t}\n\n\tif o := m.IsEdns0(); o != nil {\n\t\tresp.Answer = append(resp.Answer, u.rrsig)\n\n\t\tresp.SetEdns0(defaultUDPBufSize, o.Do())\n\t}\n\n\treturn resp, nil\n}",
"func (s *Service) InterceptAccept(n network.ConnMultiaddrs) (allow bool) {\n\tif s.cfg.DisableListen {\n\t\tlog.Trace(fmt.Sprintf(\"peer:%s reason:Not accepting inbound dial\", n.RemoteMultiaddr()))\n\t\treturn false\n\t}\n\treturn filterConnections(s.addrFilter, n.RemoteMultiaddr())\n}",
"func (plugin *RateLimitingPlugin) HandleConnAccept() bool {\n\t//return conn, plugin.bucket.TakeAvailable(1) > 0\n\treturn plugin.bucket.TakeAvailable(1) > 0\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SaveInvitation saves this invitation created by you.
|
func (s *Service) SaveInvitation(i *OOBInvitation) error {
i.Type = oobMsgType
err := s.connectionRecorder.SaveInvitation(i.ThreadID, i)
if err != nil {
return fmt.Errorf("failed to save oob invitation : %w", err)
}
logger.Debugf("saved invitation: %+v", i)
return nil
}
|
[
"func (s *Service) SaveInvitation(i *Invitation) error {\n\ttarget, err := chooseTarget(i.Service)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to choose a target to connect against : %w\", err)\n\t}\n\n\t// TODO where should we save this invitation? - https://github.com/hyperledger/aries-framework-go/issues/1547\n\terr = s.connections.SaveInvitation(i.ID+\"-TODO\", i)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to save oob invitation : %w\", err)\n\t}\n\n\terr = s.didSvc.SaveInvitation(&didexchange.OOBInvitation{\n\t\tID: uuid.New().String(),\n\t\tThreadID: i.ID,\n\t\tTheirLabel: i.Label,\n\t\tTarget: target,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"the didexchange service failed to save the oob invitation : %w\", err)\n\t}\n\n\treturn nil\n}",
"func (il *InvitationLog) Save(db XODB) error {\n\tif il.Exists() {\n\t\treturn il.Update(db)\n\t}\n\n\treturn il.Insert(db)\n}",
"func (imr *InvitationMechsRule) Save(db XODB) error {\n\tif imr.Exists() {\n\t\treturn imr.Update(db)\n\t}\n\n\treturn imr.Insert(db)\n}",
"func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/repository_invitations/%v\", invitationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: remove custom Accept header when this API fully launches.\n\treq.Header.Set(\"Accept\", mediaTypeRepositoryInvitationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}",
"func (c *Client) AcceptInvitation(i *Invitation, myLabel string) (string, error) {\n\tcast := outofband.Invitation(*i)\n\n\tconnID, err := c.oobService.AcceptInvitation(&cast, myLabel)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"out-of-band service failed to accept invitation : %w\", err)\n\t}\n\n\treturn connID, err\n}",
"func (s *Service) AcceptInvitation(connectionID, publicDID, label string, routerConnections []string) error {\n\treturn s.accept(connectionID, publicDID, label, StateIDInvited,\n\t\t\"accept exchange invitation\", routerConnections)\n}",
"func (s *Service) AcceptInvitation(i *Invitation, myLabel string) (string, error) {\n\tconnID, err := s.handleCallback(&callback{\n\t\tmsg: service.NewDIDCommMsgMap(i),\n\t\toptions: &userOptions{myLabel: myLabel},\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to accept invitation : %w\", err)\n\t}\n\n\treturn connID, nil\n}",
"func (a *InvitationsApiService) CreateInvitation(ctx _context.Context, space string) ApiCreateInvitationRequest {\n\treturn ApiCreateInvitationRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tspace: space,\n\t}\n}",
"func (tx TxRepo) CreateInvitation(inv licence.Invitation) error {\n\t_, err := tx.NamedExec(licence.StmtCreateInvitation, inv)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (p *PlayerDB) Invite(inviterID int) *response.Error {\n\tinvite := HuntInvitationDB{\n\t\tHuntID: p.HuntID,\n\t\tEmail: p.Email,\n\t\tInviterID: inviterID,\n\t}\n\n\treturn invite.Insert()\n}",
"func (c *Client) CreateInvitation(protocols []string, opts ...MessageOption) (*Invitation, error) {\n\tmsg := &message{}\n\n\tfor _, opt := range opts {\n\t\tif err := opt(msg); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create invitation: %w\", err)\n\t\t}\n\t}\n\n\tinv := &Invitation{\n\t\tID: uuid.New().String(),\n\t\tType: InvitationMsgType,\n\t\tLabel: msg.Label,\n\t\tGoal: msg.Goal,\n\t\tGoalCode: msg.GoalCode,\n\t\tService: msg.Service,\n\t\tProtocols: protocols,\n\t}\n\n\tif len(inv.Service) == 0 {\n\t\tsvc, err := c.didDocSvcFunc()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create a new inlined did doc service block : %w\", err)\n\t\t}\n\n\t\tinv.Service = []interface{}{svc}\n\t}\n\n\tif len(inv.Protocols) == 0 {\n\t\t// TODO should be injected into client\n\t\t// https://github.com/hyperledger/aries-framework-go/issues/1691\n\t\tinv.Protocols = []string{didexchange.PIURI}\n\t}\n\n\tcast := outofband.Invitation(*inv)\n\n\terr := c.oobService.SaveInvitation(&cast)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to save outofband invitation : %w\", err)\n\t}\n\n\treturn inv, nil\n}",
"func (invitation *Invitation) Update(db *gorm.DB) error {\n\tif err := db.Save(&invitation).Error; err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (s *Service) SaveRequest(r *Request) error {\n\t// TODO where should we save this request? - https://github.com/hyperledger/aries-framework-go/issues/1547\n\terr := s.connections.SaveInvitation(r.ID+\"-TODO\", r)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to save oob request : %w\", err)\n\t}\n\n\ttarget, err := chooseTarget(r.Service)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to choose a target to perform did-exchange against : %w\", err)\n\t}\n\n\terr = s.didSvc.SaveInvitation(&didexchange.OOBInvitation{\n\t\tID: uuid.New().String(),\n\t\tThreadID: r.ID,\n\t\tTheirLabel: r.Label,\n\t\tTarget: target,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"the didexchange service failed to save the oob invitation : %w\", err)\n\t}\n\n\treturn nil\n}",
"func (s *Master) SetInvitationId(v string) *Master {\n\ts.InvitationId = &v\n\treturn s\n}",
"func (r *InvitationRequest) Update(ctx context.Context, reqObj *Invitation) error {\n\treturn r.JSONRequest(ctx, \"PATCH\", \"\", reqObj, nil)\n}",
"func (a *InvitationsApiService) UpdateSentInvitation(ctx _context.Context, space string, invitationId string) ApiUpdateSentInvitationRequest {\n\treturn ApiUpdateSentInvitationRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tspace: space,\n\t\tinvitationId: invitationId,\n\t}\n}",
"func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/repository_invitations/%v\", invitationID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: remove custom Accept header when this API fully launches.\n\treq.Header.Set(\"Accept\", mediaTypeRepositoryInvitationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}",
"func (s *Administrator) SetInvitationId(v string) *Administrator {\n\ts.InvitationId = &v\n\treturn s\n}",
"func NewInvitation(ctx *pulumi.Context,\n\tname string, args *InvitationArgs, opts ...pulumi.ResourceOption) (*Invitation, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.RedirectUrl == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'RedirectUrl'\")\n\t}\n\tif args.UserEmailAddress == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'UserEmailAddress'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Invitation\n\terr := ctx.RegisterResource(\"azuread:index/invitation:Invitation\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
abandon updates the state to abandoned and trigger failure event.
|
func (s *Service) abandon(thID string, msg service.DIDCommMsg, processErr error) error {
// update the state to abandoned
nsThID, err := connection.CreateNamespaceKey(findNamespace(msg.Type()), thID)
if err != nil {
return err
}
connRec, err := s.connectionRecorder.GetConnectionRecordByNSThreadID(nsThID)
if err != nil {
return fmt.Errorf("unable to update the state to abandoned: %w", err)
}
connRec.State = (&abandoned{}).Name()
err = s.update(msg.Type(), connRec)
if err != nil {
return fmt.Errorf("unable to update the state to abandoned: %w", err)
}
// send the message event
s.sendMsgEvents(&service.StateMsg{
ProtocolName: DIDExchange,
Type: service.PostState,
Msg: msg,
StateID: StateIDAbandoned,
Properties: createErrorEventProperties(connRec.ConnectionID, "", processErr),
})
return nil
}
|
[
"func (s *Service) abandon(thID string, msg *service.DIDCommMsg, _ error) error {\n\t// update the state to abandoned\n\tif err := s.save(thID, &abandoning{}); err != nil {\n\t\treturn fmt.Errorf(\"save abandoning sate: %w\", err)\n\t}\n\n\t// TODO: add received error to Properties\n\t// send the message event\n\ts.sendMsgEvents(&service.StateMsg{\n\t\tProtocolName: Introduce,\n\t\tType: service.PostState,\n\t\tMsg: msg.Clone(),\n\t\tStateID: stateNameAbandoning,\n\t})\n\n\treturn nil\n}",
"func (h *Handler) Abandon(w ldap.ResponseWriter, m *ldap.Request) {\n\tvar req = m.GetAbandonRequest()\n\t// retrieve the request to abandon, and send a abort signal to it\n\tif requestToAbandon, ok := m.Conn.GetMessageByID(int(req)); ok {\n\t\trequestToAbandon.Abandon()\n\t\tlog.Infof(\"Abandon signal sent to request processor [messageID=%d]\", int(req))\n\t}\n}",
"func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) os.AbandonResult {\n\treturn os.Abandon(c, stackName, stackID)\n}",
"func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) AbandonResult {\n\tvar res AbandonResult\n\t_, res.Err = c.Delete(abandonURL(c, stackName, stackID), &gophercloud.RequestOpts{\n\t\tJSONResponse: &res.Body,\n\t\tOkCodes: []int{200},\n\t})\n\treturn res\n}",
"func (c *Client) AbandonTransaction(txid string) error {\n\t_, err := c.AbandonTransactionAsync(txid).Receive()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (o *TempFile) Abandon() error {\n\tif o.saved {\n\t\treturn nil\n\t}\n\tif !o.otempfile {\n\t\tos.Remove(o.Name())\n\t}\n\treturn o.File.Close()\n}",
"func (b *MemcacheBackend) SetStateFailure(signature *tasks.Signature, err string) error {\n\ttaskState := tasks.NewFailureTaskState(signature, err)\n\treturn b.updateState(taskState)\n}",
"func (m *ServiceMgr) cancelFailedRebalanceTask() error {\n\tm.updateState(func(s *state) {\n\t\ts.rebalanceTask = nil\n\t})\n\treturn nil\n}",
"func (b *MongodbBackend) SetStateFailure(signature *signatures.TaskSignature, err string) error {\n\tupdate := bson.M{\"state\": FailureState, \"error\": err}\n\treturn b.setState(signature, update)\n}",
"func (s *Switch) Unblock() error { return s.r.send(Event{op: OpChange, idx: s.idx, soft: false}) }",
"func (_ *MountainCarEnv) AtFailState(_ State) bool {\n\treturn false\n}",
"func (t *task) Fail() error {\n\tt.mu.Lock()\n\tt.status = models.AttackResponseStatusFailed\n\tt.mu.Unlock()\n\n\tt.SendUpdate()\n\n\tt.log(nil).Error(\"failed\")\n\treturn nil\n}",
"func TestSendStateReorgingTxResetsAbort(t *testing.T) {\n\tsendState := newSendState()\n\n\tsendState.ProcessSendError(core.ErrNonceTooLow)\n\tsendState.ProcessSendError(core.ErrNonceTooLow)\n\tsendState.TxMined(testHash)\n\tsendState.TxNotMined(testHash)\n\tsendState.ProcessSendError(core.ErrNonceTooLow)\n\trequire.False(t, sendState.ShouldAbortImmediately())\n}",
"func disable_state(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar err error\n\tfmt.Println(\"starting disable_state\")\n\n\tif len(args) != 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 2\")\n\t}\n\n\t// input sanitation\n\terr = sanitize_arguments(args)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tvar state_id = args[0]\n\t//var authed_by_company = args[1]\n\n\t// get the listing state data\n\tstate, err := get_state(stub, state_id)\n\tif err != nil {\n\t\treturn shim.Error(\"This state does not exist - \" + state_id)\n\t}\n\n\t// check authorizing company\n\t//if state.Company != authed_by_company {\n\t//\treturn shim.Error(\"The company '\" + authed_by_company + \"' cannot change another companies listing state\")\n\t//}\n\n\t// disable the state\n\tstate.Enabled = false\n\tjsonAsBytes, _ := json.Marshal(state) //convert to array of bytes\n\terr = stub.PutState(args[0], jsonAsBytes) //rewrite the state\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tfmt.Println(\"- end disable_state\")\n\treturn shim.Success(nil)\n}",
"func abortWatcher(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, chaosDetails *types.ChaosDetails, eventsDetails *types.EventDetails) {\n\t// waiting till the abort signal recieved\n\t<-abort\n\n\tlog.Info(\"[Chaos]: Killing process started because of terminated signal received\")\n\tlog.Info(\"Chaos Revert Started\")\n\t// retry thrice for the chaos revert\n\tretry := 3\n\tfor retry > 0 {\n\t\tif err := uncordonNode(experimentsDetails, clients, chaosDetails); err != nil {\n\t\t\tlog.Errorf(\"Unable to uncordon the node, err: %v\", err)\n\t\t}\n\t\tretry--\n\t\ttime.Sleep(1 * time.Second)\n\t}\n\tlog.Info(\"Chaos Revert Completed\")\n\tos.Exit(0)\n}",
"func (m *AntenatalMutation) ResetBabystatus() {\n\tm.babystatus = nil\n\tm.clearedbabystatus = false\n}",
"func (cm *connectionMaker) connectionAborted(address string, err error) {\n\tcm.actionChan <- func() bool {\n\t\ttarget := cm.targets[address]\n\t\ttarget.state = targetWaiting\n\t\ttarget.lastError = err\n\t\ttarget.nextTryLater()\n\t\treturn true\n\t}\n}",
"func (c *Conn) abort(e error) {\n\tc.stateMu.Lock()\n\tif c.state == connAlive {\n\t\tc.bgCancel()\n\t\tc.closeErr = e\n\t\tc.state = connDying\n\t\tgo c.teardown(newAbortMessage(nil, e))\n\t}\n\tc.stateMu.Unlock()\n}",
"func (r *Manager) Abort() {\n\tr.abortTimer <- true\n\tr.abortUpload <- true\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateConnection saves the record to the connection store and maps TheirDID to their recipient keys in the did connection store.
|
func (s *Service) CreateConnection(record *connection.Record, theirDID *did.Doc) error {
logger.Debugf("creating connection using record [%+v] and theirDID [%+v]", record, theirDID)
didMethod, err := vdr.GetDidMethod(theirDID.ID)
if err != nil {
return err
}
_, err = s.ctx.vdRegistry.Create(didMethod, theirDID, vdrapi.WithOption("store", true))
if err != nil {
return fmt.Errorf("vdr failed to store theirDID : %w", err)
}
err = s.connectionStore.SaveDIDFromDoc(theirDID)
if err != nil {
return fmt.Errorf("failed to save theirDID to the did.ConnectionStore: %w", err)
}
err = s.connectionStore.SaveDIDByResolving(record.MyDID)
if err != nil {
return fmt.Errorf("failed to save myDID to the did.ConnectionStore: %w", err)
}
return s.connectionRecorder.SaveConnectionRecord(record)
}
|
[
"func (self *server) CreateConnection(ctx context.Context, rqst *persistencepb.CreateConnectionRqst) (*persistencepb.CreateConnectionRsp, error) {\n\t// sqlpb\n\tfmt.Println(\"Try to create a new connection\")\n\tvar c connection\n\tvar err error\n\n\t// Set the connection info from the request.\n\tc.Id = rqst.Connection.Id\n\tc.Name = rqst.Connection.Name\n\tc.Host = rqst.Connection.Host\n\tc.Port = rqst.Connection.Port\n\tc.User = rqst.Connection.User\n\tc.Password = rqst.Connection.Password\n\tc.Store = rqst.Connection.Store\n\n\tif c.Store == persistencepb.StoreType_MONGO {\n\t\t// here I will create a new mongo data store.\n\t\ts := new(persistence_store.MongoStore)\n\n\t\t// Now I will try to connect...\n\t\terr := s.Connect(c.Host, c.Port, c.User, c.Password, c.Name, c.Timeout, c.Options)\n\t\tif err != nil {\n\t\t\t// codes.\n\t\t\treturn nil, status.Errorf(\n\t\t\t\tcodes.Internal,\n\t\t\t\tUtility.JsonErrorStr(Utility.FunctionName(), Utility.FileLine(), err))\n\t\t}\n\n\t\t// keep the store for futur call...\n\t\tself.stores[c.Id] = s\n\t}\n\n\t// set or update the connection and save it in json file.\n\tself.Connections[c.Id] = c\n\n\t// In that case I will save it in file.\n\terr = self.save()\n\tif err != nil {\n\t\treturn nil, status.Errorf(\n\t\t\tcodes.Internal,\n\t\t\tUtility.JsonErrorStr(Utility.FunctionName(), Utility.FileLine(), err))\n\t}\n\n\t// test if the connection is reacheable.\n\terr = self.stores[c.Id].Ping(ctx)\n\n\tif err != nil {\n\t\treturn nil, status.Errorf(\n\t\t\tcodes.Internal,\n\t\t\tUtility.JsonErrorStr(Utility.FunctionName(), Utility.FileLine(), err))\n\t}\n\n\t// Print the success message here.\n\tlog.Println(\"Connection \" + c.Id + \" was created with success!\")\n\n\treturn &persistencepb.CreateConnectionRsp{\n\t\tResult: true,\n\t}, nil\n}",
"func (store Store) CreateConnection(conn *connection.Connection) (*connection.Connection, error) {\n\tid, err := ksuid.NewRandom()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconn.ID = connection.ID(id.String())\n\n\tvalue, err := json.Marshal(conn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcreateConnection := etcd.OpPut(fmt.Sprintf(\"%s%s\", ConnectionsPrefix, string(conn.ID)), string(value))\n\tcreateJobs, err := store.createJobsOps(conn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tops := append(createJobs, createConnection)\n\t_, err = store.client.Txn(context.TODO()).Then(ops...).Commit()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstore.log.Debugw(\"Connection created.\", \"space\", conn.Space, \"connectionId\", conn.ID)\n\n\treturn conn, nil\n}",
"func (src *Chain) CreateConnection(dst *Chain, to time.Duration) error {\n\tticker := time.NewTicker(to)\n\tfor ; true; <-ticker.C {\n\t\tconnSteps, err := src.CreateConnectionStep(dst)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif !connSteps.Ready() {\n\t\t\tbreak\n\t\t}\n\n\t\tif connSteps.Send(src, dst); connSteps.success && connSteps.last {\n\t\t\tconns, err := QueryConnectionPair(src, dst, 0, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif src.debug {\n\t\t\t\tlogConnectionStates(src, dst, conns)\n\t\t\t}\n\n\t\t\tsrc.Log(fmt.Sprintf(\"★ Connection created: [%s]client{%s}conn{%s} -> [%s]client{%s}conn{%s}\",\n\t\t\t\tsrc.ChainID, src.PathEnd.ClientID, src.PathEnd.ConnectionID,\n\t\t\t\tdst.ChainID, dst.PathEnd.ClientID, dst.PathEnd.ConnectionID))\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (_CreditScoreDB *CreditScoreDBTransactor) CreateRecord(opts *bind.TransactOpts, _reason string, _score string, _nonce string, _scoreHash string) (*types.Transaction, error) {\n\treturn _CreditScoreDB.contract.Transact(opts, \"createRecord\", _reason, _score, _nonce, _scoreHash)\n}",
"func CreateRecord(c *pdns.Client, Zone string, Name string, IPaddress string, Type string) (string, error) {\n\texists, err := c.RecordExists(Zone, Name, Type)\n\tif exists == true {\n\t\treturn \"record already exists: \" + Name, err\n\t}\n\trec := pdns.Record{\n\t\tName: Name,\n\t\tType: Type,\n\t\tContent: IPaddress,\n\t\tTTL: 1800,\n\t\tDisabled: false,\n\t}\n\tstatus, err := c.CreateRecord(Zone, rec)\n\treturn status, err\n}",
"func (qm *Manager) ProcessTNSRecordCreation(msgs <-chan amqp.Delivery, db *gorm.DB, cfg *config.TemporalConfig) error {\n\tzm := models.NewZoneManager(db)\n\trm := models.NewRecordManager(db)\n\tqm.LogInfo(\"processing messages\")\n\t// process new messages\n\tfor d := range msgs {\n\t\t// message received\n\t\tqm.LogInfo(\"new message received\")\n\t\treq := RecordCreation{}\n\t\t// unmarshal message\n\t\tif err := json.Unmarshal(d.Body, &req); err != nil {\n\t\t\tqm.LogError(err, \"failed to unmarshal message\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// search for zone in db\n\t\tif _, err := zm.FindZoneByNameAndUser(req.ZoneName, req.UserName); err != nil {\n\t\t\tqm.LogError(err, \"failed to search for zone\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// connect to ipfs\n\t\tkeystore, err := rtfs.NewKeystoreManager()\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to initialize keystore manager\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\trtfsManager, err := rtfs.NewManager(cfg.IPFS.APIConnection.Host+\":\"+cfg.IPFS.APIConnection.Port, keystore, time.Minute*10)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to initialize connection to ipfs\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// get private key for record\n\t\trecordPK, err := keystore.GetPrivateKeyByName(req.RecordKeyName)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to get record private key\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// get id\n\t\trecordPKID, err := peer.IDFromPublicKey(recordPK.GetPublic())\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to get record id from public key\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// create record object\n\t\tr := tns.Record{\n\t\t\tPublicKey: recordPKID.Pretty(),\n\t\t\tName: req.RecordName,\n\t\t\tMetaData: req.MetaData,\n\t\t}\n\t\t// marshal it\n\t\tmarshaled, err := json.Marshal(&r)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to marshal tns record\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// put to ipfs\n\t\tresp, err := rtfsManager.DagPut(marshaled, \"json\", \"cbor\")\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to put record in ipfs\")\n\t\t\td.Ack(false)\n\t\t}\n\t\t// update the zone in database\n\t\tzone, err := zm.AddRecordForZone(\n\t\t\treq.ZoneName, req.RecordName, req.UserName,\n\t\t)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to add record to zone in database\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// update the database with a new record\n\t\tif _, err := rm.AddRecord(\n\t\t\treq.UserName, req.RecordName, req.RecordKeyName, req.ZoneName, req.MetaData,\n\t\t); err != nil {\n\t\t\tqm.LogError(err, \"unable to add record in database\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// update the latest ipfs hash for this record\n\t\tif _, err := rm.UpdateLatestIPFSHash(\n\t\t\treq.UserName, req.RecordName, resp,\n\t\t); err != nil {\n\t\t\tqm.LogError(err, \"unable to update ipfs hash for record in database\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\tzonePK, err := keystore.GetPrivateKeyByName(zone.ZonePublicKeyName)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to get zone private key\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// convert private key to id\n\t\tzonePKID, err := peer.IDFromPublicKey(zonePK.GetPublic())\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to get zone id from public key\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// get zone manager private key\n\t\tzoneManagerPK, err := keystore.GetPrivateKeyByName(zone.ManagerPublicKeyName)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to get zone manager private key\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\tzomeManagerPKID, err := peer.IDFromPublicKey(zoneManagerPK.GetPublic())\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to get zone manager id from private key\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\trecords, err := rm.FindRecordsByZone(zone.UserName, zone.Name)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to find records\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\tm := make(map[string]*tns.Record)\n\t\tmr := make(map[string]string)\n\t\tfor _, v := range *records {\n\t\t\ttnR := &tns.Record{\n\t\t\t\tPublicKey: v.RecordKeyName,\n\t\t\t\tName: v.Name,\n\t\t\t\tMetaData: nil,\n\t\t\t}\n\t\t\tm[v.Name] = tnR\n\t\t\tmr[v.Name] = v.RecordKeyName\n\t\t}\n\t\tz := tns.Zone{\n\t\t\tPublicKey: zonePKID.Pretty(),\n\t\t\tManager: &tns.ZoneManager{\n\t\t\t\tPublicKey: zomeManagerPKID.Pretty(),\n\t\t\t},\n\t\t\tName: zone.Name,\n\t\t\tRecords: m,\n\t\t\tRecordNamesToPublicKeys: mr,\n\t\t}\n\t\t// marshal to bytes\n\t\tmarshaled, err = json.Marshal(&z)\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to marshal tns zone\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// put to ipfs\n\t\tresp, err = rtfsManager.DagPut(marshaled, \"json\", \"cbor\")\n\t\tif err != nil {\n\t\t\tqm.LogError(err, \"failed to put zone file in ipfs\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\t// update database with has\n\t\tzone.LatestIPFSHash = resp\n\t\tif _, err = zm.UpdateLatestIPFSHashForZone(zone.Name, zone.UserName, resp); err != nil {\n\t\t\tqm.LogError(err, \"failed to update zone in database\")\n\t\t\td.Ack(false)\n\t\t\tcontinue\n\t\t}\n\t\tqm.LogInfo(\"record added to ipfs and database\")\n\t\td.Ack(false)\n\t}\n\treturn nil\n}",
"func (r *ArgonautReconciler) CreateDNSRecord(ctx context.Context, cfc *cloudflare.API, name string, zoneid string, tun *cloudflare.ArgoTunnel) error {\n\trecord := cloudflare.DNSRecord{\n\t\tType: \"CNAME\",\n\t\tName: name,\n\t\tContent: tun.ID + \".cfargotunnel.com\",\n\t\tProxiable: true,\n\t\tProxied: new(bool),\n\t\tTTL: 1,\n\t\tLocked: false,\n\t\tZoneID: zoneid,\n\t\tData: nil,\n\t\tMeta: nil,\n\t\tPriority: nil,\n\t}\n\tres, err := cfc.CreateDNSRecord(ctx, zoneid, record)\n\tif err != nil {\n\t\tfmt.Println(res)\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (_CreditScoreDB *CreditScoreDBTransactorSession) CreateRecord(_reason string, _score string, _nonce string, _scoreHash string) (*types.Transaction, error) {\n\treturn _CreditScoreDB.Contract.CreateRecord(&_CreditScoreDB.TransactOpts, _reason, _score, _nonce, _scoreHash)\n}",
"func (s *Server) CreateRecord(ctx context.Context, r *audit.AuditRecord) (*entity.Empty, error) {\n\tareq, err := authsvc.GRPCToAuthRequest(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tareq.Grpc = &auth.GRPCRequest{\n\t\tService: \"audit\",\n\t\tMethod: \"CreateRecord\",\n\t}\n\t_, err = s.Auth.AuthorizeLocal(ctx, areq)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb, err := json.Marshal(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok := s.Queue.PublishBytes(b)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"could not publish to queue\")\n\t}\n\treturn nil, nil\n}",
"func (s *UrlService) CreateRecord(ctx context.Context, rawUrl, customKey string) (*db.Record, error) {\n\tif rawUrl == \"\" {\n\t\treturn nil, errors.New(\"no URL provided\")\n\t}\n\turl, ok := validateUrl(rawUrl)\n\tif !ok {\n\t\tlog.Errorf(\"The provided string '%v' is not a url\", rawUrl)\n\t\treturn nil, ErrNotUrl\n\t}\n\tvar result *db.Record\n\tvar err error\n\tif customKey != \"\" {\n\t\tresult, err = s.createWithCustomKey(ctx, customKey, url)\n\t} else {\n\t\tresult, err = s.createWithRandKey(ctx, url)\n\t}\n\tif err != nil {\n\t\tlog.Errorf(\"Error saving the record (url = %v, key = %v): %v\", url, customKey, err.Error())\n\t\treturn nil, err\n\t}\n\tlog.Debugf(\"Record %v was created successfully\", result)\n\treturn result, nil\n}",
"func NewConnectionID(ip net.IP, now time.Time, key string) []byte {\n\treturn NewConnectionIDGenerator(key).Generate(ip, now)\n}",
"func (c *PhysicaltherapyrecordClient) Create() *PhysicaltherapyrecordCreate {\n\tmutation := newPhysicaltherapyrecordMutation(c.config, OpCreate)\n\treturn &PhysicaltherapyrecordCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}",
"func (h *VPCPeeringConnectionsHandler) Create(\n\tproject string,\n\tvpcID string,\n\treq CreateVPCPeeringConnectionRequest,\n) (*VPCPeeringConnection, error) {\n\tpath := buildPath(\"project\", project, \"vpcs\", vpcID, \"peering-connections\")\n\trsp, err := h.client.doPostRequest(path, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response *VPCPeeringConnection\n\tif err := json.Unmarshal(rsp, &response); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// if region was not set in the request omit it from the response\n\tif req.PeerRegion == nil {\n\t\tresponse.PeerRegion = nil\n\t}\n\n\treturn response, nil\n}",
"func MakeRecord(cert *ssh.Certificate) *CertRecord {\n\treturn &CertRecord{\n\t\tKeyID: cert.KeyId,\n\t\tPrincipals: StringSlice(cert.ValidPrincipals),\n\t\tCreatedAt: parseTime(cert.ValidAfter),\n\t\tExpires: parseTime(cert.ValidBefore),\n\t\tRaw: string(lib.GetPublicKey(cert)),\n\t}\n}",
"func (this *DomainRecord) CreateNSRecord(domainName, data string) (interface{}, error) {\n\tlog.Printf(\"Create Domain Record NS: %v for Domain: %v \", data, domainName)\n\t\n\tvar domainRecordResponse *DomainRecordResponse\n\tjsonBody, err := GetJsonResponse(\n\t\t\"POST\",\n\t\tfmt.Sprintf(\"%v/domains/%v/records\", DIGITALOCEAN_API_URL_PREFIX, domainName),\n\t\tfmt.Sprintf(`{\n\t\t \"data\": \"%v\",\n\t\t \"type\": \"%v\"\n\t\t}`, data, \"NS\"))\n\tif err != nil {\n\t\treturn nil, err\n\n\t}\n\tif err := json.Unmarshal(jsonBody, &domainRecordResponse); err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, err\n\t}\n\treturn domainRecordResponse, nil\n\n}",
"func (src *Chain) CreateConnectionStep(dst *Chain) (*RelayMsgs, error) {\n\tout := &RelayMsgs{Src: []sdk.Msg{}, Dst: []sdk.Msg{}, last: false}\n\n\tif err := src.PathEnd.Validate(); err != nil {\n\t\treturn nil, src.ErrCantSetPath(err)\n\t}\n\n\tif err := dst.PathEnd.Validate(); err != nil {\n\t\treturn nil, dst.ErrCantSetPath(err)\n\t}\n\n\ths, err := UpdatesWithHeaders(src, dst)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tscid, dcid := src.ChainID, dst.ChainID\n\n\t// Query Connection data from src and dst\n\t// NOTE: We query connection at height - 1 because of the way tendermint returns\n\t// proofs the commit for height n is contained in the header of height n + 1\n\tconn, err := QueryConnectionPair(src, dst, hs[scid].Height-1, hs[dcid].Height-1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// NOTE: We query connection at height - 1 because of the way tendermint returns\n\t// proofs the commit for height n is contained in the header of height n + 1\n\tcs, err := QueryClientStatePair(src, dst)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: log these heights or something about client state? debug?\n\n\t// Store the heights\n\tsrcConsH, dstConsH := int64(cs[scid].ClientState.GetLatestHeight()), int64(cs[dcid].ClientState.GetLatestHeight())\n\n\t// NOTE: We query connection at height - 1 because of the way tendermint returns\n\t// proofs the commit for height n is contained in the header of height n + 1\n\tcons, err := QueryClientConsensusStatePair(src, dst, hs[scid].Height-1, hs[dcid].Height-1, srcConsH, dstConsH)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch {\n\t// Handshake hasn't been started on src or dst, relay `connOpenInit` to src\n\tcase conn[scid].Connection.State == connState.UNINITIALIZED && conn[dcid].Connection.State == connState.UNINITIALIZED:\n\t\tif src.debug {\n\t\t\tlogConnectionStates(src, dst, conn)\n\t\t}\n\t\tout.Src = append(out.Src, src.PathEnd.ConnInit(dst.PathEnd, src.MustGetAddress()))\n\n\t// Handshake has started on dst (1 stepdone), relay `connOpenTry` and `updateClient` on src\n\tcase conn[scid].Connection.State == connState.UNINITIALIZED && conn[dcid].Connection.State == connState.INIT:\n\t\tif src.debug {\n\t\t\tlogConnectionStates(src, dst, conn)\n\t\t}\n\t\tout.Src = append(out.Src,\n\t\t\tsrc.PathEnd.UpdateClient(hs[dcid], src.MustGetAddress()),\n\t\t\tsrc.PathEnd.ConnTry(dst.PathEnd, conn[dcid], cons[dcid], dstConsH, src.MustGetAddress()),\n\t\t)\n\n\t// Handshake has started on src (1 step done), relay `connOpenTry` and `updateClient` on dst\n\tcase conn[scid].Connection.State == connState.INIT && conn[dcid].Connection.State == connState.UNINITIALIZED:\n\t\tif dst.debug {\n\t\t\tlogConnectionStates(dst, src, conn)\n\t\t}\n\t\tout.Dst = append(out.Dst,\n\t\t\tdst.PathEnd.UpdateClient(hs[scid], dst.MustGetAddress()),\n\t\t\tdst.PathEnd.ConnTry(src.PathEnd, conn[scid], cons[scid], srcConsH, dst.MustGetAddress()),\n\t\t)\n\n\t// Handshake has started on src end (2 steps done), relay `connOpenAck` and `updateClient` to dst end\n\tcase conn[scid].Connection.State == connState.TRYOPEN && conn[dcid].Connection.State == connState.INIT:\n\t\tif dst.debug {\n\t\t\tlogConnectionStates(dst, src, conn)\n\t\t}\n\t\tout.Dst = append(out.Dst,\n\t\t\tdst.PathEnd.UpdateClient(hs[scid], dst.MustGetAddress()),\n\t\t\tdst.PathEnd.ConnAck(conn[scid], cons[scid], srcConsH, dst.MustGetAddress()),\n\t\t)\n\n\t// Handshake has started on dst end (2 steps done), relay `connOpenAck` and `updateClient` to src end\n\tcase conn[scid].Connection.State == connState.INIT && conn[dcid].Connection.State == connState.TRYOPEN:\n\t\tif src.debug {\n\t\t\tlogConnectionStates(src, dst, conn)\n\t\t}\n\t\tout.Src = append(out.Src,\n\t\t\tsrc.PathEnd.UpdateClient(hs[dcid], src.MustGetAddress()),\n\t\t\tsrc.PathEnd.ConnAck(conn[dcid], cons[dcid], dstConsH, src.MustGetAddress()),\n\t\t)\n\n\t// Handshake has confirmed on dst (3 steps done), relay `connOpenConfirm` and `updateClient` to src end\n\tcase conn[scid].Connection.State == connState.TRYOPEN && conn[dcid].Connection.State == connState.OPEN:\n\t\tif src.debug {\n\t\t\tlogConnectionStates(src, dst, conn)\n\t\t}\n\t\tout.Src = append(out.Src,\n\t\t\tsrc.PathEnd.UpdateClient(hs[dcid], src.MustGetAddress()),\n\t\t\tsrc.PathEnd.ConnConfirm(conn[dcid], src.MustGetAddress()),\n\t\t)\n\t\tout.last = true\n\n\t// Handshake has confirmed on src (3 steps done), relay `connOpenConfirm` and `updateClient` to dst end\n\tcase conn[scid].Connection.State == connState.OPEN && conn[dcid].Connection.State == connState.TRYOPEN:\n\t\tif dst.debug {\n\t\t\tlogConnectionStates(dst, src, conn)\n\t\t}\n\t\tout.Dst = append(out.Dst,\n\t\t\tdst.PathEnd.UpdateClient(hs[scid], dst.MustGetAddress()),\n\t\t\tdst.PathEnd.ConnConfirm(conn[scid], dst.MustGetAddress()),\n\t\t)\n\t\tout.last = true\n\t}\n\n\treturn out, nil\n}",
"func RecordCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*ns1.Client)\n\tr := dns.NewRecord(d.Get(\"zone\").(string), d.Get(\"domain\").(string), d.Get(\"type\").(string))\n\tif err := resourceDataToRecord(r, d); err != nil {\n\t\treturn err\n\t}\n\tif _, err := client.Records.Create(r); err != nil {\n\t\treturn err\n\t}\n\treturn recordToResourceData(d, r)\n}",
"func (opts CreateOpts) ToConnectionCreateMap() (map[string]interface{}, error) {\n\treturn gophercloud.BuildRequestBody(opts, \"ipsec_site_connection\")\n}",
"func (s *SmartContract) CreateRecord(ctx contractapi.TransactionContextInterface, id string, previous string, future string, data string) error {\n\texists, err := s.RecordExists(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif exists {\n\t\treturn fmt.Errorf(\"the record %s already exists\", id)\n\t}\n\n\trecord := Record{\n\t\tID: id,\n\t\tPrevious: previous,\n\t\tFuture: future,\n\t\tData: data,\n\t}\n\trecordJSON, err := json.Marshal(record)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ctx.GetStub().PutState(id, recordJSON)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
canTriggerActionEvents true based on role and state. 1. Role is invitee and state is invited. 2. Role is inviter and state is requested.
|
func canTriggerActionEvents(stateID, ns string) bool {
return (stateID == StateIDInvited && ns == myNSPrefix) || (stateID == StateIDRequested && ns == theirNSPrefix)
}
|
[
"func canTriggerActionEvents(msg service.DIDCommMsg) bool {\n\tswitch msg.Type() {\n\tcase ProposalMsgType, RequestMsgType, ProblemReportMsgType:\n\t\treturn true\n\t}\n\n\treturn false\n}",
"func canTriggerActionEvents(msg *service.DIDCommMsg) bool {\n\t// TODO: need to check more msg.Header.Type\n\treturn msg.Header.Type == ProposalMsgType || msg.Header.Type == ResponseMsgType\n}",
"func (i *Invite) CanBeRedeemed() bool {\n\treturn !i.IsExpired() && !i.IsSoldOut() && !i.HasRestrictedUsage()\n}",
"func isAllowedEvent(events []string, incomingEvent string) bool {\n\tfor _, ev := range events {\n\t\tif ev == incomingEvent {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}",
"func authorisedUser(ctx context.Context, querier *Queryer, clientCaller *userapi.Device, roomID spec.RoomID, parentRoomID *spec.RoomID) (authed bool, isJoinedOrInvited bool) {\n\thisVisTuple := gomatrixserverlib.StateKeyTuple{\n\t\tEventType: spec.MRoomHistoryVisibility,\n\t\tStateKey: \"\",\n\t}\n\tjoinRuleTuple := gomatrixserverlib.StateKeyTuple{\n\t\tEventType: spec.MRoomJoinRules,\n\t\tStateKey: \"\",\n\t}\n\troomMemberTuple := gomatrixserverlib.StateKeyTuple{\n\t\tEventType: spec.MRoomMember,\n\t\tStateKey: clientCaller.UserID,\n\t}\n\tvar queryRes roomserver.QueryCurrentStateResponse\n\terr := querier.QueryCurrentState(ctx, &roomserver.QueryCurrentStateRequest{\n\t\tRoomID: roomID.String(),\n\t\tStateTuples: []gomatrixserverlib.StateKeyTuple{\n\t\t\thisVisTuple, joinRuleTuple, roomMemberTuple,\n\t\t},\n\t}, &queryRes)\n\tif err != nil {\n\t\tutil.GetLogger(ctx).WithError(err).Error(\"failed to QueryCurrentState\")\n\t\treturn false, false\n\t}\n\tmemberEv := queryRes.StateEvents[roomMemberTuple]\n\tif memberEv != nil {\n\t\tmembership, _ := memberEv.Membership()\n\t\tif membership == spec.Join || membership == spec.Invite {\n\t\t\treturn true, true\n\t\t}\n\t}\n\thisVisEv := queryRes.StateEvents[hisVisTuple]\n\tif hisVisEv != nil {\n\t\thisVis, _ := hisVisEv.HistoryVisibility()\n\t\tif hisVis == \"world_readable\" {\n\t\t\treturn true, false\n\t\t}\n\t}\n\tjoinRuleEv := queryRes.StateEvents[joinRuleTuple]\n\tif parentRoomID != nil && joinRuleEv != nil {\n\t\tvar allowed bool\n\t\trule, ruleErr := joinRuleEv.JoinRule()\n\t\tif ruleErr != nil {\n\t\t\tutil.GetLogger(ctx).WithError(ruleErr).WithField(\"parent_room_id\", parentRoomID).Warn(\"failed to get join rule\")\n\t\t} else if rule == spec.Public || rule == spec.Knock {\n\t\t\tallowed = true\n\t\t} else if rule == spec.Restricted {\n\t\t\tallowedRoomIDs := restrictedJoinRuleAllowedRooms(ctx, joinRuleEv)\n\t\t\t// check parent is in the allowed set\n\t\t\tfor _, a := range allowedRoomIDs {\n\t\t\t\tif *parentRoomID == a {\n\t\t\t\t\tallowed = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif allowed {\n\t\t\t// ensure caller is joined to the parent room\n\t\t\tvar queryRes2 roomserver.QueryCurrentStateResponse\n\t\t\terr = querier.QueryCurrentState(ctx, &roomserver.QueryCurrentStateRequest{\n\t\t\t\tRoomID: parentRoomID.String(),\n\t\t\t\tStateTuples: []gomatrixserverlib.StateKeyTuple{\n\t\t\t\t\troomMemberTuple,\n\t\t\t\t},\n\t\t\t}, &queryRes2)\n\t\t\tif err != nil {\n\t\t\t\tutil.GetLogger(ctx).WithError(err).WithField(\"parent_room_id\", parentRoomID).Warn(\"failed to check user is joined to parent room\")\n\t\t\t} else {\n\t\t\t\tmemberEv = queryRes2.StateEvents[roomMemberTuple]\n\t\t\t\tif memberEv != nil {\n\t\t\t\t\tmembership, _ := memberEv.Membership()\n\t\t\t\t\tif membership == spec.Join {\n\t\t\t\t\t\treturn true, false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false, false\n}",
"func (m *Machine) Can(o Object, e Event) bool {\n\ttrs, err := m.AvailableTransitions(o, e)\n\treturn err == nil && len(trs) > 0\n}",
"func (m *ParcelMock) MinimockAllowedSenderObjectAndRoleInspect() {\n\tfor _, e := range m.AllowedSenderObjectAndRoleMock.expectations {\n\t\tif mm_atomic.LoadUint64(&e.Counter) < 1 {\n\t\t\tm.t.Error(\"Expected call to ParcelMock.AllowedSenderObjectAndRole\")\n\t\t}\n\t}\n\n\t// if default expectation was set then invocations count should be greater than zero\n\tif m.AllowedSenderObjectAndRoleMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAllowedSenderObjectAndRoleCounter) < 1 {\n\t\tm.t.Error(\"Expected call to ParcelMock.AllowedSenderObjectAndRole\")\n\t}\n\t// if func was set then invocations count should be greater than zero\n\tif m.funcAllowedSenderObjectAndRole != nil && mm_atomic.LoadUint64(&m.afterAllowedSenderObjectAndRoleCounter) < 1 {\n\t\tm.t.Error(\"Expected call to ParcelMock.AllowedSenderObjectAndRole\")\n\t}\n}",
"func shouldPreview(s *discordgo.Session, destChannelID, srcChannelID string) (bool, error) {\n\n\tif destChannelID == \"\" || srcChannelID == \"\" {\n\t\treturn false, errors.New(\"empty channel ID provided\")\n\t}\n\n\tif destChannelID == srcChannelID {\n\t\treturn true, nil\n\t}\n\n\tsrcCh, err := s.State.Channel(srcChannelID)\n\tif err != nil {\n\t\tsrcCh, err = s.Channel(srcChannelID)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t_ = s.State.ChannelAdd(srcCh)\n\t}\n\n\tdestCh, err := s.State.Channel(destChannelID)\n\tif err != nil {\n\t\tdestCh, err = s.Channel(destChannelID)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t_ = s.State.ChannelAdd(destCh)\n\t}\n\n\tif srcCh.NSFW && !destCh.NSFW {\n\t\treturn false, nil\n\t}\n\n\tvar (\n\t\tdeniedSrcRoles = mapset.NewThreadUnsafeSet()\n\t\tdeniedDestRoles = mapset.NewThreadUnsafeSet()\n\t)\n\n\tfor _, perm := range srcCh.PermissionOverwrites {\n\t\tshouldDeny := (perm.Deny|discordgo.PermissionReadMessageHistory == perm.Deny) || (perm.Deny|discordgo.PermissionReadMessages == perm.Deny)\n\t\tif shouldDeny && perm.Type == \"role\" { // ignore \"member\" type\n\t\t\tdeniedSrcRoles.Add(perm.ID)\n\t\t}\n\t}\n\n\tfor _, perm := range destCh.PermissionOverwrites {\n\t\tshouldDeny := (perm.Deny|discordgo.PermissionReadMessageHistory == perm.Deny) || (perm.Deny|discordgo.PermissionReadMessages == perm.Deny)\n\t\tif shouldDeny && perm.Type == \"role\" { // ignore \"member\" type\n\t\t\tdeniedDestRoles.Add(perm.ID)\n\t\t}\n\t}\n\n\treturn deniedSrcRoles.Equal(deniedDestRoles) || deniedSrcRoles.IsProperSubset(deniedDestRoles), nil\n}",
"func (s *MemberlistTestSuite) TestMembershipEventsRemoteState() {\n\tvar initialChanges []Change\n\tvar updateChanges []Change\n\n\tfor address, test := range MembershipVisibleTransitions {\n\t\tinitialChanges = append(initialChanges, Change{\n\t\t\tAddress: address,\n\t\t\tIncarnation: s.incarnation,\n\t\t\tStatus: test.From,\n\t\t})\n\n\t\tupdateChanges = append(updateChanges, Change{\n\t\t\tAddress: address,\n\t\t\tIncarnation: s.incarnation + 1,\n\t\t\tStatus: test.To,\n\t\t})\n\t}\n\n\t// seed the memberlist with intial states\n\ts.m.Update(initialChanges)\n\n\teventFired := false\n\ts.node.AddListener(on(membership.ChangeEvent{}, func(e events.Event) {\n\t\tchangeEvent := e.(membership.ChangeEvent)\n\n\t\tseenMembers := make(map[string]struct{})\n\n\t\tfor _, change := range changeEvent.Changes {\n\t\t\tvar address string\n\n\t\t\tif change.Before != nil {\n\t\t\t\taddress = change.Before.GetAddress()\n\t\t\t} else {\n\t\t\t\taddress = change.After.GetAddress()\n\t\t\t}\n\n\t\t\tseenMembers[address] = struct{}{}\n\n\t\t\ttest, has := MembershipVisibleTransitions[address]\n\t\t\tif !has {\n\t\t\t\t// change is not specified and therefore allowed\n\t\t\t\ts.Assert().Fail(\"allowed but not expected, logging during development\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif test.notAllowed {\n\t\t\t\ts.Assert().Fail(\"member %q is not allowed to show up in membership.ChangeEvent.Changes\", address)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif test.Before {\n\t\t\t\ts.Assert().NotNil(change.Before, \"Expected before to be set for member %q\", address)\n\t\t\t} else {\n\t\t\t\ts.Assert().Nil(change.Before, \"Expected before not to be set for member %q\", address)\n\t\t\t}\n\n\t\t\tif test.After {\n\t\t\t\ts.Assert().NotNil(change.After, \"Expected after to be set for member %q\", address)\n\t\t\t} else {\n\t\t\t\ts.Assert().Nil(change.After, \"Expected after not to be set for member %q\", address)\n\t\t\t}\n\t\t}\n\n\t\tfor address, test := range MembershipVisibleTransitions {\n\t\t\t_, seen := seenMembers[address]\n\t\t\ts.Assert().Equal(!test.notAllowed, seen, \"membership update for member %q inconsistency\", address)\n\t\t}\n\n\t\teventFired = true\n\t}))\n\n\t// now send the updates that should trigger the Membership event\n\ts.m.Update(updateChanges)\n\ts.Assert().True(eventFired, \"expected membership.ChangeEvent to fire during update\")\n}",
"func (s *MemberlistTestSuite) TestMembershipEventsLocalState() {\n\tfor _, test := range MembershipVisibleTransitions {\n\n\t\t// listen for expected event\n\t\tfired := false\n\t\tl := on(membership.ChangeEvent{}, func(e events.Event) {\n\t\t\tfired = true\n\n\t\t\tchangeEvent := e.(membership.ChangeEvent)\n\t\t\tchange := changeEvent.Changes[0]\n\n\t\t\tif test.notAllowed {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif test.Before {\n\t\t\t\ts.Assert().NotNil(change.Before, \"Expected before to be set for change %s->%s\", test.From, test.To)\n\t\t\t} else {\n\t\t\t\ts.Assert().Nil(change.Before, \"Expected before not to be set for change %s->%s\", test.From, test.To)\n\t\t\t}\n\n\t\t\tif test.After {\n\t\t\t\ts.Assert().NotNil(change.After, \"Expected after to be set for change %s->%s\", test.From, test.To)\n\t\t\t} else {\n\t\t\t\ts.Assert().Nil(change.After, \"Expected after not to be set for member change %s->%s\", test.From, test.To)\n\t\t\t}\n\t\t})\n\n\t\ts.m.SetLocalStatus(test.From)\n\t\ts.node.AddListener(l)\n\t\ts.m.SetLocalStatus(test.To)\n\t\ts.node.RemoveListener(l)\n\n\t\ts.Assert().Equal(!test.notAllowed, fired, \"unexpected result for event that fired for change %s->%s\", test.From, test.To)\n\t}\n}",
"func (m *ParcelMock) MinimockAllowedSenderObjectAndRoleDone() bool {\n\tfor _, e := range m.AllowedSenderObjectAndRoleMock.expectations {\n\t\tif mm_atomic.LoadUint64(&e.Counter) < 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// if default expectation was set then invocations count should be greater than zero\n\tif m.AllowedSenderObjectAndRoleMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterAllowedSenderObjectAndRoleCounter) < 1 {\n\t\treturn false\n\t}\n\t// if func was set then invocations count should be greater than zero\n\tif m.funcAllowedSenderObjectAndRole != nil && mm_atomic.LoadUint64(&m.afterAllowedSenderObjectAndRoleCounter) < 1 {\n\t\treturn false\n\t}\n\treturn true\n}",
"func (_RoleManager *RoleManagerCaller) IsAdminRole(opts *bind.CallOpts, _roleId string, _orgId string, _ultParent string) (bool, error) {\n\tvar out []interface{}\n\terr := _RoleManager.contract.Call(opts, &out, \"isAdminRole\", _roleId, _orgId, _ultParent)\n\n\tif err != nil {\n\t\treturn *new(bool), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(bool)).(*bool)\n\n\treturn out0, err\n\n}",
"func (f WebhookForm) ChooseEvents() bool {\n\treturn f.Events == \"choose_events\"\n}",
"func CanModifyRep(conf *models.ReputationConfig, sender, receiver *dstate.MemberState) error {\n\tif common.ContainsInt64SliceOneOf(sender.Member.Roles, conf.AdminRoles) {\n\t\treturn nil\n\t}\n\n\tif len(conf.RequiredGiveRoles) > 0 && !common.ContainsInt64SliceOneOf(sender.Member.Roles, conf.RequiredGiveRoles) {\n\t\treturn ErrMissingRequiredGiveRole\n\t}\n\n\tif len(conf.RequiredReceiveRoles) > 0 && !common.ContainsInt64SliceOneOf(receiver.Member.Roles, conf.RequiredReceiveRoles) {\n\t\treturn ErrMissingRequiredReceiveRole\n\t}\n\n\tif common.ContainsInt64SliceOneOf(sender.Member.Roles, conf.BlacklistedGiveRoles) {\n\t\treturn ErrBlacklistedGive\n\t}\n\n\tif common.ContainsInt64SliceOneOf(receiver.Member.Roles, conf.BlacklistedReceiveRoles) {\n\t\treturn ErrBlacklistedReceive\n\t}\n\n\treturn nil\n}",
"func (o *ProjectCapability) IsEvented() bool {\n\treturn true\n}",
"func (s *ShellModule) IsTriggered(test string) bool {\n\treturn test == s.Trigger\n}",
"func invited(c *cli.Context) error {\n\tcfg, err := parseConfig(c.String(ConfigFlag.Name))\n\tif err != nil {\n\t\treturn err\n\t}\n\tserver := c.String(ServerFlag.Name)\n\tlog.Printf(\"Server is %s\", server)\n\tendpoint := client.New(cfg, server)\n\n\tstart := c.Int64(StartFlag.Name)\n\tend := c.Int64(EndFlag.Name)\n\tpage := c.Int(PageFlag.Name)\n\tpageSize := c.Int(PageSizeFlag.Name)\n\trecords, err := endpoint.InvitationRecords(c.Context, start, end, page, pageSize)\n\tif err != nil {\n\t\tlog.Printf(\"Get invitation records error: %s\", err)\n\t\treturn err\n\t}\n\tlog.Printf(\"id\tnickName\trewardType\trewardNumber\trewardUnit\trewardTime\")\n\tfor i, r := range records {\n\t\trewardAt := time.Unix(r.RewardTime/1000, 0)\n\t\tlog.Printf(\"%d\t%s\t%d\t%d %d\t%s\", i+1, r.NickName, r.RewardType, r.RewardNumber, r.RewardUnit, rewardAt)\n\t}\n\treturn nil\n}",
"func isActionableUpgradePolicy(up *ocm.UpgradePolicy, state *ocm.UpgradePolicyState) bool {\n\n\t// Policies that aren't in a SCHEDULED state should be ignored\n\tif strings.ToLower(state.Value) != \"scheduled\" {\n\t\treturn false\n\t}\n\n\t// Automatic upgrade policies will have an empty version if the cluster is up to date\n\tif len(up.Version) == 0 {\n\t\tlog.Info(fmt.Sprintf(\"Upgrade policy %v has an empty version, will ignore.\", up.Id))\n\t\treturn false\n\t}\n\n\treturn true\n}",
"func (_RoleManager *RoleManagerCallerSession) TransactionAllowed(_roleId string, _orgId string, _ultParent string, _typeOfTxn *big.Int) (bool, error) {\n\treturn _RoleManager.Contract.TransactionAllowed(&_RoleManager.CallOpts, _roleId, _orgId, _ultParent, _typeOfTxn)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateImplicitInvitation creates implicit invitation. Inviter DID is required, invitee DID is optional. If invitee DID is not provided new peer DID will be created for implicit invitation exchange request.
|
func (s *Service) CreateImplicitInvitation(inviterLabel, inviterDID,
inviteeLabel, inviteeDID string, routerConnections []string) (string, error) {
logger.Debugf("implicit invitation requested inviterDID[%s] inviteeDID[%s]", inviterDID, inviteeDID)
docResolution, err := s.ctx.vdRegistry.Resolve(inviterDID)
if err != nil {
return "", fmt.Errorf("resolve public did[%s]: %w", inviterDID, err)
}
dest, err := service.CreateDestination(docResolution.DIDDocument)
if err != nil {
return "", err
}
thID := generateRandomID()
connRecord := &connection.Record{
ConnectionID: generateRandomID(),
ThreadID: thID,
State: stateNameNull,
InvitationDID: inviterDID,
Implicit: true,
ServiceEndPoint: dest.ServiceEndpoint,
RecipientKeys: dest.RecipientKeys,
TheirLabel: inviterLabel,
Namespace: findNamespace(InvitationMsgType),
}
if e := s.connectionRecorder.SaveConnectionRecordWithMappings(connRecord); e != nil {
return "", fmt.Errorf("failed to save new connection record for implicit invitation: %w", e)
}
invitation := &Invitation{
ID: uuid.New().String(),
Label: inviterLabel,
DID: inviterDID,
Type: InvitationMsgType,
}
msg, err := createDIDCommMsg(invitation)
if err != nil {
return "", fmt.Errorf("failed to create DIDCommMsg for implicit invitation: %w", err)
}
next := &requested{}
internalMsg := &message{
Msg: msg.Clone(),
ThreadID: thID,
NextStateName: next.Name(),
ConnRecord: connRecord,
}
internalMsg.Options = &options{publicDID: inviteeDID, label: inviteeLabel, routerConnections: routerConnections}
go func(msg *message, aEvent chan<- service.DIDCommAction) {
if err = s.handle(msg, aEvent); err != nil {
logger.Errorf("error from handle for implicit invitation: %s", err)
}
}(internalMsg, s.ActionEvent())
return connRecord.ConnectionID, nil
}
|
[
"func (c *Client) CreateInvitation(protocols []string, opts ...MessageOption) (*Invitation, error) {\n\tmsg := &message{}\n\n\tfor _, opt := range opts {\n\t\tif err := opt(msg); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create invitation: %w\", err)\n\t\t}\n\t}\n\n\tinv := &Invitation{\n\t\tID: uuid.New().String(),\n\t\tType: InvitationMsgType,\n\t\tLabel: msg.Label,\n\t\tGoal: msg.Goal,\n\t\tGoalCode: msg.GoalCode,\n\t\tService: msg.Service,\n\t\tProtocols: protocols,\n\t}\n\n\tif len(inv.Service) == 0 {\n\t\tsvc, err := c.didDocSvcFunc()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create a new inlined did doc service block : %w\", err)\n\t\t}\n\n\t\tinv.Service = []interface{}{svc}\n\t}\n\n\tif len(inv.Protocols) == 0 {\n\t\t// TODO should be injected into client\n\t\t// https://github.com/hyperledger/aries-framework-go/issues/1691\n\t\tinv.Protocols = []string{didexchange.PIURI}\n\t}\n\n\tcast := outofband.Invitation(*inv)\n\n\terr := c.oobService.SaveInvitation(&cast)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to save outofband invitation : %w\", err)\n\t}\n\n\treturn inv, nil\n}",
"func (a *InvitationsApiService) CreateInvitation(ctx _context.Context, space string) ApiCreateInvitationRequest {\n\treturn ApiCreateInvitationRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tspace: space,\n\t}\n}",
"func NewInvitation(ctx *pulumi.Context,\n\tname string, args *InvitationArgs, opts ...pulumi.ResourceOption) (*Invitation, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.AccountName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'AccountName'\")\n\t}\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\tif args.ShareName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ShareName'\")\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:datashare/v20201001preview:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:datashare:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:datashare:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:datashare/v20181101preview:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:datashare/v20181101preview:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:datashare/v20191101:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:datashare/v20191101:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:datashare/v20200901:Invitation\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:datashare/v20200901:Invitation\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource Invitation\n\terr := ctx.RegisterResource(\"azure-native:datashare/v20201001preview:Invitation\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func NewInvitation(ctx *pulumi.Context,\n\tname string, args *InvitationArgs, opts ...pulumi.ResourceOption) (*Invitation, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.RedirectUrl == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'RedirectUrl'\")\n\t}\n\tif args.UserEmailAddress == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'UserEmailAddress'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Invitation\n\terr := ctx.RegisterResource(\"azuread:index/invitation:Invitation\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func (tx TxRepo) CreateInvitation(inv licence.Invitation) error {\n\t_, err := tx.NamedExec(licence.StmtCreateInvitation, inv)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func CreateAcceptFabricInvitationRequest() (request *AcceptFabricInvitationRequest) {\n\trequest = &AcceptFabricInvitationRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Baas\", \"2018-12-21\", \"AcceptFabricInvitation\", \"baas\", \"openAPI\")\n\treturn\n}",
"func NewEntitlement(ctx *pulumi.Context,\n\tname string, args *EntitlementArgs, opts ...pulumi.ResourceOption) (*Entitlement, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.AccountId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'AccountId'\")\n\t}\n\tif args.CustomerId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'CustomerId'\")\n\t}\n\tif args.Offer == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Offer'\")\n\t}\n\tvar resource Entitlement\n\terr := ctx.RegisterResource(\"google-native:cloudchannel/v1:Entitlement\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func CreateInvite(channelID, requesterIPaddr, utmSource string) (*discordgo.Invite, error) {\n\tif !started || session == nil {\n\t\treturn nil, fmt.Errorf(\"bot not ready\")\n\t}\n\tinvite := discordgo.Invite{\n\t\tMaxAge: 600,\n\t\tMaxUses: 1,\n\t\tTemporary: false,\n\t}\n\ti, err := session.ChannelInviteCreate(channelID, invite)\n\tif err == nil {\n\t\tuuid, err := uuid.NewV4()\n\t\tif err != nil {\n\t\t\treturn i, err\n\t\t}\n\t\trecentInvites.SetDefault(uuid.String(), inviteInfo{\n\t\t\tCode: i.Code,\n\t\t\tRequesterIPAddr: requesterIPaddr,\n\t\t\tRequestTime: time.Now(),\n\t\t\tInviteTime: i.CreatedAt,\n\t\t\tUTMsource: utmSource,\n\t\t})\n\t}\n\treturn i, err\n}",
"func CreateDescribeInvitationCodeRequest() (request *DescribeInvitationCodeRequest) {\n\trequest = &DescribeInvitationCodeRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Baas\", \"2018-07-31\", \"DescribeInvitationCode\", \"\", \"\")\n\treturn\n}",
"func (client *EnvironmentsClient) approveOrRejectPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *EnvironmentsClientBeginApproveOrRejectPrivateEndpointConnectionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif name == \"\" {\n\t\treturn nil, errors.New(\"parameter name cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{name}\", url.PathEscape(name))\n\tif privateEndpointConnectionName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateEndpointConnectionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateEndpointConnectionName}\", url.PathEscape(privateEndpointConnectionName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, privateEndpointWrapper)\n}",
"func (s *Service) SaveInvitation(i *Invitation) error {\n\ttarget, err := chooseTarget(i.Service)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to choose a target to connect against : %w\", err)\n\t}\n\n\t// TODO where should we save this invitation? - https://github.com/hyperledger/aries-framework-go/issues/1547\n\terr = s.connections.SaveInvitation(i.ID+\"-TODO\", i)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to save oob invitation : %w\", err)\n\t}\n\n\terr = s.didSvc.SaveInvitation(&didexchange.OOBInvitation{\n\t\tID: uuid.New().String(),\n\t\tThreadID: i.ID,\n\t\tTheirLabel: i.Label,\n\t\tTarget: target,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"the didexchange service failed to save the oob invitation : %w\", err)\n\t}\n\n\treturn nil\n}",
"func TestUserEntitlement_CreateUserEntitlement_Need_OriginID_Or_PrincipalName(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tclients := &client.AggregatedClient{\n\t\tMemberEntitleManagementClient: nil,\n\t\tCtx: context.Background(),\n\t}\n\n\tresourceData := schema.TestResourceDataRaw(t, ResourceUserEntitlement().Schema, nil)\n\t// originID and principalName is not set.\n\n\terr := resourceUserEntitlementCreate(resourceData, clients)\n\tassert.NotNil(t, err, \"err should not be nil\")\n\trequire.Regexp(t, \"Use origin_id or principal_name\", err.Error())\n}",
"func NewInterconnectAttachment(ctx *pulumi.Context,\n\tname string, args *InterconnectAttachmentArgs, opts ...pulumi.ResourceOption) (*InterconnectAttachment, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Router == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Router'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource InterconnectAttachment\n\terr := ctx.RegisterResource(\"gcp:compute/interconnectAttachment:InterconnectAttachment\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func (c *Client) CreateInvite(\n\tchannelID discord.Snowflake, maxAge discord.Seconds,\n\tmaxUses uint, temp, unique bool) (*discord.Invite, error) {\n\n\tvar param struct {\n\t\tMaxAge int `json:\"max_age\"`\n\t\tMaxUses uint `json:\"max_uses\"`\n\t\tTemporary bool `json:\"temporary\"`\n\t\tUnique bool `json:\"unique\"`\n\t}\n\n\tparam.MaxAge = int(maxAge)\n\tparam.MaxUses = maxUses\n\tparam.Temporary = temp\n\tparam.Unique = unique\n\n\tvar inv *discord.Invite\n\treturn inv, c.RequestJSON(\n\t\t&inv, \"POST\",\n\t\tEndpointChannels+channelID.String()+\"/invites\",\n\t\thttputil.WithSchema(c, param),\n\t)\n}",
"func New(ctx Provider, inv *didexchange.Invitation) (*Client, error) {\n\tsvc, err := ctx.Service(introduce.Introduce)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tintroduceSvc, ok := svc.(service.DIDComm)\n\tif !ok {\n\t\treturn nil, errors.New(\"cast service to Introduce Service failed\")\n\t}\n\n\tstore, err := ctx.StorageProvider().OpenStore(introduce.Introduce)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Client{\n\t\tEvent: introduceSvc,\n\t\tservice: introduceSvc,\n\t\tstore: store,\n\t\tdefaultInv: inv,\n\t\tnewUUID: func() string { return uuid.New().String() },\n\t}, nil\n}",
"func (m *MeetingParticipant) FindOrCreate(tx *pop.Connection, meeting Meeting, user User, code *string) *api.AppError {\n\tif err := m.FindByMeetingIDAndUserID(tx, meeting.ID, user.ID); domain.IsOtherThanNoRows(err) {\n\t\treturn &api.AppError{\n\t\t\tKey: \"CreateMeetingParticipant.FindExisting\",\n\t\t\tErr: err,\n\t\t}\n\t}\n\tif m.ID > 0 {\n\t\treturn nil\n\t}\n\n\tif code == nil {\n\t\tif user.CanCreateMeetingParticipant(tx, meeting) {\n\t\t\treturn m.createWithoutInvite(tx, user, meeting)\n\t\t}\n\t\treturn &api.AppError{\n\t\t\tErr: errors.New(\"user is not allowed to self-join meeting without a code\"),\n\t\t\tKey: \"CreateMeetingParticipant.Unauthorized\",\n\t\t}\n\t}\n\n\tif meeting.IsCodeValid(tx, *code) {\n\t\treturn m.createWithoutInvite(tx, user, meeting)\n\t}\n\n\tvar invite MeetingInvite\n\tif err := invite.FindBySecret(tx, meeting.ID, user.Email, *code); domain.IsOtherThanNoRows(err) {\n\t\treturn &api.AppError{\n\t\t\tErr: err,\n\t\t\tKey: \"CreateMeetingParticipant.FindBySecret\",\n\t\t}\n\t}\n\tif invite.ID == 0 {\n\t\treturn &api.AppError{\n\t\t\tErr: errors.New(\"invalid invite secret\"),\n\t\t\tKey: \"CreateMeetingParticipant.InvalidSecret\",\n\t\t}\n\t}\n\n\tm.InviteID = nulls.NewInt(invite.ID)\n\tm.UserID = user.ID\n\tm.MeetingID = meeting.ID\n\tif err := tx.Create(m); err != nil {\n\t\treturn &api.AppError{\n\t\t\tErr: err,\n\t\t\tKey: \"CreateMeetingParticipant\",\n\t\t}\n\t}\n\n\tif err := invite.SetUserID(tx, user.UUID); err != nil {\n\t\treturn &api.AppError{\n\t\t\tErr: err,\n\t\t\tKey: \"CreateMeetingParticipant\",\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (a *IamUserApiService) IamUserCredentialCreate(ctx context.Context, userId string) ApiIamUserCredentialCreateRequest {\n\treturn ApiIamUserCredentialCreateRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tuserId: userId,\n\t}\n}",
"func (s *Service) AcceptInvitation(i *Invitation, myLabel string) (string, error) {\n\tconnID, err := s.handleCallback(&callback{\n\t\tmsg: service.NewDIDCommMsgMap(i),\n\t\toptions: &userOptions{myLabel: myLabel},\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to accept invitation : %w\", err)\n\t}\n\n\treturn connID, nil\n}",
"func (a *VnicApiService) CreateVnicEthAdapterPolicy(ctx context.Context) ApiCreateVnicEthAdapterPolicyRequest {\n\treturn ApiCreateVnicEthAdapterPolicyRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetAltDescription sets the alt description.
|
func (field *Field) SetAltDescription(altDescription string) *Field {
field.altDescription[0] = altDescription
return field
}
|
[
"func (s *StaticImg) SetAlt(t sprite.SubTex) {\n\ts.alt = t\n}",
"func (ent *Entry) SetAlt(val string, from string) {\n\tif val == \"\" {\n\t\treturn\n\t}\n\tent.altvalue = []string{val}\n\tent.from = from\n}",
"func (h *ImageHandle) SetDescription(ctx context.Context, description string) error {\n\tpath := path.Join(\"/api/v3/images\", h.id)\n\tbody := api.ImagePatchSpec{Description: &description}\n\tresp, err := h.client.sendRequest(ctx, http.MethodPatch, path, nil, body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer safeClose(resp.Body)\n\treturn errorFromResponse(resp)\n}",
"func (recv *Object) SetDescription(description string) {\n\tc_description := C.CString(description)\n\tdefer C.free(unsafe.Pointer(c_description))\n\n\tC.atk_object_set_description((*C.AtkObject)(recv.native), c_description)\n\n\treturn\n}",
"func (h *ExperimentHandle) SetDescription(ctx context.Context, description string) error {\n\tpath := path.Join(\"/api/v3/experiments\", h.id)\n\tbody := api.ExperimentPatchSpec{Description: &description}\n\tresp, err := h.client.sendRequest(ctx, http.MethodPatch, path, nil, body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer safeClose(resp.Body)\n\treturn errorFromResponse(resp)\n}",
"func (m *EducationRubric) SetDescription(value EducationItemBodyable)() {\n m.description = value\n}",
"func (recv *Action) SetDescription(i int32, desc string) bool {\n\tc_i := (C.gint)(i)\n\n\tc_desc := C.CString(desc)\n\tdefer C.free(unsafe.Pointer(c_desc))\n\n\tretC := C.atk_action_set_description((*C.AtkAction)(recv.native), c_i, c_desc)\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}",
"func (m *AppRole) SetDescription(value *string)() {\n m.description = value\n}",
"func (m *WindowsDefenderApplicationControlSupplementalPolicy) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}",
"func (m *Alert) SetDescription(value *string)() {\n m.description = value\n}",
"func (m *DirectoryObjectPartnerReference) SetDescription(value *string)() {\n m.description = value\n}",
"func (m *TeamsAppDefinition) SetDescription(value *string)() {\n m.description = value\n}",
"func (km *KeyModifiers) ToggleAlt() {\n\tkm.Alt = !km.Alt\n}",
"func (m *Middleware) SetDescription(desc string) {\n\tm.description = desc\n}",
"func (o *OperationManager) SetDescription(description string) error {\n\treturn o.redisClient.HMSet(o.operationKey, map[string]interface{}{\n\t\t\"description\": description,\n\t}).Err()\n}",
"func (recv *Image) SetImageDescription(description string) bool {\n\tc_description := C.CString(description)\n\tdefer C.free(unsafe.Pointer(c_description))\n\n\tretC := C.atk_image_set_image_description((*C.AtkImage)(recv.native), c_description)\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}",
"func (m *TeamTemplateDefinition) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}",
"func (m *TiIndicator) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}",
"func (m *ServiceHealthIssuePost) SetDescription(value ItemBodyable)() {\n m.description = value\n}",
"func (m *RoleScopeTag) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetActualText sets the alt description.
|
func (field *Field) SetActualText(actualText string) *Field {
field.actualText[0] = actualText
return field
}
|
[
"func (s *StaticImg) SetAlt(t sprite.SubTex) {\n\ts.alt = t\n}",
"func (il *ImageLabel) SetText(text string) {\n\n\til.label.SetText(text)\n}",
"func (self *BitmapText) SetText(text string) {\n self.Object.Call(\"setText\", text)\n}",
"func (self *BitmapText) SetTextI(args ...interface{}) {\n self.Object.Call(\"setText\", args)\n}",
"func (ent *Entry) SetAlt(val string, from string) {\n\tif val == \"\" {\n\t\treturn\n\t}\n\tent.altvalue = []string{val}\n\tent.from = from\n}",
"func (o *GetLnpNumberitemsParams) SetActual(actual string) {\n\to.Actual = actual\n}",
"func (self *BitmapText) SetTextA(member string) {\n self.Object.Set(\"text\", member)\n}",
"func (editor *Editor) SetText(text string) {\n\tif text == \"\" {\n\t\teditor.internalTextView.SetText(emptyText)\n\t} else {\n\t\teditor.internalTextView.SetText(fmt.Sprintf(\"[\\\"left\\\"]%s[\\\"\\\"][\\\"selection\\\"]%s[\\\"\\\"]\", text, string(selectionChar)))\n\t}\n\n\teditor.triggerHeightRequestIfNeccessary()\n}",
"func (e *MultilineEntry) SetText(text string) {\n\tctext := C.CString(text)\n\tC.uiMultilineEntrySetText(e.e, ctext)\n\tfreestr(ctext)\n}",
"func (p *PhidgetLCD) SetText(text string) {\n\tC.PhidgetLCD_writeText(p.handle, C.FONT_6x12, 40, 25, stringToCCharArray(text))\n\tC.PhidgetLCD_flush(p.handle)\n}",
"func (artifact *Artifact) WithDescriptionText(text string) *Artifact {\n\tif artifact.Description == nil {\n\t\tartifact.Description = &Message{}\n\t}\n\tartifact.Description.Text = &text\n\treturn artifact\n}",
"func (m *EducationRubric) SetDescription(value EducationItemBodyable)() {\n m.description = value\n}",
"func (s *Section) SetText(row int, alignment Alignment, text string) {\r\n\ts.text[row][alignment] = text\r\n\ts.dispatch()\r\n}",
"func (b *BrowserAction) SetBadgeText(details Object) {\n\tb.o.Call(\"setBadgeText\", details)\n}",
"func (m *TiIndicator) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}",
"func (t *TextView) SetText(text string) *TextView {\n\tt.Clear()\n\tfmt.Fprint(t, text)\n\treturn t\n}",
"func (m *DomainDnsTxtRecord) SetText(value *string)() {\n m.text = value\n}",
"func (m *TeamTemplateDefinition) SetDescription(value *string)() {\n err := m.GetBackingStore().Set(\"description\", value)\n if err != nil {\n panic(err)\n }\n}",
"func (h *ImageHandle) SetDescription(ctx context.Context, description string) error {\n\tpath := path.Join(\"/api/v3/images\", h.id)\n\tbody := api.ImagePatchSpec{Description: &description}\n\tresp, err := h.client.sendRequest(ctx, http.MethodPatch, path, nil, body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer safeClose(resp.Body)\n\treturn errorFromResponse(resp)\n}",
"func (m *Alert) SetDescription(value *string)() {\n m.description = value\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewFollower creates a new follower.
|
func NewFollower(client store.Store, key string) *Follower {
return &Follower{
client: client,
key: key,
stopCh: make(chan struct{}),
}
}
|
[
"func NewFollower(leader Leader) *Follower {\n\treturn &Follower{\n\t\tleader: leader,\n\t\tjobChan: make(chan Job),\n\t\tquit: make(chan struct{}),\n\t}\n}",
"func (t *Twitter) Follow(followerId int, followeeId int) {\n\t// 若 follower 不存在则创建\n\tif _, ok := t.idToUser[followerId]; !ok {\n\t\tuser := NewUser(followerId)\n\t\tt.idToUser[followerId] = &user\n\t}\n\t// 若 followee 不存在则创建\n\tif _, ok := t.idToUser[followeeId]; !ok {\n\t\tuser := NewUser(followeeId)\n\t\tt.idToUser[followeeId] = &user\n\t}\n\tt.idToUser[followerId].follow(followeeId)\n}",
"func NewFollowers(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Reference {\n\treturn NewReference(FollowersPath, spi.Follower, spi.SortAscending, false, cfg, activityStore,\n\t\tgetObjectIRI(cfg.ObjectIRI), getID(\"followers\"), verifier)\n}",
"func (client *Twitter) FollowNewPerson() error {\n\t// Get own followers\n\tc, err := client.API.GetFollowersIds(nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// We loop here, because we want to follow one person.\n\t// If we choose a random person it can be that we choose a person\n\t// that follows @TrendingGitlab already.\n\t// We want to attract new persons ;)\n\tfor {\n\t\t// Choose a random follower\n\t\trandomNumber := rand.Intn(len(c.Ids))\n\n\t\t// Request the follower from the random follower\n\t\tv := url.Values{}\n\t\tv.Add(\"user_id\", strconv.FormatInt(c.Ids[randomNumber], 10))\n\t\tc, err = client.API.GetFollowersIds(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Choose a random follower (again) from the random follower chosen before\n\t\trandomNumber = rand.Intn(len(c.Ids))\n\n\t\t// Get friendship details of @TrendingGitlab and the chosen person\n\t\tv = url.Values{}\n\t\tv.Add(\"user_id\", strconv.FormatInt(c.Ids[randomNumber], 10))\n\t\tfriendships, err := client.API.GetFriendshipsLookup(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Test if @TrendingGitlab has a relationship to the new user.\n\t\tshouldIFollow := client.isThereARelationship(friendships)\n\n\t\t// If we got a relationship, we will repeat the process ...\n\t\tif shouldIFollow == false {\n\t\t\tcontinue\n\t\t}\n\n\t\t// ... if not we will follow the new person\n\t\t// We drop the error and user here, because we got no logging yet ;)\n\t\tclient.API.FollowUserId(c.Ids[randomNumber], nil)\n\t\treturn nil\n\t}\n}",
"func (client *Client) FollowNewPerson() error {\n\t// Get all own followers\n\tc, err := client.API.GetFollowersIds(nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// We loop here, because we want to follow one person.\n\t// If we choose a random person it can be that we choose a person\n\t// that follows @TrendingGithub already.\n\t// We want to attract new persons ;)\n\tfor {\n\t\t// Choose a random follower\n\t\trandomNumber := rand.Intn(len(c.Ids))\n\n\t\t// Request the follower from the random follower\n\t\tv := url.Values{}\n\t\tv.Add(\"user_id\", strconv.FormatInt(c.Ids[randomNumber], 10))\n\t\tc, err = client.API.GetFollowersIds(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Choose a random follower (again) from the random follower chosen before\n\t\trandomNumber = rand.Intn(len(c.Ids))\n\n\t\t// Get friendship details of @TrendingGithub and the chosen person\n\t\tv = url.Values{}\n\t\tv.Add(\"user_id\", strconv.FormatInt(c.Ids[randomNumber], 10))\n\t\tfriendships, err := client.API.GetFriendshipsLookup(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Test if @TrendingGithub has a relationship to the new user.\n\t\tshouldIFollow := client.isThereARelationship(friendships)\n\n\t\t// If we got a relationship, we will repeat the process ...\n\t\tif !shouldIFollow {\n\t\t\tcontinue\n\t\t}\n\n\t\t// ... if not we will follow the new person\n\t\t// We drop the error and user here, because we got no logging yet ;)\n\t\tclient.API.FollowUserId(c.Ids[randomNumber], nil)\n\t\treturn nil\n\t}\n}",
"func NewFollowing(cfg *Config, activityStore spi.Store, verifier signatureVerifier) *Reference {\n\treturn NewReference(FollowingPath, spi.Following, spi.SortAscending, false, cfg, activityStore,\n\t\tgetObjectIRI(cfg.ObjectIRI), getID(\"following\"), verifier)\n}",
"func (u *User)Follow(p *User){\n\tConn.Do(\"ZADD\",\"followers:\"+p.Id,time.Now().Unix(),u.Id)\n\tConn.Do(\"ZADD\",\"following:\"+u.Id,time.Now().Unix(),p.Id)\n}",
"func (uc AccountsController) createFollows(request *restful.Request, response *restful.Response) {\n\tuserID := request.PathParameter(\"user-id\")\n\tfollowID := request.QueryParameter(\"followId\")\n\t_, err := clients.GetAccountClient().FollowUser(context.Background(), &pb.FollowUserRequest{Accountid: userID, Followid: followID})\n\tif err != nil {\n\t\tWriteError(err, response)\n\t\treturn\n\t}\n\tresponse.WriteHeader(http.StatusCreated)\n}",
"func (uc *UserController) Follow(w http.ResponseWriter, r *http.Request) {\n\tfollowRequest := DecodeFollowRequest(r.Body)\n\tvar user *models.User\n\tif err := uc.users.FindId(followRequest.User1).One(&user); err != nil {\n\t\tlog.Fatal(\"Fatal Error finding user in Follow method\", err.Error())\n\t}\n\tif errors := user.Follow(followRequest.User2, uc.users); errors != nil {\n\t\tSendAsJSON(w, false, errors)\n\t\treturn\n\t}\n\tuser.Populate(uc.users)\n\tSendAsJSON(w, true, user)\n\n}",
"func (g *Guru) Add(follower string) {\n\tg.Lock()\n\tdefer g.Unlock()\n\tg.followers[follower] = struct{}{}\n}",
"func (r *Raft) becomeFollower(term uint64, lead uint64) {\n\t// Your Code Here (2A).\n\tr.State = StateFollower\n\tr.Lead = lead\n\tr.Vote = None\n\tr.Term = term\n\t//log.Printf(r.nodeInfo() + \"become a follower\\n\")\n}",
"func NewFinger(id []byte, node dto.Node) Finger {\n\treturn Finger{\n\t\tID: id,\n\t\tSuccessor: node,\n\t}\n}",
"func (c *Client) Follow(ctx context.Context, ids []string) error {\n\treturn nil\n}",
"func CreateFollowingHandle(db interface{}) func(server.Request) (handler.Response, error) {\n\n\treturn func(req server.Request) (handler.Response, error) {\n\t\t// params from /circles/following/:userId\n\t\tuserId := req.GetParamByName(\"userId\")\n\t\tif userId == \"\" {\n\t\t\terrorMessage := fmt.Sprintf(\"User Id is required!\")\n\t\t\treturn handler.Response{StatusCode: http.StatusBadRequest, Body: utils.MarshalError(\"userIdRequired\", errorMessage)}, nil\n\t\t}\n\t\tfmt.Printf(\"\\n Post ID: %s\", userId)\n\t\tuserUUID, uuidErr := uuid.FromString(userId)\n\t\tif uuidErr != nil {\n\t\t\terrorMessage := fmt.Sprintf(\"UUID Error %s\", uuidErr.Error())\n\t\t\treturn handler.Response{StatusCode: http.StatusInternalServerError, Body: utils.MarshalError(\"uuidError\", errorMessage)}, nil\n\t\t}\n\t\t// Create a new circle\n\t\tnewCircle := &domain.Circle{\n\t\t\tOwnerUserId: userUUID,\n\t\t\tName: followingCircleName,\n\t\t\tIsSystem: true,\n\t\t}\n\n\t\t// Create service\n\t\tcircleService, serviceErr := service.NewCircleService(db)\n\t\tif serviceErr != nil {\n\t\t\terrorMessage := fmt.Sprintf(\"circle Error %s\", serviceErr.Error())\n\t\t\treturn handler.Response{StatusCode: http.StatusInternalServerError, Body: utils.MarshalError(\"circleServiceError\", errorMessage)}, nil\n\t\t}\n\n\t\tif err := circleService.SaveCircle(newCircle); err != nil {\n\t\t\terrorMessage := fmt.Sprintf(\"Save Circle Error %s\", err.Error())\n\t\t\treturn handler.Response{StatusCode: http.StatusInternalServerError, Body: utils.MarshalError(\"saveCircleError\", errorMessage)}, nil\n\t\t}\n\n\t\treturn handler.Response{\n\t\t\tBody: []byte(fmt.Sprintf(`{\"success\": true, \"objectId\": \"%s\"}`, newCircle.ObjectId.String())),\n\t\t\tStatusCode: http.StatusOK,\n\t\t}, nil\n\t}\n}",
"func (s *FrontendSvc) PostUserFollow(newUserSvcClient UserSvcInjector) gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\tuserID := GetUserID(c)\n\t\tfollowID := c.Param(\"user_id\")\n\t\tif userIDErr, followIDErr := validation.ValidUUID(userID), validation.ValidUUID(followID); userIDErr != nil || followIDErr != nil {\n\t\t\tResponseError(c, http.StatusBadRequest, \"please provide a valid user and follow id\")\n\t\t\treturn\n\t\t}\n\t\tuser, following, err := s.UserSvcCreateFollow(c.Request.Context(), newUserSvcClient, userID, followID)\n\t\tst := status.Convert(err)\n\t\tswitch st.Code() {\n\t\tcase codes.OK:\n\t\t\tResponseOK(c, \"successfully followed user\", gin.H{\n\t\t\t\t\"user\": user,\n\t\t\t\t\"following_user\": following,\n\t\t\t})\n\t\tcase codes.NotFound:\n\t\t\tResponseError(c, http.StatusBadRequest, \"please provide a valid user and follow id\")\n\t\tdefault:\n\t\t\ts.log.Error(st.Err())\n\t\t\tResponseInternalError(c)\n\t\t}\n\t}\n}",
"func (f *FilterManager) addFollower(fcfg FollowerConfig) error {\n\tf.expungeOldFiles()\n\tstid := FileName{\n\t\tBaseName: fcfg.BaseName,\n\t\tFilePath: fcfg.FilePath,\n\t}\n\tid, err := getFileIdFromName(fcfg.FilePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif flw, ok := f.followers[stid]; ok {\n\t\tif flw.FileId() != id {\n\t\t\t//delete the old follower\n\t\t\tdelete(f.followers, stid)\n\t\t\tdelete(f.states, stid)\n\t\t\tif err := flw.Close(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\treturn errors.New(\"duplicate follower\")\n\t\t}\n\t}\n\tfl, err := NewFollower(fcfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := fl.Start(); err != nil {\n\t\tfl.Close()\n\t\treturn err\n\t}\n\tf.followers[stid] = fl\n\treturn nil\n}",
"func (t *Twitter) Follow(userFollower, userToFollow string) {\n\tw := 0\n\tfor i := 0; i < len(t.users); i++ {\n\t\tif t.users[i].User == userToFollow {\n\t\t\tfor j := 0; j < len(t.users); j++ {\n\t\t\t\tif t.users[j].User == userFollower {\n\t\t\t\t\tfor k := 0; k < len(t.users[j].IFollowThisUsers); k++ {\n\t\t\t\t\t\tif t.users[j].IFollowThisUsers[k].User == t.users[i].User {\n\t\t\t\t\t\t\tw++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif w == 0 {\n\t\t\t\t\t\tt.users[j].IFollowThisUsers = append(t.users[j].IFollowThisUsers, t.users[i])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"func (d *NVMeStorageDriver) CreateFollowup(ctx context.Context, volConfig *storage.VolumeConfig) error {\n\tfields := LogFields{\n\t\t\"method\": \"CreateFollowup\",\n\t\t\"type\": \"SANNVMeStorageDriver\",\n\t\t\"name\": volConfig.Name,\n\t\t\"internalName\": volConfig.InternalName,\n\t}\n\tLogd(ctx, d.Name(), d.Config.DebugTraceFlags[\"method\"]).WithFields(fields).Trace(\">>>> CreateFollowup\")\n\tdefer Logd(ctx, d.Name(), d.Config.DebugTraceFlags[\"method\"]).WithFields(fields).Trace(\"<<<< CreateFollowup\")\n\n\tif d.Config.DriverContext == tridentconfig.ContextDocker {\n\t\t// gbhatnag TODO: see if we need to do anything in createFollowup for docker context\n\t\tLogc(ctx).Trace(\"No follow-up create actions for Docker.\")\n\t\treturn nil\n\t}\n\treturn nil\n}",
"func (d *MasterDaemon) becomeFollower() {\n\t// ask listener to stop\n\td.stopLeaderChan <- true\n\ttime.Sleep(time.Second)\n\n\t// set current state\n\td.currState = \"follower\"\n\n\t// run follower loop\n\tgo d.runFollower()\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
FollowElection starts monitoring the election.
|
func (f *Follower) FollowElection() (<-chan string, <-chan error, error) {
f.leaderCh = make(chan string)
f.errCh = make(chan error)
ch, err := f.client.Watch(f.key, f.stopCh)
if err != nil {
return nil, nil, err
}
go f.follow(ch)
return f.leaderCh, f.errCh, nil
}
|
[
"func (cm *ConsensusModule) startElection() {\n cm.state = Candidate\n cm.currentTerm += 1\n savedCurrentTerm := cm.currentTerm\n cm.electionResetEvent = time.Now()\n cm.votedFor = cm.id\n cm.dlog(\"becomes Canddiate (currentTerm=%d); log=%v\", savedCurrentTerm, cm.log)\n\n // candidate votes for itself\n var votesReceived int32 = 1\n\n // Send RequestVote RPCs to peers\n for _, peerId := range cm.peerIds {\n go func(peerId int) {\n cm.mu.Lock()\n savedLastLogIndex, savedLastLogTerm := cm.lastLogIndexAndTerm()\n cm.mu.Unlock()\n\n args := RequestVoteArgs{\n Term: savedCurrentTerm,\n CandidateId: cm.id,\n LastLogIndex: savedLastLogIndex,\n LastLogTerm: savedLastLogTerm,\n }\n\n cm.dlog(\"sending RequestVote to %d: %+v\", peerId, args)\n var reply RequestVoteReply\n\n // each RPC issued in a separate goroutine (since RPC calls synchronous)\n // QUESTION: why are we using pointers for reply?\n if err := cm.server.Call(peerId, \"ConsensusModule.RequestVote\", args, &reply); err == nil {\n cm.mu.Lock()\n defer cm.mu.Unlock()\n cm.dlog(\"received RequestVoteReply %+v\", reply)\n\n // if RPC succeeds, some time has passed, so check current state\n // if no longer candidate, bail\n // (can happen if we won election because enough votes collected in other RPC calls\n // or we switched back to being a follower if one of the other RPC calls heard\n // from a server with a higher term\n if cm.state != Candidate {\n cm.dlog(\"while waiting for reply, state = %v\", cm.state)\n return\n }\n\n // if still candidate\n if reply.Term > savedCurrentTerm {\n // other candidate one while we were collecting votes\n cm.dlog(\"term out of date in RequestVoteReply\")\n cm.becomeFollower(reply.Term)\n return\n } else if reply.Term == savedCurrentTerm {\n if reply.VoteGranted {\n // use atomic to collect votes from multiple goroutines safely\n votes := int(atomic.AddInt32(&votesReceived, 1))\n if votes*2 > len(cm.peerIds) + 1 {\n // won the election\n cm.dlog(\"wins election with %d votes\", votes)\n cm.startLeader()\n return\n }\n }\n }\n }\n }(peerId)\n }\n\n // in case this election is not successful, run another election timer\n go cm.runElectionTimer()\n}",
"func (s *raftClusterSimulator) startElection(serverID int64, d time.Duration) {\n\ts.services[serverID].StartElection(d)\n}",
"func (rf *Raft) FollowerStartNewRouldOfElection() {\n\tfor {\n\t\t<-rf.startNewElectionSignalCh\n\t\t// fmt.Printf(\"## Candidate %d with term %d start a new round of election wiht logs: %v\\n\", rf.me, rf.currentTerm, rf.logs)\n\t\tvar replyArr = make([]RequestVoteReply, len(rf.peers))\n\t\tvar requestVoteArgs RequestVoteArgs\n\t\trf.mu.Lock()\n\t\trf.currentTerm++\n\t\trf.state = Candidate\n\t\trf.votedFor = rf.me\n\t\tif logSize := len(rf.logs); logSize > 0 {\n\t\t\trequestVoteArgs = RequestVoteArgs{Term: rf.currentTerm, CandidateID: rf.me, LastLogIndex: logSize, LastLogTerm: rf.logs[logSize-1].Term}\n\t\t} else {\n\t\t\trequestVoteArgs = RequestVoteArgs{Term: rf.currentTerm, CandidateID: rf.me, LastLogIndex: 0, LastLogTerm: 0}\n\t\t}\n\t\trf.mu.Unlock()\n\t\tfor peerID := 0; peerID < len(rf.peers); peerID++ {\n\t\t\tif peerID == rf.me {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo rf.sendRequestVote(peerID, &requestVoteArgs, &replyArr[peerID])\n\t\t}\n\t\trandTimeoutMilli := ElectionTimeoutMilli + ElectionTimeoutMilli/4 - rand.Intn(ElectionTimeoutMilli/2)\n\n\t\ttimeout := time.After(time.Duration(randTimeoutMilli) * time.Millisecond)\n\t\ttick := time.Tick(time.Duration(LeaderHeartbeatIntervalMilli) * time.Millisecond)\n\n\t\t// tick is for periodic check of votes, since normally we don't need to wait that long\n\t\telectionInterrupted := false\n\t\tvoteActuired := 1\n\t\tfor !electionInterrupted {\n\t\t\tselect {\n\t\t\tcase <-timeout:\n\t\t\t\telectionInterrupted = true\n\t\t\tcase <-tick:\n\t\t\t\tvoteActuired = 1\n\t\t\t\trf.mu.Lock()\n\t\t\t\tfor peerID := 0; peerID < len(rf.peers); peerID++ {\n\t\t\t\t\tif peerID == rf.me {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif replyArr[peerID].Term > rf.currentTerm {\n\t\t\t\t\t\trf.state = Follower\n\t\t\t\t\t\trf.currentTerm = replyArr[peerID].Term\n\t\t\t\t\t\trf.votedFor = -1\n\t\t\t\t\t} else if replyArr[peerID].VoteGranted {\n\t\t\t\t\t\tvoteActuired++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telectionInterrupted = (voteActuired*2 > len(rf.peers)) || rf.state == Follower\n\t\t\t\trf.mu.Unlock()\n\t\t\t}\n\t\t}\n\t\trf.mu.Lock()\n\t\tif rf.state == Follower {\n\t\t\trf.mu.Unlock()\n\t\t\tcontinue\n\t\t}\n\t\tif voteActuired*2 > len(rf.peers) {\n\t\t\trf.state = Leader\n\t\t\t// unlock before sending to channel, could use defer here, but not that familiar for now\n\t\t\trf.mu.Unlock()\n\t\t\trf.winElectionSignalCh <- true\n\t\t} else {\n\t\t\trf.votedFor = -1\n\t\t\trf.mu.Unlock()\n\t\t\trf.startNewElectionSignalCh <- true\n\t\t}\n\t}\n}",
"func (l *Leader) startElection() {\n\tfor !l.stopped {\n\t\tlog.WithField(\"instance_id\", l.instanceID).Info(\"leader: starting election\")\n\t\telection, err := leaderelection.NewElection(l.zk, l.zkPath, l.instanceID)\n\t\tl.election = election\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Error(\"leader: failed to start new election, sleeping 5 seconds before retry...\")\n\t\t\ttime.Sleep(5 * time.Second)\n\t\t} else {\n\t\t\tgo election.ElectLeader()\n\t\t\tl.monitorElection(election)\n\t\t}\n\t}\n}",
"func (r *Raft) tickElection() {\n\tr.electionElapsed++\n\tif r.electionElapsed >= r.randomElectionTimeout {\n\t\tr.electionElapsed = 0\n\t\t// send message `MessageType_MsgHup` to self\n\t\tr.Step(pb.Message{MsgType: pb.MessageType_MsgHup, From: r.id})\n\t}\n}",
"func (rf *Raft) kickOffElection() {\n\tDPrintf(\"Raft # %d in function kickOffElection()\", rf.me)\n\t// send out requestVote RPCs\n\treplyChan := make(chan *RequestVoteReply)\n\targs := RequestVoteArgs{}\n\trf.mu.Lock()\n\tDPrintf(\"Raft # %d got the lock\", rf.me)\n\targs.Term = rf.currentTerm\n\tDPrintf(\"rf.currentTerm %d\", rf.currentTerm)\n\targs.CandidateId = rf.me\n\targs.LastLogIndex = len(rf.log) - 1\n\targs.LastLogTerm = rf.log[args.LastLogIndex].TermReceived\n\trf.mu.Unlock()\n\tcurrentVoteCounter := 1\n\tfor i := range rf.peers {\n\t\treply := RequestVoteReply{}\n\t\tif i != rf.me {\n\t\t\tgo rf.sendRequestVote(i, &args, &reply, replyChan)\n\t\t\tDPrintf(\"Raft # %d sent RequestVote to Peer # %d\", rf.me, i)\n\t\t\tDPrintf(\"Raft # %d sent RequestVote content: %v\", rf.me, args)\n\t\t\t// if the RPC times out, the go routine will return false\n\t\t\t// should the RequestVote RPC be sent again?\n\t\t}\n\t}\n\tfor { // request vote response handler\n\t\treply := <-replyChan\n\t\trf.mu.Lock()\n\t\tDPrintf(\"Raft # %d got the lock\", rf.me)\n\t\tDPrintf(\"Raft # %d got RequestVote reply from Peer\", rf.me)\n\t\tif rf.currentTerm > args.Term {\n\t\t\t// already timed out and kick started a new election\n\t\t\trf.mu.Unlock()\n\t\t\treturn\n\t\t}\n\t\tDPrintf(\"Raft # %d is in term # %d\", rf.me, rf.currentTerm)\n\t\tif reply.VoteGranted && reply.Term == rf.currentTerm {\n\t\t\tcurrentVoteCounter++\n\t\t\tif currentVoteCounter >= rf.majorityNeed && rf.currentState == candidate {\n\t\t\t\t// elected leader\n\t\t\t\tDPrintf(\"Raft # %d received enough votes and converted to leader\", rf.me)\n\t\t\t\trf.currentState = leader\n\t\t\t\trf.nextIndex = make([]int, len(rf.peers))\n\t\t\t\trf.matchIndex = make([]int, len(rf.peers))\n\t\t\t\tfor i := range rf.peers {\n\t\t\t\t\trf.nextIndex[i] = len(rf.log)\n\t\t\t\t\trf.matchIndex[i] = 0\n\t\t\t\t}\n\t\t\t\tgo rf.leaderRoutine()\n\t\t\t\trf.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\t// vote not granted\n\t\t\t// may need to update the term\n\t\t\tif rf.currentTerm < reply.Term {\n\t\t\t\trf.currentTerm = reply.Term\n\t\t\t\trf.currentState = follower // voting conversion\n\t\t\t\trf.votedFor = -1\n\t\t\t\trf.electionTimerResetted = true\n\t\t\t\t// All Servers: if RPC response contain term > currentTerm\n\t\t\t\t// convert to follower\n\t\t\t\trf.persist()\n\t\t\t\trf.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\trf.mu.Unlock() // don't hold the lock while listening on channel\n\t}\n}",
"func (s *Server) establishLeadership(stopCh chan struct{}) error {\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"leader\", \"establish_leadership\"}, time.Now())\n\n\t// Generate a leader ACL token. This will allow the leader to issue work\n\t// that requires a valid ACL token.\n\ts.setLeaderAcl(uuid.Generate())\n\n\t// Disable workers to free half the cores for use in the plan queue and\n\t// evaluation broker\n\tif numWorkers := len(s.workers); numWorkers > 1 {\n\t\t// Disabling 3/4 of the workers frees CPU for raft and the\n\t\t// plan applier which uses 1/2 the cores.\n\t\tfor i := 0; i < (3 * numWorkers / 4); i++ {\n\t\t\ts.workers[i].SetPause(true)\n\t\t}\n\t}\n\n\t// Initialize and start the autopilot routine\n\ts.getOrCreateAutopilotConfig()\n\ts.autopilot.Start()\n\n\t// Enable the plan queue, since we are now the leader\n\ts.planQueue.SetEnabled(true)\n\n\t// Start the plan evaluator\n\tgo s.planApply()\n\n\t// Enable the eval broker, since we are now the leader\n\ts.evalBroker.SetEnabled(true)\n\n\t// Enable the blocked eval tracker, since we are now the leader\n\ts.blockedEvals.SetEnabled(true)\n\ts.blockedEvals.SetTimetable(s.fsm.TimeTable())\n\n\t// Enable the deployment watcher, since we are now the leader\n\ts.deploymentWatcher.SetEnabled(true, s.State())\n\n\t// Enable the NodeDrainer\n\ts.nodeDrainer.SetEnabled(true, s.State())\n\n\t// Restore the eval broker state\n\tif err := s.restoreEvals(); err != nil {\n\t\treturn err\n\t}\n\n\t// Activate the vault client\n\ts.vault.SetActive(true)\n\tif err := s.restoreRevokingAccessors(); err != nil {\n\t\treturn err\n\t}\n\n\t// Enable the periodic dispatcher, since we are now the leader.\n\ts.periodicDispatcher.SetEnabled(true)\n\n\t// Restore the periodic dispatcher state\n\tif err := s.restorePeriodicDispatcher(); err != nil {\n\t\treturn err\n\t}\n\n\t// Scheduler periodic jobs\n\tgo s.schedulePeriodic(stopCh)\n\n\t// Reap any failed evaluations\n\tgo s.reapFailedEvaluations(stopCh)\n\n\t// Reap any duplicate blocked evaluations\n\tgo s.reapDupBlockedEvaluations(stopCh)\n\n\t// Periodically unblock failed allocations\n\tgo s.periodicUnblockFailedEvals(stopCh)\n\n\t// Periodically publish job summary metrics\n\tgo s.publishJobSummaryMetrics(stopCh)\n\n\t// Setup the heartbeat timers. This is done both when starting up or when\n\t// a leader fail over happens. Since the timers are maintained by the leader\n\t// node, effectively this means all the timers are renewed at the time of failover.\n\t// The TTL contract is that the session will not be expired before the TTL,\n\t// so expiring it later is allowable.\n\t//\n\t// This MUST be done after the initial barrier to ensure the latest Nodes\n\t// are available to be initialized. Otherwise initialization may use stale\n\t// data.\n\tif err := s.initializeHeartbeatTimers(); err != nil {\n\t\ts.logger.Printf(\"[ERR] nomad: heartbeat timer setup failed: %v\", err)\n\t\treturn err\n\t}\n\n\t// COMPAT 0.4 - 0.4.1\n\t// Reconcile the summaries of the registered jobs. We reconcile summaries\n\t// only if the server is 0.4.1 since summaries are not present in 0.4 they\n\t// might be incorrect after upgrading to 0.4.1 the summaries might not be\n\t// correct\n\tif err := s.reconcileJobSummaries(); err != nil {\n\t\treturn fmt.Errorf(\"unable to reconcile job summaries: %v\", err)\n\t}\n\n\t// Start replication of ACLs and Policies if they are enabled,\n\t// and we are not the authoritative region.\n\tif s.config.ACLEnabled && s.config.Region != s.config.AuthoritativeRegion {\n\t\tgo s.replicateACLPolicies(stopCh)\n\t\tgo s.replicateACLTokens(stopCh)\n\t}\n\n\t// Setup any enterprise systems required.\n\tif err := s.establishEnterpriseLeadership(stopCh); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (le *LeaderElector) Run(ctx context.Context) error {\n\tle.logger.Infof(\"Starting leaderElection...\")\n\tvar leCtx context.Context\n\tvar leCancel context.CancelFunc\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tle.logger.Info(\"Shutting down LeaderElection...\")\n\t\t\tif leCancel != nil {\n\t\t\t\tleCancel()\n\t\t\t}\n\t\t\treturn nil\n\t\tcase <-time.After(le.Config.ReelectionPeriod.Duration):\n\t\t\tisLeader, isLearner, err := le.CheckMemberStatus(ctx, le.EtcdConnectionConfig, le.Config.EtcdConnectionTimeout.Duration, le.logger)\n\t\t\tif err != nil {\n\t\t\t\tle.logger.Errorf(\"failed to elect the backup-restore leader: %v\", err)\n\n\t\t\t\t// set the CurrentState of backup-restore.\n\t\t\t\t// stops the Running Snapshotter.\n\t\t\t\t// stops the Renewal of member lease(if running).\n\t\t\t\t// wait for Reelection to happen.\n\t\t\t\tif le.CurrentState != StateUnknown && le.LeaseCallbacks.StopLeaseRenewal != nil {\n\t\t\t\t\tle.LeaseCallbacks.StopLeaseRenewal()\n\t\t\t\t}\n\t\t\t\tif le.CurrentState == StateLeader && leCtx != nil {\n\t\t\t\t\tleCancel()\n\t\t\t\t\tle.Callbacks.OnStoppedLeading()\n\t\t\t\t}\n\t\t\t\tle.CurrentState = StateUnknown\n\t\t\t\tle.logger.Infof(\"backup-restore is in: %v\", le.CurrentState)\n\t\t\t\tle.logger.Info(\"waiting for Re-election...\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif isLeader && (le.CurrentState == StateFollower || le.CurrentState == StateUnknown || le.CurrentState == StateCandidate) {\n\t\t\t\t// backup-restore becomes the Leader backup-restore.\n\t\t\t\t// set the CurrentState of backup-restore.\n\t\t\t\t// update the snapshotter object with latest snapshotter object.\n\t\t\t\t// start the snapshotter.\n\n\t\t\t\tif le.CurrentState == StateUnknown && le.LeaseCallbacks.StartLeaseRenewal != nil {\n\t\t\t\t\tle.LeaseCallbacks.StartLeaseRenewal()\n\t\t\t\t}\n\t\t\t\tle.CurrentState = StateLeader\n\t\t\t\tle.logger.Infof(\"backup-restore became: %v\", le.CurrentState)\n\n\t\t\t\tif le.Callbacks.OnStartedLeading != nil {\n\t\t\t\t\tleCtx, leCancel = context.WithCancel(ctx)\n\t\t\t\t\tle.logger.Info(\"backup-restore started leading...\")\n\t\t\t\t\tle.Callbacks.OnStartedLeading(leCtx)\n\t\t\t\t}\n\t\t\t} else if isLeader && le.CurrentState == StateLeader {\n\t\t\t\tle.logger.Debug(\"no change in leadershipStatus...\")\n\t\t\t} else if !isLeader && le.CurrentState == StateLeader {\n\t\t\t\t// backup-restore lost the election and becomes Follower.\n\t\t\t\t// set the CurrentState of backup-restore.\n\t\t\t\t// stop the Running snapshotter.\n\t\t\t\tle.CurrentState = StateFollower\n\t\t\t\tle.logger.Info(\"backup-restore lost the election\")\n\t\t\t\tle.logger.Infof(\"backup-restore became: %v\", le.CurrentState)\n\n\t\t\t\tif leCtx != nil {\n\t\t\t\t\tleCancel()\n\t\t\t\t\tle.Callbacks.OnStoppedLeading()\n\t\t\t\t}\n\t\t\t} else if !isLeader && le.CurrentState == StateUnknown {\n\t\t\t\tif le.LeaseCallbacks.StartLeaseRenewal != nil {\n\t\t\t\t\tle.LeaseCallbacks.StartLeaseRenewal()\n\t\t\t\t}\n\t\t\t\tle.CurrentState = StateFollower\n\t\t\t\tle.logger.Infof(\"backup-restore changed the state from %v to %v\", StateUnknown, le.CurrentState)\n\t\t\t} else if !isLeader && le.CurrentState == StateFollower {\n\t\t\t\tle.logger.Debugf(\"backup-restore currentState: %v\", le.CurrentState)\n\n\t\t\t\t// If learner(non-voting member) is present in a cluster(size>1)\n\t\t\t\t// then promote the learner to voting member.\n\t\t\t\tif isLearner && le.PromoteCallback != nil {\n\t\t\t\t\tmetrics.IsLearner.With(prometheus.Labels{}).Set(1)\n\t\t\t\t\tle.logger.Info(\"member is a learner(non-voting) member in the cluster...\")\n\t\t\t\t\tle.PromoteCallback.Promote(ctx, le.logger)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"func (tr *TRaft) establishLeadership(currVote *LeaderId, replies []*ElectReply) {\n\n\tme := tr.Status[tr.Id]\n\n\t// not to update expire time.\n\t// let the leader expire earlier than follower to reduce chance that follower reject replication from leader.\n\n\ttr.mergeFollowerLogs(replies)\n\n\t// then going on replicating these logs to others.\n\t//\n\t// TODO update local view of status of other replicas.\n\tfor _, r := range replies {\n\t\tfollower := tr.Status[r.Id]\n\t\tif r.Committer.Equal(me.Committer) {\n\t\t\tfollower.Accepted = r.Accepted.Clone()\n\t\t} else {\n\t\t\t// if committers are different, the leader can no be\n\t\t\t// sure whether a follower has identical logs\n\t\t\tfollower.Accepted = r.Committed.Clone()\n\t\t}\n\t\tfollower.Committed = r.Committed.Clone()\n\n\t\tfollower.Committer = r.Committer.Clone()\n\t}\n\n\t// Leader accept all the logs it sees\n\tme.Committer = currVote.Clone()\n\n}",
"func (r *Raft) runCandidate() {\n\tr.logger.Info(\"entering candidate state\", \"node\", r, \"term\", r.getCurrentTerm()+1)\n\tmetrics.IncrCounter([]string{\"raft\", \"state\", \"candidate\"}, 1)\n\n\t// Start vote for us, and set a timeout\n\tvoteCh := r.electSelf()\n\n\t// Make sure the leadership transfer flag is reset after each run. Having this\n\t// flag will set the field LeadershipTransfer in a RequestVoteRequst to true,\n\t// which will make other servers vote even though they have a leader already.\n\t// It is important to reset that flag, because this priviledge could be abused\n\t// otherwise.\n\tdefer func() { r.candidateFromLeadershipTransfer = false }()\n\n\telectionTimeout := r.config().ElectionTimeout\n\telectionTimer := randomTimeout(electionTimeout)\n\n\t// Tally the votes, need a simple majority\n\tgrantedVotes := 0\n\tvotesNeeded := r.quorumSize()\n\tr.logger.Debug(\"votes\", \"needed\", votesNeeded)\n\n\tfor r.getState() == Candidate {\n\t\tr.mainThreadSaturation.sleeping()\n\n\t\tselect {\n\t\tcase rpc := <-r.rpcCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\tr.processRPC(rpc)\n\n\t\tcase vote := <-voteCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Check if the term is greater than ours, bail\n\t\t\tif vote.Term > r.getCurrentTerm() {\n\t\t\t\tr.logger.Debug(\"newer term discovered, fallback to follower\")\n\t\t\t\tr.setState(Follower)\n\t\t\t\tr.setCurrentTerm(vote.Term)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Check if the vote is granted\n\t\t\tif vote.Granted {\n\t\t\t\tgrantedVotes++\n\t\t\t\tr.logger.Debug(\"vote granted\", \"from\", vote.voterID, \"term\", vote.Term, \"tally\", grantedVotes)\n\t\t\t}\n\n\t\t\t// Check if we've become the leader\n\t\t\tif grantedVotes >= votesNeeded {\n\t\t\t\tr.logger.Info(\"election won\", \"tally\", grantedVotes)\n\t\t\t\tr.setState(Leader)\n\t\t\t\tr.setLeader(r.localAddr, r.localID)\n\t\t\t\treturn\n\t\t\t}\n\n\t\tcase c := <-r.configurationChangeCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\tc.respond(ErrNotLeader)\n\n\t\tcase a := <-r.applyCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\ta.respond(ErrNotLeader)\n\n\t\tcase v := <-r.verifyCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\tv.respond(ErrNotLeader)\n\n\t\tcase ur := <-r.userRestoreCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any restores since we are not the leader\n\t\t\tur.respond(ErrNotLeader)\n\n\t\tcase l := <-r.leadershipTransferCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\tl.respond(ErrNotLeader)\n\n\t\tcase c := <-r.configurationsCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\tc.configurations = r.configurations.Clone()\n\t\t\tc.respond(nil)\n\n\t\tcase b := <-r.bootstrapCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\tb.respond(ErrCantBootstrap)\n\n\t\tcase <-r.leaderNotifyCh:\n\t\t\t// Ignore since we are not the leader\n\n\t\tcase <-r.followerNotifyCh:\n\t\t\tif electionTimeout != r.config().ElectionTimeout {\n\t\t\t\telectionTimeout = r.config().ElectionTimeout\n\t\t\t\telectionTimer = randomTimeout(electionTimeout)\n\t\t\t}\n\n\t\tcase <-electionTimer:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Election failed! Restart the election. We simply return,\n\t\t\t// which will kick us back into runCandidate\n\t\t\tr.logger.Warn(\"Election timeout reached, restarting election\")\n\t\t\treturn\n\n\t\tcase <-r.shutdownCh:\n\t\t\treturn\n\t\t}\n\t}\n}",
"func candidateLoop(sc *ServerConfig) {\n\t//\tdbg.Println(sc.basicCluster.Mypid, \"entered candidate\")\n\t// increment term\n\tsc.mutex.Lock()\n\tsc.term++\n\tsc.mutex.Unlock()\n\n\t// vote for self\n\tsetVotedFor(sc, sc.basicCluster.Mypid)\n\ttotalVotesRecieved := 1\n\t//reset timer\n\ttimeChan := RandomTimer(sc.electionTODuration)\n\t// send request for voting on all peers\n\n\tsc.basicCluster.Output <- &cluster.Envelope{SendTo: -1, SendBy: sc.basicCluster.Mypid, Term: getTerm(sc), Type: REQUESTVOTE, PrevLogIndex: len(sc.log) - 1, PrevLogTerm: sc.log[len(sc.log)-1].Term}\n\n\tfor getState(sc) == CANDIDATE {\n\n\t\tselect {\n\t\t// wait for inbox channel\n\t\tcase envelope := <-sc.basicCluster.Input:\n\n\t\t\t// if a lower term message is recieved, send a modify message...\n\t\t\tif envelope.Term < getTerm(sc) {\n\n\t\t\t\tsc.basicCluster.Output <- &cluster.Envelope{SendTo: envelope.SendBy, SendBy: sc.basicCluster.Mypid, Term: getTerm(sc), Type: MODIFY}\n\t\t\t\t// if recieved message term is greater than my term, end election, become follower, return\n\t\t\t} else if envelope.Type == HEARTBEAT || envelope.Type == APPEND {\n\t\t\t\tsetTerm(sc, envelope.Term)\n\t\t\t\tsetState(sc, FOLLOWER)\n\t\t\t\tsetVotedFor(sc, NONE)\n\t\t\t\tsetLeader(sc, envelope.SendBy)\n\n\t\t\t\treturn\n\t\t\t} else if envelope.Term > getTerm(sc) {\n\t\t\t\tsetTerm(sc, envelope.Term)\n\t\t\t\t// if bigger term peer requests for vote, give him vote without thinking, as your vote to yourself is stale\n\t\t\t\tif envelope.Type == REQUESTVOTE {\n\t\t\t\t\tsetVotedFor(sc, envelope.SendBy)\n\n\t\t\t\t\tsc.basicCluster.Output <- &cluster.Envelope{SendTo: envelope.SendBy, SendBy: sc.basicCluster.Mypid, Term: getTerm(sc), Type: GRANTVOTE, VoteTo: envelope.SendBy}\n\t\t\t\t}\n\t\t\t\tsetState(sc, FOLLOWER)\n\t\t\t\treturn\n\t\t\t\t// if vote is granted, add to total votes\n\t\t\t} else if envelope.Type == GRANTVOTE && envelope.VoteTo == sc.basicCluster.Mypid {\n\t\t\t\ttotalVotesRecieved++\n\n\t\t\t}\n\n\t\t\t// if majority votes recieved, become leader, return\n\t\t\tif totalVotesRecieved >= sc.majority {\n\t\t\t\tsetState(sc, LEADER)\n\t\t\t\tsetVotedFor(sc, NONE)\n\t\t\t\tsetLeader(sc, sc.basicCluster.Mypid)\n\n\t\t\t\t//setReady(sc, true)\n\t\t\t\tsc.ready <- true\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// if timeout\n\t\tcase <-timeChan:\n\t\t\t// become follower, end election.\n\n\t\t\tsetVotedFor(sc, NONE)\n\t\t\tsetState(sc, FOLLOWER)\n\t\t\t// If error channel has some value.\n\t\tcase <-sc.ErrorChannel:\n\t\t\tcloseServer(sc)\n\t\t}\n\t}\n}",
"func (r *Raft) becomeLeader() {\n\t// Your Code Here (2A).\n\t// NOTE: Leader should propose a noop entry on its term\n\tr.State = StateLeader\n\tr.Lead = r.id\n\tlastLogIndex := r.RaftLog.LastIndex()\n\tr.heartbeatElapsed = 0\n\n\tfor peer := range r.Prs {\n\t\tif peer == r.id {\n\t\t\tr.Prs[peer].Next = lastLogIndex + 2\n\t\t\tr.Prs[peer].Match = lastLogIndex + 1\n\t\t} else {\n\t\t\tr.Prs[peer].Next = lastLogIndex + 1\n\t\t}\n\t}\n\t//log.Printf(r.nodeInfo() + \"become a leader\\n\")\n\tr.RaftLog.entries = append(r.RaftLog.entries, pb.Entry{Term: r.Term, Index: r.RaftLog.LastIndex()+1})\n\tr.broadcastAppendEntries()\n\tif len(r.Prs) == 1 {\n\t\t// single server\n\t\tr.RaftLog.committed = r.Prs[r.id].Match\n\t}\n}",
"func TestCM_RpcRVR_Candidate_StartNewElectionOnElectionTimeout(t *testing.T) {\n\tmcm, mrs := testSetupMCM_Candidate_Figure7LeaderLine(t)\n\tserverTerm := mcm.pcm.RaftPersistentState.GetCurrentTerm()\n\tsentRpc := &RpcRequestVote{serverTerm, 0, 0}\n\n\t// s2 grants vote - should stay as candidate\n\terr := mcm.pcm.RpcReply_RpcRequestVoteReply(\n\t\t102,\n\t\tsentRpc,\n\t\t&RpcRequestVoteReply{serverTerm, true},\n\t)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif mcm.pcm.GetServerState() != CANDIDATE {\n\t\tt.Fatal()\n\t}\n\n\t// s3 denies vote - should stay as candidate\n\terr = mcm.pcm.RpcReply_RpcRequestVoteReply(\n\t\t103,\n\t\tsentRpc,\n\t\t&RpcRequestVoteReply{serverTerm, false},\n\t)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif mcm.pcm.GetServerState() != CANDIDATE {\n\t\tt.Fatal()\n\t}\n\n\t// no more votes - election timeout causes a new election\n\ttestCM_FollowerOrCandidate_StartsElectionOnElectionTimeout_Part2(t, mcm, mrs, serverTerm+1)\n}",
"func (s *Service) InitiateElectionRequest(ctx context.Context, req *ElectionRequest) (res *Dummy, err error) {\n\t// must init a valid instance of Dummy struct\n\tres = &Dummy{}\n\n\t// add the logic to check whether Primary Broker has already been ELECTED before doing the ID comparison\n\t// if priamry available => do a broadcast instead (since every [ hm... ?? primary eligible] broker will know you have joined)\n\tif _, _, _, avail := s.GetElectedPrimaryBrokerInfo(); avail {\n\t\t// update the brokersMap to add in this instance too\n\t\ts._upsertBrokerToBrokersMap(req.BrokerID, req.BrokerName, req.BrokerAddr, true)\n\t\t// update version state as well since change in brokersMap content\n\t\ts._persist(true)\n\n\t\ts.log.Info(\"[InitiateElectionRequest] broadcast sent to brokers since Primary Broker already ELECTED\")\n\t\ts.initBroadcastMetaStateUpdates(false, false)\n\t\t// throttle the election interval (to reduce number of unecessary broadcast)\n\t\t<-time.NewTimer(intervalElectionDial * time.Millisecond).C\n\t\treturn\n\t}\n\n\ts.mux.Lock()\n\tdefer s.mux.Unlock()\n\n\t// compare the IDs and the min one wins and became the new Primary broker\n\t_win := false\n\t_compResult := strings.Compare(s.broker.GetBrokerID(), req.GetBrokerID())\n\n\tif _compResult < 0 {\n\t\t_win = true\n\t} else if _compResult == 0 {\n\t\t// use the addr to compare one more time (final bout)\n\t\tif strings.Compare(s.broker.GetBrokerAddr(), req.GetBrokerAddr()) < 0 {\n\t\t\t// - win\n\t\t\t_win = true\n\t\t}\n\t}\n\n\t// handling election results\n\tif _win {\n\t\t// - win\n\t\t// update this broker's primary states\n\t\ts.UpsertInMem(KeyPrimaryBroker, true, true)\n\t\ts._updateElectionWonInMemStates(s.broker.GetBrokerID(), s.broker.GetBrokerName(), s.broker.GetBrokerAddr())\n\t\t// [QQ] trigger the broadcast here after a throttle e.g. 2 seconds~~\n\t\t// no need since the upper Primary Broker Check would also trigger broadcast\n\n\t} else {\n\t\t// - lose\n\t\t// issue ACK request instead\n\t\t_gConn, err2 := grpc.Dial(req.GetBrokerAddr(), grpc.WithInsecure())\n\t\tdefer _gConn.Close()\n\n\t\tif err2 != nil {\n\t\t\ts.log.Errorf(\"[InitiateElectionRequest] unusual situation since the requester broker is offlined?? %v\\n\", err2)\n\t\t\terr = err2\n\t\t\treturn\n\t\t}\n\t\t_srv := NewMetastateServiceClient(_gConn)\n\t\t//s.log.Warnf(\"[InitiateElectionRequest] ** srv created , before calling GetACK %v, req [%v], current broker ID, name %v, %v\\n\", _srv, req, s.broker.GetBrokerID(), s.broker.GetBrokerName())\n\t\t_resp, err3 := _srv.GetElectedPrimaryACK(context.Background(), &ElectionDoneHandshakeRequest{\n\t\t\tPrimaryBrokerID: req.GetBrokerID(),\n\t\t\tPrimaryBrokerName: req.GetBrokerName(),\n\t\t\tPrimaryBrokerAddr: req.GetBrokerAddr(),\n\t\t\tSrcBrokerID: s.broker.GetBrokerID(),\n\t\t\tSrcBrokerName: s.broker.GetBrokerName(),\n\t\t\tSrcBrokerAddr: s.broker.GetBrokerAddr(),\n\t\t})\n\t\tif err3 != nil {\n\t\t\ts.log.Errorf(\"[InitiateElectionRequest] ACK request exception, reason: %v\\n\", err3)\n\t\t\terr = err3\n\t\t\treturn\n\t\t}\n\t\t//s.log.Warnf(\"[InitiateElectionRequest] ACK response %v\\n\", _resp)\n\t\t// validate the response and update the state's elected primary attributes\n\t\tif _resp.Code == ackStatusCode200 {\n\t\t\t// update this broker's primary states\n\t\t\ts.UpsertInMem(KeyPrimaryBroker, false, true)\n\t\t\ts._updateElectionWonInMemStates(req.GetBrokerID(), req.GetBrokerName(), req.GetBrokerAddr())\n\n\t\t\t// version number and ID (running num)\n\t\t\ts.UpsertInMem(KeyStateVersion, _resp.GetStateVersion(), false)\n\t\t\ts.Upsert(KeyStateVersionID, fmt.Sprintf(\"%v\", _resp.GetStateNum()), true, false, false)\n\t\t} else {\n\t\t\t// other status code should be EXCEPTION\n\t\t\terr = fmt.Errorf(\"[InitiateElectionRequest] ACK request exception, code [%v] - [%v]\",\n\t\t\t\t_resp.Code, s._electionDoneACKRespStatusTranslator(_resp.Code))\n\t\t\ts.log.Error(err)\n\t\t\treturn\n\t\t}\n\t}\n\ts.log.Infof(\"[InitiateElectionRequest] finally ... state [%v] vs in-mem state [%v], available broker map: {%v}\\n\",\n\t\ts.states, s.inMemStates, s.GetAvailableBrokersMap())\n\treturn\n}",
"func (r *Raft) runFollower() {\n\tdidWarn := false\n\tleaderAddr, leaderID := r.LeaderWithID()\n\tr.logger.Info(\"entering follower state\", \"follower\", r, \"leader-address\", leaderAddr, \"leader-id\", leaderID)\n\tmetrics.IncrCounter([]string{\"raft\", \"state\", \"follower\"}, 1)\n\theartbeatTimer := randomTimeout(r.config().HeartbeatTimeout)\n\n\tfor r.getState() == Follower {\n\t\tr.mainThreadSaturation.sleeping()\n\n\t\tselect {\n\t\tcase rpc := <-r.rpcCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\tr.processRPC(rpc)\n\n\t\tcase c := <-r.configurationChangeCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\tc.respond(ErrNotLeader)\n\n\t\tcase a := <-r.applyCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\ta.respond(ErrNotLeader)\n\n\t\tcase v := <-r.verifyCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\tv.respond(ErrNotLeader)\n\n\t\tcase ur := <-r.userRestoreCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any restores since we are not the leader\n\t\t\tur.respond(ErrNotLeader)\n\n\t\tcase l := <-r.leadershipTransferCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Reject any operations since we are not the leader\n\t\t\tl.respond(ErrNotLeader)\n\n\t\tcase c := <-r.configurationsCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\tc.configurations = r.configurations.Clone()\n\t\t\tc.respond(nil)\n\n\t\tcase b := <-r.bootstrapCh:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\tb.respond(r.liveBootstrap(b.configuration))\n\n\t\tcase <-r.leaderNotifyCh:\n\t\t\t// Ignore since we are not the leader\n\n\t\tcase <-r.followerNotifyCh:\n\t\t\theartbeatTimer = time.After(0)\n\n\t\tcase <-heartbeatTimer:\n\t\t\tr.mainThreadSaturation.working()\n\t\t\t// Restart the heartbeat timer\n\t\t\thbTimeout := r.config().HeartbeatTimeout\n\t\t\theartbeatTimer = randomTimeout(hbTimeout)\n\n\t\t\t// Check if we have had a successful contact\n\t\t\tlastContact := r.LastContact()\n\t\t\tif time.Now().Sub(lastContact) < hbTimeout {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Heartbeat failed! Transition to the candidate state\n\t\t\tlastLeaderAddr, lastLeaderID := r.LeaderWithID()\n\t\t\tr.setLeader(\"\", \"\")\n\n\t\t\tif r.configurations.latestIndex == 0 {\n\t\t\t\tif !didWarn {\n\t\t\t\t\tr.logger.Warn(\"no known peers, aborting election\")\n\t\t\t\t\tdidWarn = true\n\t\t\t\t}\n\t\t\t} else if r.configurations.latestIndex == r.configurations.committedIndex &&\n\t\t\t\t!hasVote(r.configurations.latest, r.localID) {\n\t\t\t\tif !didWarn {\n\t\t\t\t\tr.logger.Warn(\"not part of stable configuration, aborting election\")\n\t\t\t\t\tdidWarn = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmetrics.IncrCounter([]string{\"raft\", \"transition\", \"heartbeat_timeout\"}, 1)\n\t\t\t\tif hasVote(r.configurations.latest, r.localID) {\n\t\t\t\t\tr.logger.Warn(\"heartbeat timeout reached, starting election\", \"last-leader-addr\", lastLeaderAddr, \"last-leader-id\", lastLeaderID)\n\t\t\t\t\tr.setState(Candidate)\n\t\t\t\t\treturn\n\t\t\t\t} else if !didWarn {\n\t\t\t\t\tr.logger.Warn(\"heartbeat timeout reached, not part of a stable configuration or a non-voter, not triggering a leader election\")\n\t\t\t\t\tdidWarn = true\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase <-r.shutdownCh:\n\t\t\treturn\n\t\t}\n\t}\n}",
"func setLeaderElection(enable, disable []storage.Server, server storage.Server, key, msg string) phase {\n\treturn phase{\n\t\tID: fmt.Sprintf(\"%s-%s\", key, server.Hostname),\n\t\tExecutor: electionStatus,\n\t\tDescription: fmt.Sprintf(msg, server.Hostname),\n\t\tData: &storage.OperationPhaseData{\n\t\t\tServer: &server,\n\t\t\tElectionChange: &storage.ElectionChange{\n\t\t\t\tEnableServers: enable,\n\t\t\t\tDisableServers: disable,\n\t\t\t}},\n\t}\n}",
"func Bully(pid int, leader int, checkLeader chan bool, comm map[int]chan Message, startRound <-chan int, quit <-chan bool, electionResult chan<- int) {\n\n\t// TODO: initialization code\n\troundsSinceLeaderReplied := 0\n\twaitingForLeaderReply := false\n\tcalledElection := false\n\troundInWhichElectionCalled := -1\n\tlastRound := 0\n\n\tfor {\n\t\t// quit / crash the program\n\t\tif <-quit {\n\t\t\treturn\n\t\t}\n\n\t\t// start the round\n\t\troundNum := <-startRound\n\t\tnewMessages := getMessages(comm[pid], roundNum-1)\n\n\t\t// Check if I was a leader and I was down\n\t\t// If true, tell everyone I am back\n\t\tif lastRound != roundNum-1 && pid == leader {\n\t\t\tfor _, c := range comm {\n\t\t\t\tc <- Message{pid, roundNum, COORDINATOR}\n\t\t\t}\n\t\t}\n\n\t\tfor i := range newMessages {\n\t\t\ttemp := newMessages[i]\n\n\t\t\tswitch temp.Type {\n\t\t\tcase COORDINATOR:\n\t\t\t\tleader = temp.Pid\n\t\t\t\telectionResult <- leader\n\t\t\t\troundInWhichElectionCalled = -1\n\t\t\t\tcalledElection = false\n\t\t\t\tbreak\n\n\t\t\tcase YES:\n\t\t\t\t// Do Nothing\n\t\t\t\tbreak\n\n\t\t\tcase ALIVE:\n\t\t\t\tcomm[temp.Pid] <- Message{pid, roundNum, YES}\n\t\t\t\tbreak\n\n\t\t\tcase ELECTION:\n\t\t\t\t// Check if I am the highest pid, tell others I am leader\n\t\t\t\tif isHighestPid(pid, comm) {\n\t\t\t\t\tfor _, c := range comm {\n\t\t\t\t\t\tc <- Message{pid, roundNum, COORDINATOR}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Tell the node that sent election message that I will takeover the election\n\t\t\t\tcomm[temp.Pid] <- Message{pid, roundNum, OK}\n\n\t\t\t\t// Call election\n\t\t\t\thasSentMessageToSomeone := false\n\t\t\t\tif !calledElection {\n\t\t\t\t\tcalledElection = true\n\t\t\t\t\troundInWhichElectionCalled = roundNum\n\t\t\t\t\tfor p, c := range comm {\n\t\t\t\t\t\tif p > pid {\n\t\t\t\t\t\t\tc <- Message{pid, roundNum, ELECTION}\n\t\t\t\t\t\t\thasSentMessageToSomeone = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// If I did not send message to anyone, then I am the leader\n\t\t\t\t\tif !hasSentMessageToSomeone {\n\t\t\t\t\t\tfor _, c := range comm {\n\t\t\t\t\t\t\tc <- Message{pid, roundNum, COORDINATOR}\n\t\t\t\t\t\t\tcalledElection = false\n\t\t\t\t\t\t\troundInWhichElectionCalled = -1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase OK:\n\t\t\t\tcalledElection = false\n\t\t\t\troundInWhichElectionCalled = -1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// If no one replied to my election call after 2 rounds, I am the leader\n\t\tif calledElection && roundNum-roundInWhichElectionCalled >= 2 {\n\t\t\tcalledElection = false\n\t\t\troundInWhichElectionCalled = -1\n\t\t\tfor _, c := range comm {\n\t\t\t\tc <- Message{pid, roundNum, COORDINATOR}\n\t\t\t}\n\t\t}\n\n\t\t// Check if leader is down\n\t\tif len(checkLeader) > 0 {\n\t\t\t<-checkLeader\n\t\t\tnewMessage := Message{pid, roundNum, ALIVE}\n\t\t\tcomm[leader] <- newMessage\n\t\t\twaitingForLeaderReply = true\n\t\t\troundsSinceLeaderReplied = 0\n\t\t}\n\n\t\t// If leader has not replied after checking and 2 rounds have passed\n\t\t// Initiate election\n\t\tif waitingForLeaderReply && roundsSinceLeaderReplied >= 2 {\n\t\t\twaitingForLeaderReply = false\n\t\t\troundsSinceLeaderReplied = 0\n\n\t\t\thasSentMessageToSomeone := false\n\t\t\tif !calledElection {\n\t\t\t\tcalledElection = true\n\t\t\t\troundInWhichElectionCalled = roundNum\n\t\t\t\tfor p, c := range comm {\n\t\t\t\t\tif p > pid {\n\t\t\t\t\t\tc <- Message{pid, roundNum, ELECTION}\n\t\t\t\t\t\thasSentMessageToSomeone = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !hasSentMessageToSomeone {\n\t\t\t\t\tfor _, c := range comm {\n\t\t\t\t\t\tc <- Message{pid, roundNum, COORDINATOR}\n\t\t\t\t\t\tcalledElection = false\n\t\t\t\t\t\troundInWhichElectionCalled = -1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\troundsSinceLeaderReplied++\n\t\tlastRound = roundNum\n\t}\n}",
"func (d *MasterDaemon) becomeLeader() {\n\t// ask listener to stop\n\td.stopFollowerChan <- true\n\n\t// set current state\n\td.currState = \"leader\"\n\n\t// Run the HTTP listener\n\tgo d.runLeader()\n}",
"func (d *MasterDaemon) becomeFollower() {\n\t// ask listener to stop\n\td.stopLeaderChan <- true\n\ttime.Sleep(time.Second)\n\n\t// set current state\n\td.currState = \"follower\"\n\n\t// run follower loop\n\tgo d.runFollower()\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewManagementClient creates a new instance of ManagementClient with the specified values. subscriptionID Azure Subscription ID. credential used to authorize requests. Usually a credential from azidentity. options pass nil to accept the default values.
|
func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error) {
cl, err := arm.NewClient(moduleName+".ManagementClient", moduleVersion, credential, options)
if err != nil {
return nil, err
}
client := &ManagementClient{
subscriptionID: subscriptionID,
internal: cl,
}
return client, nil
}
|
[
"func NewCdnManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *CdnManagementClient {\n\tcp := arm.ClientOptions{}\n\tif options != nil {\n\t\tcp = *options\n\t}\n\tif len(cp.Host) == 0 {\n\t\tcp.Host = arm.AzurePublicCloud\n\t}\n\treturn &CdnManagementClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)}\n}",
"func NewCosmosDBManagementClient(con *arm.Connection, subscriptionID string) *CosmosDBManagementClient {\n\treturn &CosmosDBManagementClient{ep: con.Endpoint(), pl: con.NewPipeline(module, version), subscriptionID: subscriptionID}\n}",
"func ManagementClient(resp string) (*clients.ManagementClient, *httptest.Server) {\n\thandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintln(w, resp)\n\t})\n\tserver := httptest.NewServer(handler)\n\tclient, _ := clients.NewManagementClient(\"localhost\", \"admin\", \"admin\", clients.BasicAuth)\n\tclient.SetBase(server.URL)\n\treturn client, server\n}",
"func (d *DefaultClientFactory) NewManagementMtaClient(host string, rt http.RoundTripper, jar http.CookieJar, tokenFactory baseclient.TokenFactory) mtaclient.MtaClientOperations {\n\tif d.managementMtaClient == nil {\n\t\td.managementMtaClient = mtaclient.NewRetryableManagementMtaRestClient(host, rt, jar, tokenFactory)\n\t}\n\treturn d.managementMtaClient\n}",
"func NewManagement() map[string]interface{} {\n\t// The following are defaults\n\tm := map[string]interface{}{\n\t\t\"ssh\": ManagementSSH{TypeID: \"ssh\", Shutdown: false},\n\t\t\"telnet\": ManagementTelnet{TypeID: \"telnet\", Shutdown: true},\n\t\t\"api\": ManagementAPIHTTP{TypeID: \"http\", Shutdown: true},\n\t}\n\treturn m\n}",
"func GetKeyVaultManagementClientE(subscriptionID string) (*kvmng.VaultsClient, error) {\n\t// Create a keyvault management client\n\tvaultClient, err := CreateKeyVaultManagementClientE(subscriptionID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create an authorizer\n\tauthorizer, err := NewAuthorizer()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Attach authorizer to the client\n\tvaultClient.Authorizer = *authorizer\n\n\treturn vaultClient, nil\n}",
"func NewKmsManagementClientWithConfigurationProvider(configProvider common.ConfigurationProvider, endpoint string) (client KmsManagementClient, err error) {\n\tprovider, err := auth.GetGenericConfigurationProvider(configProvider)\n\tif err != nil {\n\t\treturn client, err\n\t}\n\tbaseClient, e := common.NewClientWithConfig(provider)\n\tif e != nil {\n\t\treturn client, e\n\t}\n\treturn newKmsManagementClientFromBaseClient(baseClient, provider, endpoint)\n}",
"func NewMediaservicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MediaservicesClient {\n\tcp := arm.ClientOptions{}\n\tif options != nil {\n\t\tcp = *options\n\t}\n\tif len(cp.Host) == 0 {\n\t\tcp.Host = arm.AzurePublicCloud\n\t}\n\treturn &MediaservicesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)}\n}",
"func New(configLocation string, logger log.FieldLogger) (*KubeClient, error) {\n\tconfig, err := clientcmd.BuildConfigFromFlags(\"\", configLocation)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclientset, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tapixClientset, err := apixclient.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmattermostClientset, err := mmclient.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &KubeClient{\n\t\t\tconfig: config,\n\t\t\tClientset: clientset,\n\t\t\tMattermostClientset: mattermostClientset,\n\t\t\tApixClientset: apixClientset,\n\t\t\tlogger: logger,\n\t\t},\n\t\tnil\n}",
"func New(ctx context.Context, opts apiv1.Options) (*CloudKMS, error) {\n\tvar cloudOpts []option.ClientOption\n\n\tif opts.URI != \"\" {\n\t\tu, err := uri.ParseWithScheme(Scheme, opts.URI)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif f := u.Get(\"credentials-file\"); f != \"\" {\n\t\t\tcloudOpts = append(cloudOpts, option.WithCredentialsFile(f))\n\t\t}\n\t}\n\n\t// Deprecated way to set configuration parameters.\n\tif opts.CredentialsFile != \"\" {\n\t\tcloudOpts = append(cloudOpts, option.WithCredentialsFile(opts.CredentialsFile))\n\t}\n\n\tclient, err := newKeyManagementClient(ctx, cloudOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &CloudKMS{\n\t\tclient: client,\n\t}, nil\n}",
"func NewManagementGroup(ctx *pulumi.Context,\n\tname string, args *ManagementGroupArgs, opts ...pulumi.ResourceOption) (*ManagementGroup, error) {\n\tif args == nil {\n\t\targs = &ManagementGroupArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource ManagementGroup\n\terr := ctx.RegisterResource(\"azure:managementgroups/managementGroup:ManagementGroup\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func newVirtualMachineScaleSetsClient(subscriptionID string, baseURI string, authorizer autorest.Authorizer) compute.VirtualMachineScaleSetsClient {\n\tc := compute.NewVirtualMachineScaleSetsClientWithBaseURI(baseURI, subscriptionID)\n\tc.Authorizer = authorizer\n\t_ = c.AddToUserAgent(azure.UserAgent()) // intentionally ignore error as it doesn't matter\n\treturn c\n}",
"func NewMockUserManagementApiClient(ctrl *gomock.Controller) *MockUserManagementApiClient {\n\tmock := &MockUserManagementApiClient{ctrl: ctrl}\n\tmock.recorder = &MockUserManagementApiClientMockRecorder{mock}\n\treturn mock\n}",
"func newClient(credentialPath string) (serviceControlClient, error) {\n\ttoken, err := getRawTokenBytes(credentialPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx := context.WithValue(context.Background(), oauth2.HTTPClient, &http.Client{\n\t\tTransport: http.DefaultTransport})\n\n\ttokenSrc, err := getTokenSource(ctx, token)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thttpClient := oauth2.NewClient(ctx, tokenSrc)\n\tif httpClient == nil {\n\t\treturn nil, nil\n\t}\n\n\tsvcClient, err := sc.New(httpClient)\n\tif err != nil {\n\t\treturn nil, errors.New(\"fail to create ServiceControl client\")\n\t}\n\n\treturn &client{svcClient}, nil\n}",
"func NewClient(o *common.ClientOptions) *Client {\n\tApplicationGroupsClient := desktopvirtualization.NewApplicationGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)\n\to.ConfigureClient(&ApplicationGroupsClient.Client, o.ResourceManagerAuthorizer)\n\n\tDesktopsClient := desktopvirtualization.NewDesktopsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)\n\to.ConfigureClient(&DesktopsClient.Client, o.ResourceManagerAuthorizer)\n\n\tHostPoolsClient := desktopvirtualization.NewHostPoolsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)\n\to.ConfigureClient(&HostPoolsClient.Client, o.ResourceManagerAuthorizer)\n\n\tOperationsClient := desktopvirtualization.NewOperationsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)\n\to.ConfigureClient(&OperationsClient.Client, o.ResourceManagerAuthorizer)\n\n\tSessionHostsClient := desktopvirtualization.NewSessionHostsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)\n\to.ConfigureClient(&SessionHostsClient.Client, o.ResourceManagerAuthorizer)\n\n\tWorkspacesClient := desktopvirtualization.NewWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)\n\to.ConfigureClient(&WorkspacesClient.Client, o.ResourceManagerAuthorizer)\n\n\treturn &Client{\n\t\tApplicationGroupsClient: &ApplicationGroupsClient,\n\t\tDesktopsClient: &DesktopsClient,\n\t\tHostPoolsClient: &HostPoolsClient,\n\t\tOperationsClient: &OperationsClient,\n\t\tSessionHostsClient: &SessionHostsClient,\n\t\tWorkspacesClient: &WorkspacesClient,\n\t}\n}",
"func newVirtualMachineScaleSetVMsClient(subscriptionID string, baseURI string, authorizer autorest.Authorizer) compute.VirtualMachineScaleSetVMsClient {\n\tc := compute.NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI, subscriptionID)\n\tc.Authorizer = authorizer\n\t_ = c.AddToUserAgent(azure.UserAgent()) // intentionally ignore error as it doesn't matter\n\treturn c\n}",
"func NewCostManagement(ctx *pulumi.Context,\n\tname string, args *CostManagementArgs, opts ...pulumi.ResourceOption) (*CostManagement, error) {\n\tif args == nil {\n\t\targs = &CostManagementArgs{}\n\t}\n\targs.ApiVersion = pulumi.StringPtr(\"cost-mgmt-data.openshift.io/v1alpha1\")\n\targs.Kind = pulumi.StringPtr(\"CostManagementData\")\n\tvar resource CostManagement\n\terr := ctx.RegisterResource(\"kubernetes:cost-mgmt.openshift.io/v1alpha1:CostManagement\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func (s *Wrapper) createClient() (*cloudkms.KeyManagementClient, error) {\n\tclient, err := cloudkms.NewKeyManagementClient(context.Background(),\n\t\toption.WithCredentialsFile(s.credsPath),\n\t\toption.WithUserAgent(s.userAgent),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create KMS client: %w\", err)\n\t}\n\n\treturn client, nil\n}",
"func newResourceSkusClient(subscriptionID string, baseURI string, authorizer autorest.Authorizer) compute.ResourceSkusClient {\n\tc := compute.NewResourceSkusClientWithBaseURI(baseURI, subscriptionID)\n\tc.Authorizer = authorizer\n\t_ = c.AddToUserAgent(azure.UserAgent()) // intentionally ignore error as it doesn't matter\n\treturn c\n}",
"func NewClientFromEnvironment(setStorageClient bool) (*Client, error) {\n\tauthorizer, err := azureclient.NewAuthorizerFromEnvironment()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcfg := &cloudprovider.Config{\n\t\tTenantID: os.Getenv(\"AZURE_TENANT_ID\"),\n\t\tSubscriptionID: os.Getenv(\"AZURE_SUBSCRIPTION_ID\"),\n\t\tAadClientID: os.Getenv(\"AZURE_CLIENT_ID\"),\n\t\tAadClientSecret: os.Getenv(\"AZURE_CLIENT_SECRET\"),\n\t\tResourceGroup: os.Getenv(\"RESOURCEGROUP\"),\n\t\tLocation: os.Getenv(\"AZURE_REGION\"),\n\t}\n\tsubscriptionID := cfg.SubscriptionID\n\n\tvar storageClient storage.BlobStorageClient\n\tif setStorageClient {\n\t\tstorageClient, err = configblob.GetService(context.Background(), cfg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tvar rpURL string\n\tfocus := config.GinkgoConfig.FocusString\n\tswitch {\n\tcase adminRpFocus.match(focus), fakeRpFocus.match(focus):\n\t\tfmt.Println(\"configuring the fake resource provider\")\n\t\trpURL = fmt.Sprintf(\"http://%s\", shared.LocalHttpAddr)\n\tcase realRpFocus.match(focus):\n\t\tfmt.Println(\"configuring the real resource provider\")\n\t\trpURL = externalapi.DefaultBaseURI\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"invalid focus %q - need to -ginkgo.focus=\\\\[Admin\\\\], -ginkgo.focus=\\\\[Fake\\\\] or -ginkgo.focus=\\\\[Real\\\\]\", config.GinkgoConfig.FocusString))\n\t}\n\n\trpc := externalapi.NewOpenShiftManagedClustersClientWithBaseURI(rpURL, subscriptionID)\n\trpc.Authorizer = authorizer\n\n\trpcAdmin := adminapi.NewOpenShiftManagedClustersClientWithBaseURI(rpURL, subscriptionID)\n\trpcAdmin.Authorizer = authorizer\n\n\treturn &Client{\n\t\tAccounts: azureclient.NewAccountsClient(subscriptionID, authorizer, nil),\n\t\tApplications: azureclient.NewApplicationsClient(subscriptionID, authorizer, nil),\n\t\tBlobStorage: storageClient,\n\t\tOpenShiftManagedClusters: rpc,\n\t\tOpenShiftManagedClustersAdmin: rpcAdmin,\n\t\tVirtualMachineScaleSets: azureclient.NewVirtualMachineScaleSetsClient(subscriptionID, authorizer, nil),\n\t\tVirtualMachineScaleSetExtensions: azureclient.NewVirtualMachineScaleSetExtensionsClient(subscriptionID, authorizer, nil),\n\t\tVirtualMachineScaleSetVMs: azureclient.NewVirtualMachineScaleSetVMsClient(subscriptionID, authorizer, nil),\n\t\tResources: azureclient.NewResourcesClient(subscriptionID, authorizer, nil),\n\t\tVirtualNetworks: azureclient.NewVirtualNetworkClient(subscriptionID, authorizer, nil),\n\t\tVirtualNetworksPeerings: azureclient.NewVirtualNetworksPeeringsClient(subscriptionID, authorizer, nil),\n\t\tGroups: azureclient.NewGroupsClient(subscriptionID, authorizer, nil),\n\t}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
checkEndpointNameAvailabilityCreateRequest creates the CheckEndpointNameAvailability request.
|
func (client *ManagementClient) checkEndpointNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, options *ManagementClientCheckEndpointNameAvailabilityOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
if err != nil {
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2021-06-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput)
}
|
[
"func (client *VaultsClient) checkNameAvailabilityCreateRequest(ctx context.Context, vaultName VaultCheckNameAvailabilityParameters, options *VaultsCheckNameAvailabilityOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability\"\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Telemetry(telemetryInfo)\n\tquery := req.URL.Query()\n\tquery.Set(\"api-version\", \"2019-09-01\")\n\treq.URL.RawQuery = query.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, req.MarshalAsJSON(vaultName)\n}",
"func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx context.Context, location string, domainNameLabel string, options *ManagementClientCheckDNSNameAvailabilityOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability\"\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"parameter location cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{location}\", url.PathEscape(location))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"domainNameLabel\", domainNameLabel)\n\treqQP.Set(\"api-version\", \"2023-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}",
"func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, options *ManagementClientCheckNameAvailabilityWithSubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, checkNameAvailabilityInput)\n}",
"func (client *CdnManagementClient) checkNameAvailabilityWithSubscriptionCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, options *CdnManagementClientCheckNameAvailabilityWithSubscriptionOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-09-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, checkNameAvailabilityInput)\n}",
"func (client *ResourceClient) checkFilePathAvailabilityCreateRequest(ctx context.Context, location string, body FilePathAvailabilityRequest, options *ResourceClientCheckFilePathAvailabilityOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"parameter location cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{location}\", url.PathEscape(location))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, body)\n}",
"func (client *ResourceClient) checkQuotaAvailabilityCreateRequest(ctx context.Context, location string, body QuotaAvailabilityRequest, options *ResourceClientCheckQuotaAvailabilityOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"parameter location cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{location}\", url.PathEscape(location))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-11-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, body)\n}",
"func NewCheckAvailabilityEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint {\n\treturn func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\tp := req.(*CheckAvailabilityPayload)\n\t\tvar err error\n\t\tsc := security.BasicScheme{\n\t\t\tName: \"basic\",\n\t\t\tScopes: []string{},\n\t\t\tRequiredScopes: []string{},\n\t\t}\n\t\tctx, err = authBasicFn(ctx, p.Username, p.Password, &sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn s.CheckAvailability(ctx, p)\n\t}\n}",
"func CreateCheckInstanceExistRequest() (request *CheckInstanceExistRequest) {\n\trequest = &CheckInstanceExistRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Rds\", \"2014-08-15\", \"CheckInstanceExist\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}",
"func CreateDescribeAvailabilityZonesRequest() (request *DescribeAvailabilityZonesRequest) {\n\trequest = &DescribeAvailabilityZonesRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Dds\", \"2015-12-01\", \"DescribeAvailabilityZones\", \"dds\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}",
"func (client *ManagementClient) checkDomainAvailabilityCreateRequest(ctx context.Context, parameters CheckDomainAvailabilityParameter, options *ManagementClientCheckDomainAvailabilityOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, parameters)\n}",
"func CreateDescribeCheckWarningsRequest() (request *DescribeCheckWarningsRequest) {\n\trequest = &DescribeCheckWarningsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"aegis\", \"2016-11-11\", \"DescribeCheckWarnings\", \"vipaegis\", \"openAPI\")\n\treturn\n}",
"func (client *ManagementClient) checkSKUAvailabilityCreateRequest(ctx context.Context, location string, parameters CheckSKUAvailabilityParameter, options *ManagementClientCheckSKUAvailabilityOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"parameter location cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{location}\", url.PathEscape(location))\n\treq, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, parameters)\n}",
"func (client KustoPoolsClient) CheckNameAvailability(ctx context.Context, location string, kustoPoolName KustoPoolCheckNameRequest) (result CheckNameResult, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/KustoPoolsClient.CheckNameAvailability\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: client.SubscriptionID,\n\t\t\tConstraints: []validation.Constraint{{Target: \"client.SubscriptionID\", Name: validation.MinLength, Rule: 1, Chain: nil}}},\n\t\t{TargetValue: location,\n\t\t\tConstraints: []validation.Constraint{{Target: \"location\", Name: validation.MinLength, Rule: 1, Chain: nil}}},\n\t\t{TargetValue: kustoPoolName,\n\t\t\tConstraints: []validation.Constraint{{Target: \"kustoPoolName.Name\", Name: validation.Null, Rule: true, Chain: nil},\n\t\t\t\t{Target: \"kustoPoolName.Type\", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {\n\t\treturn result, validation.NewError(\"synapse.KustoPoolsClient\", \"CheckNameAvailability\", err.Error())\n\t}\n\n\treq, err := client.CheckNameAvailabilityPreparer(ctx, location, kustoPoolName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"synapse.KustoPoolsClient\", \"CheckNameAvailability\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.CheckNameAvailabilitySender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"synapse.KustoPoolsClient\", \"CheckNameAvailability\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CheckNameAvailabilityResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"synapse.KustoPoolsClient\", \"CheckNameAvailability\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}",
"func (client *PrivateEndpointConnectionClient) getByNameCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientGetByNameOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif serviceName == \"\" {\n\t\treturn nil, errors.New(\"parameter serviceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serviceName}\", url.PathEscape(serviceName))\n\tif privateEndpointConnectionName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateEndpointConnectionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateEndpointConnectionName}\", url.PathEscape(privateEndpointConnectionName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2022-08-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}",
"func CreateDescribeLoadBalancerSpecRequest() (request *DescribeLoadBalancerSpecRequest) {\n\trequest = &DescribeLoadBalancerSpecRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Ens\", \"2017-11-10\", \"DescribeLoadBalancerSpec\", \"ens\", \"openAPI\")\n\trequest.Method = requests.GET\n\treturn\n}",
"func CreateDescribeFleetsRequest() (request *DescribeFleetsRequest) {\n\trequest = &DescribeFleetsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Ecs\", \"2014-05-26\", \"DescribeFleets\", \"ecs\", \"openAPI\")\n\treturn\n}",
"func CreateDescribeEngineVersionRequest() (request *DescribeEngineVersionRequest) {\n\trequest = &DescribeEngineVersionRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"R-kvstore\", \"2015-01-01\", \"DescribeEngineVersion\", \"redisa\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}",
"func CreateInvokeServiceRequest() (request *InvokeServiceRequest) {\n\trequest = &InvokeServiceRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"industry-brain\", \"2019-06-29\", \"InvokeService\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}",
"func CreateCreateLoadBalancerRequest() (request *CreateLoadBalancerRequest) {\n\trequest = &CreateLoadBalancerRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Ens\", \"2017-11-10\", \"CreateLoadBalancer\", \"ens\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.