diff --git a/app/app.go b/app/app.go index ac4a6ef0..19af3730 100644 --- a/app/app.go +++ b/app/app.go @@ -484,7 +484,7 @@ func NewApp( evmBankKeeper := evmutilkeeper.NewEvmBankKeeper(app.evmutilKeeper, app.bankKeeper, app.accountKeeper) // dasigners keeper - app.dasignersKeeper = dasignerskeeper.NewKeeper(keys[dasignerstypes.StoreKey], appCodec, app.stakingKeeper) + app.dasignersKeeper = dasignerskeeper.NewKeeper(keys[dasignerstypes.StoreKey], appCodec, app.stakingKeeper, govAuthAddrStr) // precopmiles precompiles := make(map[common.Address]vm.PrecompiledContract) daSignersPrecompile, err := dasignersprecompile.NewDASignersPrecompile(app.dasignersKeeper) diff --git a/precompiles/dasigners/IDASigners.abi b/precompiles/dasigners/IDASigners.abi index a718bb42..45b27da3 100644 --- a/precompiles/dasigners/IDASigners.abi +++ b/precompiles/dasigners/IDASigners.abi @@ -48,6 +48,46 @@ "name": "NewSigner", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensPerVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVotesPerSigner", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxQuorums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epochBlocks", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "encodedSlices", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct IDASigners.Params", + "name": "params", + "type": "tuple" + } + ], + "name": "ParamsUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -268,6 +308,46 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "params", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensPerVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVotesPerSigner", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxQuorums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epochBlocks", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "encodedSlices", + "type": "uint256" + } + ], + "internalType": "struct IDASigners.Params", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/precompiles/dasigners/contract.go b/precompiles/dasigners/contract.go index b5315608..3d0fd48a 100644 --- a/precompiles/dasigners/contract.go +++ b/precompiles/dasigners/contract.go @@ -30,7 +30,7 @@ var ( // DASignersMetaData contains all meta data concerning the DASigners contract. var DASignersMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structIDASigners.Params\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"ParamsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"structIDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // DASignersABI is the input ABI used to generate the binding from. @@ -384,6 +384,37 @@ func (_DASigners *DASignersCallerSession) IsSigner(_account common.Address) (boo return _DASigners.Contract.IsSigner(&_DASigners.CallOpts, _account) } +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns((uint256,uint256,uint256,uint256,uint256)) +func (_DASigners *DASignersCaller) Params(opts *bind.CallOpts) (IDASignersParams, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "params") + + if err != nil { + return *new(IDASignersParams), err + } + + out0 := *abi.ConvertType(out[0], new(IDASignersParams)).(*IDASignersParams) + + return out0, err + +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns((uint256,uint256,uint256,uint256,uint256)) +func (_DASigners *DASignersSession) Params() (IDASignersParams, error) { + return _DASigners.Contract.Params(&_DASigners.CallOpts) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns((uint256,uint256,uint256,uint256,uint256)) +func (_DASigners *DASignersCallerSession) Params() (IDASignersParams, error) { + return _DASigners.Contract.Params(&_DASigners.CallOpts) +} + // QuorumCount is a free data retrieval call binding the contract method 0x5ecba503. // // Solidity: function quorumCount(uint256 _epoch) view returns(uint256) @@ -655,6 +686,140 @@ func (_DASigners *DASignersFilterer) ParseNewSigner(log types.Log) (*DASignersNe return event, nil } +// DASignersParamsUpdatedIterator is returned from FilterParamsUpdated and is used to iterate over the raw logs and unpacked data for ParamsUpdated events raised by the DASigners contract. +type DASignersParamsUpdatedIterator struct { + Event *DASignersParamsUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *DASignersParamsUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DASignersParamsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DASignersParamsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DASignersParamsUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DASignersParamsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DASignersParamsUpdated represents a ParamsUpdated event raised by the DASigners contract. +type DASignersParamsUpdated struct { + Params IDASignersParams + Raw types.Log // Blockchain specific contextual infos +} + +// FilterParamsUpdated is a free log retrieval operation binding the contract event 0x68567739bd4f190697d9305da326fa28ef711443d08a390a05008a8afe822103. +// +// Solidity: event ParamsUpdated((uint256,uint256,uint256,uint256,uint256) params) +func (_DASigners *DASignersFilterer) FilterParamsUpdated(opts *bind.FilterOpts) (*DASignersParamsUpdatedIterator, error) { + + logs, sub, err := _DASigners.contract.FilterLogs(opts, "ParamsUpdated") + if err != nil { + return nil, err + } + return &DASignersParamsUpdatedIterator{contract: _DASigners.contract, event: "ParamsUpdated", logs: logs, sub: sub}, nil +} + +// WatchParamsUpdated is a free log subscription operation binding the contract event 0x68567739bd4f190697d9305da326fa28ef711443d08a390a05008a8afe822103. +// +// Solidity: event ParamsUpdated((uint256,uint256,uint256,uint256,uint256) params) +func (_DASigners *DASignersFilterer) WatchParamsUpdated(opts *bind.WatchOpts, sink chan<- *DASignersParamsUpdated) (event.Subscription, error) { + + logs, sub, err := _DASigners.contract.WatchLogs(opts, "ParamsUpdated") + 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(DASignersParamsUpdated) + if err := _DASigners.contract.UnpackLog(event, "ParamsUpdated", 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 +} + +// ParseParamsUpdated is a log parse operation binding the contract event 0x68567739bd4f190697d9305da326fa28ef711443d08a390a05008a8afe822103. +// +// Solidity: event ParamsUpdated((uint256,uint256,uint256,uint256,uint256) params) +func (_DASigners *DASignersFilterer) ParseParamsUpdated(log types.Log) (*DASignersParamsUpdated, error) { + event := new(DASignersParamsUpdated) + if err := _DASigners.contract.UnpackLog(event, "ParamsUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // DASignersSocketUpdatedIterator is returned from FilterSocketUpdated and is used to iterate over the raw logs and unpacked data for SocketUpdated events raised by the DASigners contract. type DASignersSocketUpdatedIterator struct { Event *DASignersSocketUpdated // Event containing the contract specifics and raw log diff --git a/precompiles/dasigners/types.go b/precompiles/dasigners/types.go index 86b668f2..1acf2251 100644 --- a/precompiles/dasigners/types.go +++ b/precompiles/dasigners/types.go @@ -27,6 +27,14 @@ type IDASignersSignerDetail = struct { PkG2 BN254G2Point "json:\"pkG2\"" } +type IDASignersParams struct { + TokensPerVote *big.Int "json:\"tokensPerVote\"" + MaxVotesPerSigner *big.Int "json:\"maxVotesPerSigner\"" + MaxQuorums *big.Int "json:\"maxQuorums\"" + EpochBlocks *big.Int "json:\"epochBlocks\"" + EncodedSlices *big.Int "json:\"encodedSlices\"" +} + func NewBN254G1Point(b []byte) BN254G1Point { return BN254G1Point{ X: new(big.Int).SetBytes(b[:32]), diff --git a/proto/zgc/dasigners/v1/query.proto b/proto/zgc/dasigners/v1/query.proto index c9091370..bda1283a 100644 --- a/proto/zgc/dasigners/v1/query.proto +++ b/proto/zgc/dasigners/v1/query.proto @@ -7,12 +7,16 @@ import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "zgc/dasigners/v1/dasigners.proto"; +import "zgc/dasigners/v1/genesis.proto"; option go_package = "github.com/0glabs/0g-chain/x/dasigners/v1/types"; option (gogoproto.goproto_getters_all) = false; // Query defines the gRPC querier service for the dasigners module service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/0g/dasigners/v1/params"; + } rpc EpochNumber(QueryEpochNumberRequest) returns (QueryEpochNumberResponse) { option (google.api.http).get = "/0g/dasigners/v1/epoch-number"; } @@ -33,6 +37,12 @@ service Query { } } +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1; +} + message QuerySignerRequest { repeated string accounts = 1; } diff --git a/proto/zgc/dasigners/v1/tx.proto b/proto/zgc/dasigners/v1/tx.proto index 43651a81..19753c88 100644 --- a/proto/zgc/dasigners/v1/tx.proto +++ b/proto/zgc/dasigners/v1/tx.proto @@ -5,17 +5,26 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "zgc/dasigners/v1/dasigners.proto"; +import "zgc/dasigners/v1/genesis.proto"; option go_package = "github.com/0glabs/0g-chain/x/dasigners/v1/types"; option (gogoproto.goproto_getters_all) = false; // Msg defines the dasigners Msg service service Msg { + rpc ChangeParams(MsgChangeParams) returns (MsgChangeParamsResponse); rpc RegisterSigner(MsgRegisterSigner) returns (MsgRegisterSignerResponse); rpc UpdateSocket(MsgUpdateSocket) returns (MsgUpdateSocketResponse); rpc RegisterNextEpoch(MsgRegisterNextEpoch) returns (MsgRegisterNextEpochResponse); } +message MsgChangeParams { + string authority = 1; + Params params = 2; +} + +message MsgChangeParamsResponse {} + message MsgRegisterSigner { Signer signer = 1; bytes signature = 2; diff --git a/x/dasigners/v1/keeper/grpc_query.go b/x/dasigners/v1/keeper/grpc_query.go index d76d0ae9..cca77779 100644 --- a/x/dasigners/v1/keeper/grpc_query.go +++ b/x/dasigners/v1/keeper/grpc_query.go @@ -11,6 +11,17 @@ import ( var _ types.QueryServer = Keeper{} +func (k Keeper) Params( + c context.Context, + request *types.QueryParamsRequest, +) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := k.GetParams(ctx) + return &types.QueryParamsResponse{ + Params: ¶ms, + }, nil +} + func (k Keeper) Signer( c context.Context, request *types.QuerySignerRequest, diff --git a/x/dasigners/v1/keeper/keeper.go b/x/dasigners/v1/keeper/keeper.go index e241fcca..047d1813 100644 --- a/x/dasigners/v1/keeper/keeper.go +++ b/x/dasigners/v1/keeper/keeper.go @@ -22,6 +22,7 @@ type Keeper struct { storeKey storetypes.StoreKey cdc codec.BinaryCodec stakingKeeper types.StakingKeeper + authority string // the address capable of changing signers params. Should be the gov module account } // NewKeeper creates a new das Keeper instance @@ -29,11 +30,13 @@ func NewKeeper( storeKey storetypes.StoreKey, cdc codec.BinaryCodec, stakingKeeper types.StakingKeeper, + authority string, ) Keeper { return Keeper{ storeKey: storeKey, cdc: cdc, stakingKeeper: stakingKeeper, + authority: authority, } } diff --git a/x/dasigners/v1/keeper/msg_server.go b/x/dasigners/v1/keeper/msg_server.go index b0a1382a..0132ff22 100644 --- a/x/dasigners/v1/keeper/msg_server.go +++ b/x/dasigners/v1/keeper/msg_server.go @@ -3,15 +3,28 @@ package keeper import ( "context" + errorsmod "cosmossdk.io/errors" "github.com/0glabs/0g-chain/crypto/bn254util" "github.com/0glabs/0g-chain/x/dasigners/v1/types" sdk "github.com/cosmos/cosmos-sdk/types" + gov "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ethereum/go-ethereum/common" etherminttypes "github.com/evmos/ethermint/types" ) var _ types.MsgServer = &Keeper{} +func (k Keeper) ChangeParams(goCtx context.Context, msg *types.MsgChangeParams) (*types.MsgChangeParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // validate authority + if k.authority != msg.Authority { + return nil, errorsmod.Wrapf(gov.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority) + } + // save params + k.SetParams(ctx, *msg.Params) + return &types.MsgChangeParamsResponse{}, nil +} + func (k Keeper) RegisterSigner(goCtx context.Context, msg *types.MsgRegisterSigner) (*types.MsgRegisterSignerResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // validate sender diff --git a/x/dasigners/v1/types/msg.go b/x/dasigners/v1/types/msg.go index 6c234f3a..c4d1c430 100644 --- a/x/dasigners/v1/types/msg.go +++ b/x/dasigners/v1/types/msg.go @@ -4,14 +4,16 @@ import ( "encoding/hex" fmt "fmt" + errorsmod "cosmossdk.io/errors" + "github.com/0glabs/0g-chain/crypto/bn254util" sdk "github.com/cosmos/cosmos-sdk/types" ) -var _, _, _ sdk.Msg = &MsgRegisterSigner{}, &MsgUpdateSocket{}, &MsgRegisterNextEpoch{} +var _, _, _, _ sdk.Msg = &MsgRegisterSigner{}, &MsgUpdateSocket{}, &MsgRegisterNextEpoch{}, &MsgChangeParams{} -// GetSigners returns the expected signers for a MsgRegister message. +// GetSigners returns the expected signers for a MsgRegisterSigner message. func (msg *MsgRegisterSigner) GetSigners() []sdk.AccAddress { valAddr, err := sdk.ValAddressFromHex(msg.Signer.Account) if err != nil { @@ -40,7 +42,7 @@ func (msg MsgRegisterSigner) GetSignBytes() []byte { return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) } -// GetSigners returns the expected signers for a MsgVote message. +// GetSigners returns the expected signers for a MsgUpdateSocket message. func (msg *MsgUpdateSocket) GetSigners() []sdk.AccAddress { valAddr, err := sdk.ValAddressFromHex(msg.Account) if err != nil { @@ -66,7 +68,7 @@ func (msg MsgUpdateSocket) GetSignBytes() []byte { return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) } -// GetSigners returns the expected signers for a MsgVote message. +// GetSigners returns the expected signers for a MsgRegisterNextEpoch message. func (msg *MsgRegisterNextEpoch) GetSigners() []sdk.AccAddress { valAddr, err := sdk.ValAddressFromHex(msg.Account) if err != nil { @@ -94,3 +96,22 @@ func (msg *MsgRegisterNextEpoch) ValidateBasic() error { func (msg MsgRegisterNextEpoch) GetSignBytes() []byte { return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) } + +// GetSigners returns the expected signers for a MsgSetParams message. +func (msg *MsgChangeParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check of the provided data +func (msg *MsgChangeParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority") + } + + if err := msg.Params.Validate(); err != nil { + return errorsmod.Wrap(err, "params") + } + + return nil +} diff --git a/x/dasigners/v1/types/params.go b/x/dasigners/v1/types/params.go new file mode 100644 index 00000000..a8c6fd96 --- /dev/null +++ b/x/dasigners/v1/types/params.go @@ -0,0 +1,5 @@ +package types + +func (p *Params) Validate() error { + return nil +} diff --git a/x/dasigners/v1/types/query.pb.go b/x/dasigners/v1/types/query.pb.go index ce49be01..b77de036 100644 --- a/x/dasigners/v1/types/query.pb.go +++ b/x/dasigners/v1/types/query.pb.go @@ -32,6 +32,79 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_991a610b84b5964c, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +type QueryParamsResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_991a610b84b5964c, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + type QuerySignerRequest struct { Accounts []string `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` } @@ -40,7 +113,7 @@ func (m *QuerySignerRequest) Reset() { *m = QuerySignerRequest{} } func (m *QuerySignerRequest) String() string { return proto.CompactTextString(m) } func (*QuerySignerRequest) ProtoMessage() {} func (*QuerySignerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{0} + return fileDescriptor_991a610b84b5964c, []int{2} } func (m *QuerySignerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +150,7 @@ func (m *QuerySignerResponse) Reset() { *m = QuerySignerResponse{} } func (m *QuerySignerResponse) String() string { return proto.CompactTextString(m) } func (*QuerySignerResponse) ProtoMessage() {} func (*QuerySignerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{1} + return fileDescriptor_991a610b84b5964c, []int{3} } func (m *QuerySignerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -113,7 +186,7 @@ func (m *QueryEpochNumberRequest) Reset() { *m = QueryEpochNumberRequest func (m *QueryEpochNumberRequest) String() string { return proto.CompactTextString(m) } func (*QueryEpochNumberRequest) ProtoMessage() {} func (*QueryEpochNumberRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{2} + return fileDescriptor_991a610b84b5964c, []int{4} } func (m *QueryEpochNumberRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -150,7 +223,7 @@ func (m *QueryEpochNumberResponse) Reset() { *m = QueryEpochNumberRespon func (m *QueryEpochNumberResponse) String() string { return proto.CompactTextString(m) } func (*QueryEpochNumberResponse) ProtoMessage() {} func (*QueryEpochNumberResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{3} + return fileDescriptor_991a610b84b5964c, []int{5} } func (m *QueryEpochNumberResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -187,7 +260,7 @@ func (m *QueryQuorumCountRequest) Reset() { *m = QueryQuorumCountRequest func (m *QueryQuorumCountRequest) String() string { return proto.CompactTextString(m) } func (*QueryQuorumCountRequest) ProtoMessage() {} func (*QueryQuorumCountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{4} + return fileDescriptor_991a610b84b5964c, []int{6} } func (m *QueryQuorumCountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -224,7 +297,7 @@ func (m *QueryQuorumCountResponse) Reset() { *m = QueryQuorumCountRespon func (m *QueryQuorumCountResponse) String() string { return proto.CompactTextString(m) } func (*QueryQuorumCountResponse) ProtoMessage() {} func (*QueryQuorumCountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{5} + return fileDescriptor_991a610b84b5964c, []int{7} } func (m *QueryQuorumCountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -262,7 +335,7 @@ func (m *QueryEpochQuorumRequest) Reset() { *m = QueryEpochQuorumRequest func (m *QueryEpochQuorumRequest) String() string { return proto.CompactTextString(m) } func (*QueryEpochQuorumRequest) ProtoMessage() {} func (*QueryEpochQuorumRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{6} + return fileDescriptor_991a610b84b5964c, []int{8} } func (m *QueryEpochQuorumRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -299,7 +372,7 @@ func (m *QueryEpochQuorumResponse) Reset() { *m = QueryEpochQuorumRespon func (m *QueryEpochQuorumResponse) String() string { return proto.CompactTextString(m) } func (*QueryEpochQuorumResponse) ProtoMessage() {} func (*QueryEpochQuorumResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{7} + return fileDescriptor_991a610b84b5964c, []int{9} } func (m *QueryEpochQuorumResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -338,7 +411,7 @@ func (m *QueryEpochQuorumRowRequest) Reset() { *m = QueryEpochQuorumRowR func (m *QueryEpochQuorumRowRequest) String() string { return proto.CompactTextString(m) } func (*QueryEpochQuorumRowRequest) ProtoMessage() {} func (*QueryEpochQuorumRowRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{8} + return fileDescriptor_991a610b84b5964c, []int{10} } func (m *QueryEpochQuorumRowRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -375,7 +448,7 @@ func (m *QueryEpochQuorumRowResponse) Reset() { *m = QueryEpochQuorumRow func (m *QueryEpochQuorumRowResponse) String() string { return proto.CompactTextString(m) } func (*QueryEpochQuorumRowResponse) ProtoMessage() {} func (*QueryEpochQuorumRowResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{9} + return fileDescriptor_991a610b84b5964c, []int{11} } func (m *QueryEpochQuorumRowResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -414,7 +487,7 @@ func (m *QueryAggregatePubkeyG1Request) Reset() { *m = QueryAggregatePub func (m *QueryAggregatePubkeyG1Request) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePubkeyG1Request) ProtoMessage() {} func (*QueryAggregatePubkeyG1Request) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{10} + return fileDescriptor_991a610b84b5964c, []int{12} } func (m *QueryAggregatePubkeyG1Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -453,7 +526,7 @@ func (m *QueryAggregatePubkeyG1Response) Reset() { *m = QueryAggregatePu func (m *QueryAggregatePubkeyG1Response) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePubkeyG1Response) ProtoMessage() {} func (*QueryAggregatePubkeyG1Response) Descriptor() ([]byte, []int) { - return fileDescriptor_991a610b84b5964c, []int{11} + return fileDescriptor_991a610b84b5964c, []int{13} } func (m *QueryAggregatePubkeyG1Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,6 +556,8 @@ func (m *QueryAggregatePubkeyG1Response) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAggregatePubkeyG1Response proto.InternalMessageInfo func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "zgc.dasigners.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "zgc.dasigners.v1.QueryParamsResponse") proto.RegisterType((*QuerySignerRequest)(nil), "zgc.dasigners.v1.QuerySignerRequest") proto.RegisterType((*QuerySignerResponse)(nil), "zgc.dasigners.v1.QuerySignerResponse") proto.RegisterType((*QueryEpochNumberRequest)(nil), "zgc.dasigners.v1.QueryEpochNumberRequest") @@ -500,54 +575,57 @@ func init() { func init() { proto.RegisterFile("zgc/dasigners/v1/query.proto", fileDescriptor_991a610b84b5964c) } var fileDescriptor_991a610b84b5964c = []byte{ - // 737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcb, 0x4e, 0xdb, 0x4a, - 0x18, 0xc7, 0x63, 0x2e, 0x11, 0x0c, 0x70, 0x04, 0x03, 0x3a, 0x24, 0x06, 0x4c, 0x30, 0x70, 0x14, - 0x8e, 0x48, 0x9c, 0x50, 0x75, 0xd7, 0x2e, 0x4a, 0x55, 0x21, 0xa4, 0xb6, 0x2a, 0xee, 0xaa, 0xdd, - 0x44, 0x63, 0x67, 0x3a, 0xb1, 0x8a, 0x3d, 0x8e, 0x3d, 0x26, 0x84, 0x65, 0xd5, 0x5d, 0x37, 0x95, - 0xba, 0xe9, 0x03, 0xf4, 0x61, 0x58, 0x22, 0x75, 0xd3, 0x65, 0x0b, 0xdd, 0xf5, 0x25, 0x2a, 0xcf, - 0x4c, 0x2e, 0xc6, 0x49, 0xc8, 0x82, 0x9d, 0xe7, 0xbb, 0xfe, 0xbe, 0xcf, 0xf3, 0xb7, 0xc1, 0xfa, - 0x05, 0xb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, 0x33, 0x6f, - 0x2e, 0xa1, 0xdb, 0x79, 0x70, 0x05, 0x4c, 0x33, 0xca, 0xd0, 0xa9, 0xe4, 0x11, 0x07, 0xb8, 0x08, - 0x26, 0x1b, 0x0e, 0xe3, 0x08, 0x53, 0x66, 0xfc, 0x78, 0xf0, 0x27, 0x0b, 0xa6, 0x79, 0x6b, 0xf8, - 0x49, 0x01, 0x73, 0x7d, 0xea, 0x80, 0x7b, 0x83, 0x5e, 0xf7, 0x40, 0x71, 0xa9, 0xff, 0x8f, 0x13, - 0x2a, 0x06, 0xd1, 0x77, 0x3f, 0x7c, 0xff, 0xfd, 0x65, 0x62, 0x13, 0x6e, 0x18, 0x15, 0x92, 0xfc, - 0x90, 0xf0, 0x95, 0x96, 0xc4, 0x9a, 0x39, 0x4d, 0x9f, 0x5c, 0x86, 0xd2, 0xa4, 0x05, 0x39, 0x94, - 0x66, 0x80, 0xfa, 0x46, 0xd0, 0x88, 0xf7, 0x53, 0xe2, 0xa2, 0xec, 0xed, 0x46, 0xd4, 0x18, 0xbd, - 0x9b, 0x84, 0x42, 0x47, 0xef, 0x26, 0xa9, 0xb8, 0x3b, 0x77, 0x23, 0x98, 0xe0, 0x57, 0x05, 0xfc, - 0x93, 0xbc, 0xe7, 0x70, 0x7f, 0x8c, 0x2e, 0x5d, 0x25, 0xaa, 0xa5, 0x31, 0xa3, 0x25, 0xd6, 0x1e, - 0xc7, 0xda, 0x86, 0x5b, 0x23, 0xb1, 0x4a, 0x01, 0x6d, 0xc1, 0x6f, 0x0a, 0x58, 0x4a, 0x5d, 0x62, - 0x68, 0x0c, 0xe9, 0x37, 0x4c, 0x74, 0x6a, 0x65, 0xfc, 0x04, 0xc9, 0xb8, 0xcf, 0x19, 0xff, 0x83, - 0x3b, 0x29, 0xc6, 0xae, 0x36, 0x4a, 0x42, 0x36, 0x25, 0x52, 0x85, 0x67, 0x20, 0x2b, 0x7e, 0x1d, - 0x70, 0x67, 0x48, 0xa7, 0xc4, 0xdf, 0x4b, 0xdd, 0xbd, 0x23, 0x4a, 0x42, 0x6c, 0x72, 0x88, 0x3c, - 0x5c, 0x4d, 0x41, 0x88, 0xc7, 0xc3, 0x17, 0x97, 0xbf, 0xb4, 0xcc, 0xe5, 0xb5, 0xa6, 0x5c, 0x5d, - 0x6b, 0xca, 0xcf, 0x6b, 0x4d, 0xf9, 0x7c, 0xa3, 0x65, 0xae, 0x6e, 0xb4, 0xcc, 0x8f, 0x1b, 0x2d, - 0xf3, 0xd6, 0x20, 0x0e, 0x6b, 0x44, 0x56, 0xd9, 0xa6, 0xae, 0x51, 0x21, 0xa7, 0xc8, 0x0a, 0x8d, - 0x0a, 0x29, 0xd9, 0x0d, 0xe4, 0x78, 0xc6, 0x79, 0xb2, 0x1e, 0x6b, 0xfb, 0x38, 0xb4, 0xb2, 0xfc, - 0x8f, 0xfb, 0xe0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x50, 0x33, 0x8a, 0x50, 0x08, 0x00, - 0x00, + // 788 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x4f, 0xdb, 0x4a, + 0x14, 0x8d, 0xf9, 0x7a, 0x30, 0xc0, 0x13, 0x0c, 0xe8, 0x91, 0x18, 0x30, 0x60, 0xe0, 0x29, 0x3c, + 0x91, 0x38, 0xe1, 0xa9, 0xbb, 0x76, 0x51, 0xaa, 0x0a, 0x21, 0xb5, 0x15, 0xa4, 0xab, 0x76, 0x13, + 0x4d, 0x9c, 0xe9, 0xc4, 0x2a, 0xf6, 0x38, 0xf6, 0x98, 0x10, 0x96, 0x55, 0x77, 0xdd, 0x54, 0xea, + 0xa6, 0x3f, 0xa0, 0x3f, 0x86, 0x25, 0x52, 0x37, 0x5d, 0xb6, 0xa4, 0x3f, 0xa4, 0xf2, 0xcc, 0x24, + 0x8e, 0xe3, 0x38, 0x64, 0xc1, 0xce, 0x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0x01, 0x7f, 0xc7, 0xfd, 0x05, 0x0f, 0xc7, + 0x60, 0xe9, 0xdd, 0x00, 0x6a, 0x61, 0x4c, 0xb4, 0x94, 0x75, 0xc0, 0x65, 0xed, 0xc2, 0x9d, 0x91, + 0xb2, 0x0a, 0x1e, 0x6d, 0xc1, 0x6f, 0x0a, 0x58, 0x4e, 0x98, 0x07, 0x1a, 0x29, 0x7c, 0x69, 0x66, + 0x57, 0x4b, 0xe3, 0x17, 0x48, 0x8d, 0x87, 0x5c, 0xe3, 0xbf, 0x70, 0x2f, 0xa1, 0xb1, 0xe7, 0xc9, + 0x82, 0xb0, 0x6b, 0x81, 0x94, 0x43, 0x8f, 0x89, 0x4f, 0x56, 0xaa, 0xc7, 0x62, 0x5f, 0xcd, 0x54, + 0x8f, 0xc5, 0xbf, 0x94, 0x23, 0x3c, 0x26, 0x1e, 0x8f, 0x5f, 0xde, 0xfc, 0xd2, 0x32, 0x37, 0x77, + 0x9a, 0x72, 0x7b, 0xa7, 0x29, 0x3f, 0xef, 0x34, 0xe5, 0x73, 0x47, 0xcb, 0xdc, 0x76, 0xb4, 0xcc, + 0x8f, 0x8e, 0x96, 0x79, 0x6b, 0x10, 0x8b, 0x35, 0x82, 0x5a, 0xd1, 0xa4, 0xb6, 0x51, 0x22, 0x17, + 0xa8, 0xe6, 0x1b, 0x25, 0x52, 0x30, 0x1b, 0xc8, 0x72, 0x8c, 0xab, 0x78, 0x3f, 0xd6, 0x76, 0xb1, + 0x5f, 0x9b, 0xe1, 0x3f, 0x12, 0xff, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x6e, 0x10, 0xbe, + 0x47, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -562,6 +640,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) EpochNumber(ctx context.Context, in *QueryEpochNumberRequest, opts ...grpc.CallOption) (*QueryEpochNumberResponse, error) QuorumCount(ctx context.Context, in *QueryQuorumCountRequest, opts ...grpc.CallOption) (*QueryQuorumCountResponse, error) EpochQuorum(ctx context.Context, in *QueryEpochQuorumRequest, opts ...grpc.CallOption) (*QueryEpochQuorumResponse, error) @@ -578,6 +657,15 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/zgc.dasigners.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) EpochNumber(ctx context.Context, in *QueryEpochNumberRequest, opts ...grpc.CallOption) (*QueryEpochNumberResponse, error) { out := new(QueryEpochNumberResponse) err := c.cc.Invoke(ctx, "/zgc.dasigners.v1.Query/EpochNumber", in, out, opts...) @@ -634,6 +722,7 @@ func (c *queryClient) Signer(ctx context.Context, in *QuerySignerRequest, opts . // QueryServer is the server API for Query service. type QueryServer interface { + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) EpochNumber(context.Context, *QueryEpochNumberRequest) (*QueryEpochNumberResponse, error) QuorumCount(context.Context, *QueryQuorumCountRequest) (*QueryQuorumCountResponse, error) EpochQuorum(context.Context, *QueryEpochQuorumRequest) (*QueryEpochQuorumResponse, error) @@ -646,6 +735,9 @@ type QueryServer interface { type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} func (*UnimplementedQueryServer) EpochNumber(ctx context.Context, req *QueryEpochNumberRequest) (*QueryEpochNumberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EpochNumber not implemented") } @@ -669,6 +761,24 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.dasigners.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_EpochNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryEpochNumberRequest) if err := dec(in); err != nil { @@ -781,6 +891,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "zgc.dasigners.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, { MethodName: "EpochNumber", Handler: _Query_EpochNumber_Handler, @@ -810,6 +924,64 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "zgc/dasigners/v1/query.proto", } +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QuerySignerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1213,6 +1385,28 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QuerySignerRequest) Size() (n int) { if m == nil { return 0 @@ -1391,6 +1585,142 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QuerySignerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/dasigners/v1/types/query.pb.gw.go b/x/dasigners/v1/types/query.pb.gw.go index 270c890a..a82a7801 100644 --- a/x/dasigners/v1/types/query.pb.gw.go +++ b/x/dasigners/v1/types/query.pb.gw.go @@ -33,6 +33,24 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_EpochNumber_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryEpochNumberRequest var metadata runtime.ServerMetadata @@ -237,6 +255,29 @@ func local_request_Query_Signer_0(ctx context.Context, marshaler runtime.Marshal // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_EpochNumber_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -416,6 +457,26 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_EpochNumber_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -540,6 +601,8 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0g", "dasigners", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_EpochNumber_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0g", "dasigners", "v1", "epoch-number"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_QuorumCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0g", "dasigners", "v1", "quorum-count"}, "", runtime.AssumeColonVerbOpt(true))) @@ -554,6 +617,8 @@ var ( ) var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + forward_Query_EpochNumber_0 = runtime.ForwardResponseMessage forward_Query_QuorumCount_0 = runtime.ForwardResponseMessage diff --git a/x/dasigners/v1/types/tx.pb.go b/x/dasigners/v1/types/tx.pb.go index 73929ab0..b48937fa 100644 --- a/x/dasigners/v1/types/tx.pb.go +++ b/x/dasigners/v1/types/tx.pb.go @@ -30,6 +30,80 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgChangeParams struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *MsgChangeParams) Reset() { *m = MsgChangeParams{} } +func (m *MsgChangeParams) String() string { return proto.CompactTextString(m) } +func (*MsgChangeParams) ProtoMessage() {} +func (*MsgChangeParams) Descriptor() ([]byte, []int) { + return fileDescriptor_8bfa0cc0bd2f98e0, []int{0} +} +func (m *MsgChangeParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChangeParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChangeParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChangeParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChangeParams.Merge(m, src) +} +func (m *MsgChangeParams) XXX_Size() int { + return m.Size() +} +func (m *MsgChangeParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChangeParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChangeParams proto.InternalMessageInfo + +type MsgChangeParamsResponse struct { +} + +func (m *MsgChangeParamsResponse) Reset() { *m = MsgChangeParamsResponse{} } +func (m *MsgChangeParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChangeParamsResponse) ProtoMessage() {} +func (*MsgChangeParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8bfa0cc0bd2f98e0, []int{1} +} +func (m *MsgChangeParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChangeParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChangeParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChangeParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChangeParamsResponse.Merge(m, src) +} +func (m *MsgChangeParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChangeParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChangeParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChangeParamsResponse proto.InternalMessageInfo + type MsgRegisterSigner struct { Signer *Signer `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` @@ -39,7 +113,7 @@ func (m *MsgRegisterSigner) Reset() { *m = MsgRegisterSigner{} } func (m *MsgRegisterSigner) String() string { return proto.CompactTextString(m) } func (*MsgRegisterSigner) ProtoMessage() {} func (*MsgRegisterSigner) Descriptor() ([]byte, []int) { - return fileDescriptor_8bfa0cc0bd2f98e0, []int{0} + return fileDescriptor_8bfa0cc0bd2f98e0, []int{2} } func (m *MsgRegisterSigner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,7 +149,7 @@ func (m *MsgRegisterSignerResponse) Reset() { *m = MsgRegisterSignerResp func (m *MsgRegisterSignerResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterSignerResponse) ProtoMessage() {} func (*MsgRegisterSignerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8bfa0cc0bd2f98e0, []int{1} + return fileDescriptor_8bfa0cc0bd2f98e0, []int{3} } func (m *MsgRegisterSignerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -113,7 +187,7 @@ func (m *MsgUpdateSocket) Reset() { *m = MsgUpdateSocket{} } func (m *MsgUpdateSocket) String() string { return proto.CompactTextString(m) } func (*MsgUpdateSocket) ProtoMessage() {} func (*MsgUpdateSocket) Descriptor() ([]byte, []int) { - return fileDescriptor_8bfa0cc0bd2f98e0, []int{2} + return fileDescriptor_8bfa0cc0bd2f98e0, []int{4} } func (m *MsgUpdateSocket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -149,7 +223,7 @@ func (m *MsgUpdateSocketResponse) Reset() { *m = MsgUpdateSocketResponse func (m *MsgUpdateSocketResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateSocketResponse) ProtoMessage() {} func (*MsgUpdateSocketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8bfa0cc0bd2f98e0, []int{3} + return fileDescriptor_8bfa0cc0bd2f98e0, []int{5} } func (m *MsgUpdateSocketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -187,7 +261,7 @@ func (m *MsgRegisterNextEpoch) Reset() { *m = MsgRegisterNextEpoch{} } func (m *MsgRegisterNextEpoch) String() string { return proto.CompactTextString(m) } func (*MsgRegisterNextEpoch) ProtoMessage() {} func (*MsgRegisterNextEpoch) Descriptor() ([]byte, []int) { - return fileDescriptor_8bfa0cc0bd2f98e0, []int{4} + return fileDescriptor_8bfa0cc0bd2f98e0, []int{6} } func (m *MsgRegisterNextEpoch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -223,7 +297,7 @@ func (m *MsgRegisterNextEpochResponse) Reset() { *m = MsgRegisterNextEpo func (m *MsgRegisterNextEpochResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterNextEpochResponse) ProtoMessage() {} func (*MsgRegisterNextEpochResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8bfa0cc0bd2f98e0, []int{5} + return fileDescriptor_8bfa0cc0bd2f98e0, []int{7} } func (m *MsgRegisterNextEpochResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,6 +327,8 @@ func (m *MsgRegisterNextEpochResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRegisterNextEpochResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgChangeParams)(nil), "zgc.dasigners.v1.MsgChangeParams") + proto.RegisterType((*MsgChangeParamsResponse)(nil), "zgc.dasigners.v1.MsgChangeParamsResponse") proto.RegisterType((*MsgRegisterSigner)(nil), "zgc.dasigners.v1.MsgRegisterSigner") proto.RegisterType((*MsgRegisterSignerResponse)(nil), "zgc.dasigners.v1.MsgRegisterSignerResponse") proto.RegisterType((*MsgUpdateSocket)(nil), "zgc.dasigners.v1.MsgUpdateSocket") @@ -264,32 +340,37 @@ func init() { func init() { proto.RegisterFile("zgc/dasigners/v1/tx.proto", fileDescriptor_8bfa0cc0bd2f98e0) } var fileDescriptor_8bfa0cc0bd2f98e0 = []byte{ - // 399 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 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 0x6b, 0xad, 0x23, 0xc2, 0xfd, 0xba, 0xfc, 0xbc, - 0x3f, 0xdf, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x5a, 0xce, 0x9a, 0x7b, 0x03, 0x00, 0x00, + // 466 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x40, 0x63, 0x2a, 0x05, 0x65, 0x88, 0x80, 0x5a, 0x15, 0xc4, 0xa6, 0x5a, 0x85, 0x20, 0xa1, + 0x22, 0x84, 0x37, 0x2d, 0x7f, 0x40, 0xc5, 0x31, 0x15, 0x72, 0xc5, 0x05, 0x55, 0x42, 0xeb, 0xed, + 0x32, 0xb6, 0xda, 0x78, 0x2d, 0xef, 0xba, 0x4a, 0xfa, 0x15, 0x88, 0xaf, 0xea, 0xb1, 0x47, 0x8e, + 0x90, 0xfc, 0x08, 0xca, 0xda, 0x71, 0x12, 0xdb, 0xa4, 0xb9, 0xed, 0xcc, 0xbc, 0xcc, 0x9b, 0xc9, + 0x28, 0x01, 0xe7, 0x16, 0x39, 0xbd, 0x64, 0x2a, 0xc2, 0x58, 0xa4, 0x8a, 0xde, 0x1c, 0x53, 0x3d, + 0xf1, 0x92, 0x54, 0x6a, 0x69, 0x3f, 0xbf, 0x45, 0xee, 0x95, 0x25, 0xef, 0xe6, 0xd8, 0x75, 0xb8, + 0x54, 0x63, 0xa9, 0xbe, 0x9b, 0x3a, 0xcd, 0x83, 0x1c, 0x76, 0x0f, 0x50, 0xa2, 0xcc, 0xf3, 0x8b, + 0x57, 0x91, 0x75, 0x50, 0x4a, 0xbc, 0x16, 0xd4, 0x44, 0x41, 0xf6, 0x83, 0xb2, 0x78, 0x5a, 0x94, + 0xfa, 0x35, 0xf1, 0x4a, 0x95, 0x13, 0xa4, 0x46, 0xa0, 0x88, 0x85, 0x8a, 0x8a, 0xfa, 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, 0x2b, 0x47, 0x71, 0xdf, 0x3d, 0x88, 0x2c, 0x2d, 0x76, 0x00, 0x4f, 0x2b, + 0x47, 0x7b, 0xd3, 0xf8, 0xe1, 0x4d, 0xc8, 0x7d, 0xbf, 0x03, 0x54, 0x3a, 0x2e, 0xa0, 0xbb, 0x71, + 0x96, 0xe6, 0x0d, 0xd6, 0x91, 0xff, 0x6c, 0xd0, 0x74, 0x17, 0xfb, 0x0a, 0xf6, 0xeb, 0x47, 0x79, + 0xbb, 0x75, 0xbe, 0x92, 0x73, 0xbd, 0xdd, 0xb8, 0xa5, 0xec, 0xd3, 0xe8, 0xee, 0x2f, 0x69, 0xdd, + 0xcd, 0x88, 0x75, 0x3f, 0x23, 0xd6, 0x9f, 0x19, 0xb1, 0x7e, 0xce, 0x49, 0xeb, 0x7e, 0x4e, 0x5a, + 0xbf, 0xe7, 0xa4, 0xf5, 0x8d, 0x62, 0xa4, 0xc3, 0x2c, 0xf0, 0xb8, 0x1c, 0xd3, 0x21, 0x5e, 0xb3, + 0x40, 0xd1, 0x21, 0x7e, 0xe0, 0x21, 0x8b, 0x62, 0x3a, 0xa9, 0xfc, 0xad, 0x4c, 0x13, 0xa1, 0x82, + 0xb6, 0xf9, 0xe9, 0x7e, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x94, 0x58, 0x6f, 0x77, 0x04, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -304,6 +385,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + ChangeParams(ctx context.Context, in *MsgChangeParams, opts ...grpc.CallOption) (*MsgChangeParamsResponse, error) RegisterSigner(ctx context.Context, in *MsgRegisterSigner, opts ...grpc.CallOption) (*MsgRegisterSignerResponse, error) UpdateSocket(ctx context.Context, in *MsgUpdateSocket, opts ...grpc.CallOption) (*MsgUpdateSocketResponse, error) RegisterNextEpoch(ctx context.Context, in *MsgRegisterNextEpoch, opts ...grpc.CallOption) (*MsgRegisterNextEpochResponse, error) @@ -317,6 +399,15 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) ChangeParams(ctx context.Context, in *MsgChangeParams, opts ...grpc.CallOption) (*MsgChangeParamsResponse, error) { + out := new(MsgChangeParamsResponse) + err := c.cc.Invoke(ctx, "/zgc.dasigners.v1.Msg/ChangeParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) RegisterSigner(ctx context.Context, in *MsgRegisterSigner, opts ...grpc.CallOption) (*MsgRegisterSignerResponse, error) { out := new(MsgRegisterSignerResponse) err := c.cc.Invoke(ctx, "/zgc.dasigners.v1.Msg/RegisterSigner", in, out, opts...) @@ -346,6 +437,7 @@ func (c *msgClient) RegisterNextEpoch(ctx context.Context, in *MsgRegisterNextEp // MsgServer is the server API for Msg service. type MsgServer interface { + ChangeParams(context.Context, *MsgChangeParams) (*MsgChangeParamsResponse, error) RegisterSigner(context.Context, *MsgRegisterSigner) (*MsgRegisterSignerResponse, error) UpdateSocket(context.Context, *MsgUpdateSocket) (*MsgUpdateSocketResponse, error) RegisterNextEpoch(context.Context, *MsgRegisterNextEpoch) (*MsgRegisterNextEpochResponse, error) @@ -355,6 +447,9 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) ChangeParams(ctx context.Context, req *MsgChangeParams) (*MsgChangeParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeParams not implemented") +} func (*UnimplementedMsgServer) RegisterSigner(ctx context.Context, req *MsgRegisterSigner) (*MsgRegisterSignerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterSigner not implemented") } @@ -369,6 +464,24 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_ChangeParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChangeParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChangeParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.dasigners.v1.Msg/ChangeParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChangeParams(ctx, req.(*MsgChangeParams)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_RegisterSigner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgRegisterSigner) if err := dec(in); err != nil { @@ -427,6 +540,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "zgc.dasigners.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "ChangeParams", + Handler: _Msg_ChangeParams_Handler, + }, { MethodName: "RegisterSigner", Handler: _Msg_RegisterSigner_Handler, @@ -444,6 +561,71 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "zgc/dasigners/v1/tx.proto", } +func (m *MsgChangeParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChangeParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChangeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChangeParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChangeParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChangeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgRegisterSigner) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -640,6 +822,32 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgChangeParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChangeParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgRegisterSigner) Size() (n int) { if m == nil { return 0 @@ -724,6 +932,174 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgChangeParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChangeParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChangeParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChangeParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChangeParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChangeParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgRegisterSigner) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/evmutil/keeper/msg_server_bep3_test.go b/x/evmutil/keeper/msg_server_bep3_test.go index 7277dcc3..475af402 100644 --- a/x/evmutil/keeper/msg_server_bep3_test.go +++ b/x/evmutil/keeper/msg_server_bep3_test.go @@ -212,10 +212,10 @@ func (suite *MsgServerSuite) TestConvertERC20ToCoin_Bep3() { { name: "invalid - invalid receiver address", msg: types.MsgConvertERC20ToCoin{ - Initiator: invoker.String(), - Receiver: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc", + Initiator: invoker.String(), + Receiver: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc", ZgChainERC20Address: contractAddr.String(), - Amount: sdkmath.NewInt(12e8), + Amount: sdkmath.NewInt(12e8), }, userErc20Balance: sdkmath.NewInt(2e18), errArgs: errArgs{ @@ -226,10 +226,10 @@ func (suite *MsgServerSuite) TestConvertERC20ToCoin_Bep3() { { name: "invalid - invalid contract address", msg: types.MsgConvertERC20ToCoin{ - Initiator: invoker.String(), - Receiver: invokerCosmosAddr.String(), + Initiator: invoker.String(), + Receiver: invokerCosmosAddr.String(), ZgChainERC20Address: invokerCosmosAddr.String(), - Amount: sdkmath.NewInt(12e8), + Amount: sdkmath.NewInt(12e8), }, userErc20Balance: sdkmath.NewInt(2e18), errArgs: errArgs{