diff --git a/proto/lorenzo/btcstaking/v1/params.proto b/proto/lorenzo/btcstaking/v1/params.proto index 5f2262d4..87e369b8 100644 --- a/proto/lorenzo/btcstaking/v1/params.proto +++ b/proto/lorenzo/btcstaking/v1/params.proto @@ -19,4 +19,6 @@ message Params { repeated Receiver receivers = 1; // deprecated uint32 btc_confirmations_depth = 2; + // allow list to mint for receiver with eth_addr + repeated string minter_allow_list = 3; } diff --git a/proto/lorenzo/btcstaking/v1/tx.proto b/proto/lorenzo/btcstaking/v1/tx.proto index 79e5b938..ca854658 100644 --- a/proto/lorenzo/btcstaking/v1/tx.proto +++ b/proto/lorenzo/btcstaking/v1/tx.proto @@ -10,18 +10,14 @@ import "lorenzo/btcstaking/v1/params.proto"; option go_package = "github.com/Lorenzo-Protocol/lorenzo/x/btcstaking/types"; // Msg defines the Msg service. -// TODO: handle unbonding tx with full witness service Msg { option (cosmos.msg.v1.service) = true; - // CreateBTCDelegation creates a new BTC delegation rpc CreateBTCStaking(MsgCreateBTCStaking) returns (MsgCreateBTCStakingResponse); rpc Burn(MsgBurnRequest) returns (MsgBurnResponse); - rpc AddReceiver(MsgAddReceiver) returns (MsgAddReceiverResponse); - - rpc RemoveReceiver(MsgRemoveReceiver) returns (MsgRemoveReceiverResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } message TransactionKey { @@ -46,9 +42,6 @@ message TransactionInfo { TransactionKey key = 1; // transaction is the full transaction in bytes bytes transaction = 2; - // proof is the Merkle proof that this tx is included in the position in `key` - // TODO: maybe it could use here better format as we already processed and - // validated the proof? bytes proof = 3; } @@ -70,20 +63,12 @@ message MsgBurnRequest { message MsgBurnResponse{} -message MsgAddReceiver { +message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - Receiver receiver = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 [ (gogoproto.nullable) = false ]; } -message MsgAddReceiverResponse {} -message MsgRemoveReceiver { - option (cosmos.msg.v1.signer) = "authority"; - - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - string receiver = 2 ; -} -message MsgRemoveReceiverResponse {} +message MsgUpdateParamsResponse {} diff --git a/x/btcstaking/keeper/msg_server.go b/x/btcstaking/keeper/msg_server.go index bcde23eb..ea2562cd 100644 --- a/x/btcstaking/keeper/msg_server.go +++ b/x/btcstaking/keeper/msg_server.go @@ -20,9 +20,10 @@ import ( const EthAddrLen = 42 -const Dep0Amount = 2e6 -const Dep1Amount = 1e7 -const Dep2Amount = 5e7 +const Dep0Amount = 4e5 +const Dep1Amount = 2e6 +const Dep2Amount = 1e7 +const Dep3Amount = 5e7 type msgServer struct { Keeper @@ -36,7 +37,6 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { var _ types.MsgServer = msgServer{} -// UpdateParams updates the params func NewBTCTxFromBytes(txBytes []byte) (*wire.MsgTx, error) { var msgTx wire.MsgTx rbuf := bytes.NewReader(txBytes) @@ -102,19 +102,17 @@ func extractPaymentToWithOpReturnId(tx *wire.MsgTx, addr btcutil.Address) (uint6 return amt, opReturnId, nil } -/*func extractPaymentTo(tx *wire.MsgTx, addr btcutil.Address) (uint64, error) { - payToAddrScript, err := txscript.PayToAddrScript(addr) - if err != nil { - return 0, fmt.Errorf("invalid address") - } - var amt uint64 = 0 - for _, out := range tx.TxOut { - if bytes.Equal(out.PkScript, payToAddrScript) { - amt += uint64(out.Value) - } - } - return amt, nil -}*/ +func canPerformMint(signer sdk.AccAddress, p types.Params) bool { + if len(p.MinterAllowList) == 0 { + return true + } + for _, addr := range p.MinterAllowList { + if sdk.MustAccAddressFromBech32(addr).Equals(signer) { + return true + } + } + return false +} func (ms msgServer) CreateBTCStaking(goCtx context.Context, req *types.MsgCreateBTCStaking) (*types.MsgCreateBTCStakingResponse, error) { stakingMsgTx, err := NewBTCTxFromBytes(req.StakingTx.Transaction) @@ -152,6 +150,10 @@ func (ms msgServer) CreateBTCStaking(goCtx context.Context, req *types.MsgCreate var mintToAddr []byte var btcAmount uint64 if common.IsHexAddress(receiver.EthAddr) { + signers := req.GetSigners() + if len(signers) == 0 || !canPerformMint(req.GetSigners()[0], *p) { + return nil, types.ErrNotInAllowList + } mintToAddr = common.HexToAddress(receiver.EthAddr).Bytes() btcAmount, err = extractPaymentTo(stakingMsgTx, btc_receiving_addr) } else { @@ -162,14 +164,18 @@ func (ms msgServer) CreateBTCStaking(goCtx context.Context, req *types.MsgCreate } else if btcAmount < Dep0Amount { // no depth check required } else if btcAmount < Dep1Amount { // at least 1 depth if stakingTxDepth < 1 { - return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=%d; depth=%d", 1, stakingTxDepth) + return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=1; depth=%d", stakingTxDepth) } } else if btcAmount < Dep2Amount { if stakingTxDepth < 2 { - return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=%d; depth=%d", 2, stakingTxDepth) + return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=2; depth=%d", stakingTxDepth) + } + } else if btcAmount < Dep3Amount { + if stakingTxDepth < 3 { + return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=3; depth=%d", stakingTxDepth) } - } else if stakingTxDepth < 3 { - return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=%d; depth=%d", 3, stakingTxDepth) + } else if stakingTxDepth < 4 { + return nil, types.ErrBlkHdrNotConfirmed.Wrapf("not k-deep: k=4; depth=%d", stakingTxDepth) } if len(mintToAddr) != 20 { return nil, types.ErrMintToAddr.Wrap(hex.EncodeToString(mintToAddr)) @@ -261,47 +267,16 @@ func findReceiver(receivers []*types.Receiver, name string) (int, *types.Receive return idx, receiver } -func (ms msgServer) AddReceiver(goCtx context.Context, req *types.MsgAddReceiver) (*types.MsgAddReceiverResponse, error) { +func (ms msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if ms.authority != req.Authority { return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) - params := ms.GetParams(ctx) - receiverIdx, receiver := findReceiver(params.Receivers, req.Receiver.Name) - if receiver != nil { - params.Receivers[receiverIdx] = &req.Receiver - } else { - params.Receivers = append(params.Receivers, &req.Receiver) - } - btclcParams := ms.btclcKeeper.GetBTCNet() - if _, err := btcutil.DecodeAddress(req.Receiver.Addr, btclcParams); err != nil { - return nil, types.ErrInvalidReceivingAddr.Wrap(err.Error()) - } - if err := ms.SetParams(ctx, params); err != nil { + if err := req.Params.Validate(); err != nil { return nil, err } - - return &types.MsgAddReceiverResponse{}, nil -} - -func (ms msgServer) RemoveReceiver(goCtx context.Context, req *types.MsgRemoveReceiver) (*types.MsgRemoveReceiverResponse, error) { - if ms.authority != req.Authority { - return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority) - } - ctx := sdk.UnwrapSDKContext(goCtx) - params := ms.GetParams(ctx) - receivers := make([]*types.Receiver, 0, len(params.Receivers)) - for _, receiver := range params.Receivers { - if receiver.Name != req.Receiver { - receivers = append(receivers, receiver) - } - } - if len(receivers) == len(params.Receivers) { - return nil, govtypes.ErrInvalidProposalMsg.Wrap("Receiver not exists") - } - params.Receivers = receivers - if err := ms.SetParams(ctx, params); err != nil { + if err := ms.SetParams(ctx, &req.Params); err != nil { return nil, err } - return &types.MsgRemoveReceiverResponse{}, nil + return &types.MsgUpdateParamsResponse{}, nil } diff --git a/x/btcstaking/types/errors.go b/x/btcstaking/types/errors.go index 55c5271b..c1936111 100644 --- a/x/btcstaking/types/errors.go +++ b/x/btcstaking/types/errors.go @@ -23,4 +23,5 @@ var ( ErrBurnInsufficientBalance = errorsmod.Register(ModuleName, 1115, "insufficient account balance") ErrBurnInvalidSigner = errorsmod.Register(ModuleName, 1116, "invalid signer") ErrInvalidEthAddr = errorsmod.Register(ModuleName, 1117, "invalid receiver eth addr") + ErrNotInAllowList = errorsmod.Register(ModuleName, 1118, "not in minter allow list") ) diff --git a/x/btcstaking/types/genesis.go b/x/btcstaking/types/genesis.go index edef8b62..2aeda417 100644 --- a/x/btcstaking/types/genesis.go +++ b/x/btcstaking/types/genesis.go @@ -3,6 +3,7 @@ package types import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" ) @@ -28,14 +29,19 @@ func (receiver Receiver) Validate() error { return nil } -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - if gs.Params == nil { - return fmt.Errorf("params cannot be nil") +func ValidateAddressList(allowList []string) error { + for _, a := range allowList { + if _, err := sdk.AccAddressFromBech32(a); err != nil { + return fmt.Errorf("invalid address") + } } + + return nil +} + +func (params Params) Validate() error { receivers := map[string]bool{} - for _, receiver := range gs.Params.Receivers { + for _, receiver := range params.Receivers { if err := receiver.Validate(); err != nil { return err } @@ -44,5 +50,20 @@ func (gs GenesisState) Validate() error { } receivers[receiver.Name] = true } + if err := ValidateAddressList(params.MinterAllowList); err != nil { + return fmt.Errorf("invalid minter allow list") + } + return nil +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + if gs.Params == nil { + return fmt.Errorf("params cannot be nil") + } + if err := gs.Params.Validate(); err != nil { + return err + } return nil } diff --git a/x/btcstaking/types/msg.go b/x/btcstaking/types/msg.go index 63944e3a..d84f505b 100644 --- a/x/btcstaking/types/msg.go +++ b/x/btcstaking/types/msg.go @@ -3,7 +3,6 @@ package types import ( fmt "fmt" - errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg" @@ -14,8 +13,7 @@ import ( var ( _ sdk.Msg = &MsgCreateBTCStaking{} _ sdk.Msg = &MsgBurnRequest{} - _ sdk.Msg = &MsgRemoveReceiver{} - _ sdk.Msg = &MsgAddReceiver{} + _ sdk.Msg = &MsgUpdateParams{} ) func (m *MsgCreateBTCStaking) ValidateBasic() error { @@ -32,36 +30,6 @@ func (m *MsgCreateBTCStaking) ValidateBasic() error { return nil } -func (m *MsgAddReceiver) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - -func (m *MsgAddReceiver) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return errorsmod.Wrap(err, "invalid authority address") - } - if err := m.Receiver.Validate(); err != nil { - return err - } - return nil -} - -func (m *MsgRemoveReceiver) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - -func (m *MsgRemoveReceiver) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return errorsmod.Wrap(err, "invalid authority address") - } - if len(m.Receiver) == 0 { - return fmt.Errorf("receiver name cannot be empty") - } - return nil -} - func (msg *MsgCreateBTCStaking) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { @@ -99,3 +67,15 @@ func NewMsgBurnRequest(signer, btcTargetAddress string, amount math.Int) MsgBurn Amount: amount, } } + +func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +func (m *MsgUpdateParams) ValidateBasic() error { + if err := m.Params.Validate(); err != nil { + return err + } + return nil +} diff --git a/x/btcstaking/types/params.pb.go b/x/btcstaking/types/params.pb.go index e2cae2a1..5d3b1c49 100644 --- a/x/btcstaking/types/params.pb.go +++ b/x/btcstaking/types/params.pb.go @@ -92,6 +92,8 @@ type Params struct { Receivers []*Receiver `protobuf:"bytes,1,rep,name=receivers,proto3" json:"receivers,omitempty"` // deprecated BtcConfirmationsDepth uint32 `protobuf:"varint,2,opt,name=btc_confirmations_depth,json=btcConfirmationsDepth,proto3" json:"btc_confirmations_depth,omitempty"` + // allow list to mint for receiver with eth_addr + MinterAllowList []string `protobuf:"bytes,3,rep,name=minter_allow_list,json=minterAllowList,proto3" json:"minter_allow_list,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -141,6 +143,13 @@ func (m *Params) GetBtcConfirmationsDepth() uint32 { return 0 } +func (m *Params) GetMinterAllowList() []string { + if m != nil { + return m.MinterAllowList + } + return nil +} + func init() { proto.RegisterType((*Receiver)(nil), "lorenzo.btcstaking.v1.Receiver") proto.RegisterType((*Params)(nil), "lorenzo.btcstaking.v1.Params") @@ -151,25 +160,27 @@ func init() { } var fileDescriptor_cc0c3789eee73a9d = []byte{ - // 285 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xbd, 0x4e, 0xc3, 0x30, - 0x14, 0x85, 0x63, 0x8a, 0x4a, 0x6b, 0xc4, 0x62, 0x51, 0x11, 0x18, 0x4c, 0x95, 0xa9, 0x0b, 0xb6, - 0x0a, 0x52, 0x37, 0x06, 0x7e, 0x46, 0x90, 0xa2, 0x8c, 0x2c, 0x91, 0xe3, 0x98, 0x24, 0xa2, 0x89, - 0x23, 0xe7, 0x12, 0x01, 0x0b, 0xaf, 0xc0, 0x63, 0x31, 0x76, 0x64, 0x44, 0xc9, 0x8b, 0xa0, 0x38, - 0xad, 0xda, 0x81, 0xed, 0xe8, 0xdc, 0x63, 0xeb, 0xd3, 0x87, 0xbd, 0xa5, 0x36, 0xaa, 0xf8, 0xd0, - 0x3c, 0x02, 0x59, 0x81, 0x78, 0xc9, 0x8a, 0x84, 0xd7, 0x73, 0x5e, 0x0a, 0x23, 0xf2, 0x8a, 0x95, - 0x46, 0x83, 0x26, 0x93, 0xf5, 0x86, 0x6d, 0x37, 0xac, 0x9e, 0x9f, 0x1d, 0x27, 0x3a, 0xd1, 0x76, - 0xc1, 0xbb, 0xd4, 0x8f, 0xbd, 0x47, 0x3c, 0x0a, 0x94, 0x54, 0x59, 0xad, 0x0c, 0x21, 0x78, 0xbf, - 0x10, 0xb9, 0x72, 0xd1, 0x14, 0xcd, 0xc6, 0x81, 0xcd, 0x5d, 0x27, 0xe2, 0xd8, 0xb8, 0x7b, 0x7d, - 0xd7, 0x65, 0x72, 0x8a, 0x47, 0x0a, 0xd2, 0xd0, 0xf6, 0x03, 0xdb, 0x1f, 0x28, 0x48, 0x6f, 0xe2, - 0xd8, 0x78, 0x9f, 0x78, 0xe8, 0x5b, 0x16, 0x72, 0x8d, 0xc7, 0x66, 0xfd, 0x71, 0xe5, 0xa2, 0xe9, - 0x60, 0x76, 0x78, 0x79, 0xce, 0xfe, 0x25, 0x63, 0x1b, 0x80, 0x60, 0xfb, 0x82, 0x2c, 0xf0, 0x49, - 0x04, 0x32, 0x94, 0xba, 0x78, 0xce, 0x4c, 0x2e, 0x20, 0xd3, 0x45, 0x15, 0xc6, 0xaa, 0x84, 0xd4, - 0xa2, 0x1c, 0x05, 0x93, 0x08, 0xe4, 0xdd, 0xee, 0xf5, 0xbe, 0x3b, 0xde, 0xfa, 0xdf, 0x0d, 0x45, - 0xab, 0x86, 0xa2, 0xdf, 0x86, 0xa2, 0xaf, 0x96, 0x3a, 0xab, 0x96, 0x3a, 0x3f, 0x2d, 0x75, 0x9e, - 0x16, 0x49, 0x06, 0xe9, 0x6b, 0xc4, 0xa4, 0xce, 0xf9, 0x43, 0xcf, 0x71, 0xe1, 0x77, 0x0e, 0xa4, - 0x5e, 0xf2, 0x8d, 0xd6, 0xb7, 0x5d, 0xb1, 0xf0, 0x5e, 0xaa, 0x2a, 0x1a, 0x5a, 0x51, 0x57, 0x7f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x56, 0x7c, 0x93, 0x3c, 0x7b, 0x01, 0x00, 0x00, + // 318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x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90, 0x31, 0x3e, 0x89, 0x81, 0x45, 0x4c, 0x96, 0x4f, 0x42, 0x15, 0x14, 0x84, 0x2c, 0x75, 0x94, + 0xf0, 0x0a, 0x32, 0xeb, 0x72, 0x10, 0xf6, 0x62, 0x60, 0x77, 0xdb, 0xe9, 0xbd, 0x09, 0xc9, 0x05, + 0x3e, 0x2a, 0x44, 0x09, 0x5c, 0x45, 0x34, 0xcf, 0xe5, 0x6b, 0x94, 0x0b, 0x0d, 0xae, 0xd3, 0x77, + 0x86, 0xdd, 0xf0, 0xb0, 0x09, 0x26, 0x86, 0x4f, 0x85, 0x86, 0xdb, 0xd9, 0xf7, 0xd2, 0x43, 0x8b, + 0xa5, 0x87, 0x7e, 0x97, 0x1e, 0xfa, 0xac, 0xbd, 0xd6, 0xa2, 0xf6, 0x5a, 0x3f, 0xb5, 0xd7, 0x7a, + 0x1c, 0xa7, 0x02, 0xb2, 0x97, 0xd8, 0x67, 0xb2, 0x08, 0xa6, 0x8d, 0xf3, 0xe5, 0xcc, 0x2c, 0x8c, + 0xc9, 0x3c, 0x58, 0xdf, 0xe0, 0x6d, 0xfb, 0x0a, 0xf0, 0x5e, 0x71, 0x1d, 0xb7, 0xed, 0x56, 0xaf, + 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xca, 0xcd, 0xb0, 0x78, 0xa8, 0x01, 0x00, 0x00, } func (m *Receiver) Marshal() (dAtA []byte, err error) { @@ -236,6 +247,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MinterAllowList) > 0 { + for iNdEx := len(m.MinterAllowList) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.MinterAllowList[iNdEx]) + copy(dAtA[i:], m.MinterAllowList[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.MinterAllowList[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if m.BtcConfirmationsDepth != 0 { i = encodeVarintParams(dAtA, i, uint64(m.BtcConfirmationsDepth)) i-- @@ -305,6 +325,12 @@ func (m *Params) Size() (n int) { if m.BtcConfirmationsDepth != 0 { n += 1 + sovParams(uint64(m.BtcConfirmationsDepth)) } + if len(m.MinterAllowList) > 0 { + for _, s := range m.MinterAllowList { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } return n } @@ -542,6 +568,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinterAllowList", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinterAllowList = append(m.MinterAllowList, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/btcstaking/types/tx.pb.go b/x/btcstaking/types/tx.pb.go index 901c60b2..5b636275 100644 --- a/x/btcstaking/types/tx.pb.go +++ b/x/btcstaking/types/tx.pb.go @@ -92,10 +92,7 @@ type TransactionInfo struct { Key *TransactionKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // transaction is the full transaction in bytes Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"` - // proof is the Merkle proof that this tx is included in the position in `key` - // TODO: maybe it could use here better format as we already processed and - // validated the proof? - Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` + Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` } func (m *TransactionInfo) Reset() { *m = TransactionInfo{} } @@ -337,23 +334,23 @@ func (m *MsgBurnResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo -type MsgAddReceiver struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Receiver Receiver `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver"` +type MsgUpdateParams struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } -func (m *MsgAddReceiver) Reset() { *m = MsgAddReceiver{} } -func (m *MsgAddReceiver) String() string { return proto.CompactTextString(m) } -func (*MsgAddReceiver) ProtoMessage() {} -func (*MsgAddReceiver) Descriptor() ([]byte, []int) { +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { return fileDescriptor_6be51bab5db52b8e, []int{6} } -func (m *MsgAddReceiver) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgAddReceiver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgAddReceiver.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -363,85 +360,47 @@ func (m *MsgAddReceiver) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *MsgAddReceiver) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddReceiver.Merge(m, src) +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) } -func (m *MsgAddReceiver) XXX_Size() int { +func (m *MsgUpdateParams) XXX_Size() int { return m.Size() } -func (m *MsgAddReceiver) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddReceiver.DiscardUnknown(m) +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) } -var xxx_messageInfo_MsgAddReceiver proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo -func (m *MsgAddReceiver) GetAuthority() string { +func (m *MsgUpdateParams) GetAuthority() string { if m != nil { return m.Authority } return "" } -func (m *MsgAddReceiver) GetReceiver() Receiver { +func (m *MsgUpdateParams) GetParams() Params { if m != nil { - return m.Receiver + return m.Params } - return Receiver{} + return Params{} } -type MsgAddReceiverResponse struct { +type MsgUpdateParamsResponse struct { } -func (m *MsgAddReceiverResponse) Reset() { *m = MsgAddReceiverResponse{} } -func (m *MsgAddReceiverResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAddReceiverResponse) ProtoMessage() {} -func (*MsgAddReceiverResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_6be51bab5db52b8e, []int{7} } -func (m *MsgAddReceiverResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAddReceiverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAddReceiverResponse.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 *MsgAddReceiverResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddReceiverResponse.Merge(m, src) -} -func (m *MsgAddReceiverResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAddReceiverResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddReceiverResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAddReceiverResponse proto.InternalMessageInfo - -type MsgRemoveReceiver struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` -} - -func (m *MsgRemoveReceiver) Reset() { *m = MsgRemoveReceiver{} } -func (m *MsgRemoveReceiver) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveReceiver) ProtoMessage() {} -func (*MsgRemoveReceiver) Descriptor() ([]byte, []int) { - return fileDescriptor_6be51bab5db52b8e, []int{8} -} -func (m *MsgRemoveReceiver) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRemoveReceiver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRemoveReceiver.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -451,67 +410,17 @@ func (m *MsgRemoveReceiver) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgRemoveReceiver) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveReceiver.Merge(m, src) +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) } -func (m *MsgRemoveReceiver) XXX_Size() int { +func (m *MsgUpdateParamsResponse) XXX_Size() int { return m.Size() } -func (m *MsgRemoveReceiver) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveReceiver.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRemoveReceiver proto.InternalMessageInfo - -func (m *MsgRemoveReceiver) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgRemoveReceiver) GetReceiver() string { - if m != nil { - return m.Receiver - } - return "" +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) } -type MsgRemoveReceiverResponse struct { -} - -func (m *MsgRemoveReceiverResponse) Reset() { *m = MsgRemoveReceiverResponse{} } -func (m *MsgRemoveReceiverResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveReceiverResponse) ProtoMessage() {} -func (*MsgRemoveReceiverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6be51bab5db52b8e, []int{9} -} -func (m *MsgRemoveReceiverResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRemoveReceiverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRemoveReceiverResponse.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 *MsgRemoveReceiverResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveReceiverResponse.Merge(m, src) -} -func (m *MsgRemoveReceiverResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRemoveReceiverResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveReceiverResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRemoveReceiverResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { proto.RegisterType((*TransactionKey)(nil), "lorenzo.btcstaking.v1.TransactionKey") @@ -520,60 +429,56 @@ func init() { proto.RegisterType((*MsgCreateBTCStakingResponse)(nil), "lorenzo.btcstaking.v1.MsgCreateBTCStakingResponse") proto.RegisterType((*MsgBurnRequest)(nil), "lorenzo.btcstaking.v1.MsgBurnRequest") proto.RegisterType((*MsgBurnResponse)(nil), "lorenzo.btcstaking.v1.MsgBurnResponse") - proto.RegisterType((*MsgAddReceiver)(nil), "lorenzo.btcstaking.v1.MsgAddReceiver") - proto.RegisterType((*MsgAddReceiverResponse)(nil), "lorenzo.btcstaking.v1.MsgAddReceiverResponse") - proto.RegisterType((*MsgRemoveReceiver)(nil), "lorenzo.btcstaking.v1.MsgRemoveReceiver") - proto.RegisterType((*MsgRemoveReceiverResponse)(nil), "lorenzo.btcstaking.v1.MsgRemoveReceiverResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "lorenzo.btcstaking.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "lorenzo.btcstaking.v1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("lorenzo/btcstaking/v1/tx.proto", fileDescriptor_6be51bab5db52b8e) } var fileDescriptor_6be51bab5db52b8e = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x4f, 0x4f, 0x13, 0x4f, - 0x18, 0xc7, 0xbb, 0xbf, 0x02, 0xf9, 0xed, 0x54, 0x0b, 0x8c, 0x88, 0x65, 0x89, 0x5b, 0xb2, 0x09, - 0x84, 0x10, 0xbb, 0x2b, 0x35, 0xc1, 0xc4, 0x78, 0x90, 0x25, 0x1a, 0x88, 0x36, 0x21, 0x4b, 0xbd, - 0x78, 0x69, 0xb6, 0xbb, 0xc3, 0x76, 0x03, 0xbb, 0x53, 0x67, 0xa6, 0xb5, 0x35, 0x1e, 0x0c, 0xaf, - 0xc0, 0xbb, 0xf1, 0x0d, 0xe8, 0x85, 0x83, 0x2f, 0x82, 0x23, 0xf1, 0x64, 0x38, 0x10, 0x43, 0x0f, - 0xbc, 0x0d, 0xb3, 0x3b, 0xd3, 0x76, 0x0b, 0x2d, 0x34, 0xf1, 0xd4, 0x3e, 0xf3, 0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x50, 0x3b, 0x56, 0xcf, 0x14, 0x97, 0xf5, 0xa1, 0x4d, 0xd2, 0x07, 0x99, 0xad, 0xe8, 0x06, - 0x5c, 0x02, 0x19, 0xd6, 0x3f, 0xe6, 0xa4, 0x56, 0xf2, 0x28, 0x2a, 0xad, 0x4e, 0x30, 0xde, 0xcf, - 0xa5, 0x63, 0x1f, 0x37, 0xb4, 0x6f, 0x12, 0xb8, 0x57, 0xa2, 0xde, 0x16, 0x41, 0x36, 0x43, 0x66, - 0x79, 0x6b, 0x8f, 0xcb, 0xc0, 0x79, 0x30, 0x45, 0x7d, 0x2f, 0x44, 0x24, 0x66, 0x91, 0x2d, 0x61, - 0xc1, 0x97, 0x00, 0x08, 0x92, 0x0a, 0x6b, 0xc5, 0x32, 0x99, 0xe2, 0xca, 0xed, 0x9c, 0x51, 0x71, - 0x96, 0x2c, 0x7c, 0xe5, 0x16, 0x54, 0xc0, 0xff, 0x04, 0x39, 0xc8, 0x6f, 0x22, 0x12, 0xf3, 0xc8, - 0x56, 0xcf, 0x7e, 0x96, 0x39, 0xba, 0x3c, 0x5e, 0x13, 0x7a, 0xda, 0x43, 0xb0, 0x38, 0x04, 0xcf, - 0x42, 0xb4, 0x8e, 0x43, 0x8a, 0xb4, 0x1f, 0x12, 0xc8, 0x96, 0xa8, 0x67, 0x36, 0x48, 0x68, 0xa1, - 0xf7, 0x0d, 0x44, 0xd9, 0x48, 0xf2, 0x47, 0x00, 0x56, 0x99, 0x53, 0x61, 0x36, 0xf1, 0x10, 0xab, - 0xd8, 0xae, 0x4b, 0x10, 0xa5, 0x71, 0x05, 0xb2, 0x35, 0x53, 0x65, 0x4e, 0x39, 0x76, 0x6c, 0xf2, - 0x73, 0xf8, 0x0a, 0x4c, 0xd9, 0x01, 0x6e, 0x84, 0x8c, 0xe3, 0x99, 0xfa, 0xc9, 0x79, 0x3e, 0x75, - 0x76, 0x9e, 0x5f, 0x49, 0x0c, 0x5e, 0xec, 0x2a, 0xff, 0x29, 0x50,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 0x6b, 0x92, 0xb9, 0x7b, 0x72, 0xa1, 0x4a, 0xa7, 0x17, 0xaa, 0xf4, 0xe7, 0x42, 0x95, - 0xbe, 0x74, 0xd4, 0xd4, 0x69, 0x47, 0x4d, 0xfd, 0xee, 0xa8, 0xa9, 0x77, 0x1b, 0xe3, 0xbc, 0xae, - 0xad, 0xe4, 0xcb, 0x1e, 0x7f, 0x78, 0xd5, 0xa9, 0xf8, 0x59, 0x7f, 0xf2, 0x37, 0x00, 0x00, 0xff, - 0xff, 0xa8, 0xd9, 0xc7, 0xc3, 0x7d, 0x06, 0x00, 0x00, + // 658 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0xbb, 0xfc, 0x68, 0xec, 0x2b, 0x02, 0x8e, 0x28, 0x65, 0x0d, 0x0b, 0xd9, 0x04, 0x42, + 0x88, 0xec, 0x86, 0x9a, 0x60, 0x82, 0x1e, 0x74, 0x89, 0x06, 0xa2, 0x24, 0x64, 0x29, 0x17, 0x2f, + 0xcd, 0x74, 0x3b, 0x6c, 0x37, 0xd0, 0x9d, 0x3a, 0x33, 0x25, 0xad, 0xf1, 0x60, 0xf8, 0x0b, 0x3c, + 0x79, 0xf3, 0x2f, 0xf0, 0xc2, 0xc1, 0xbb, 0x57, 0x8e, 0xc4, 0x93, 0xe1, 0x40, 0x0c, 0x1c, 0xf8, + 0x37, 0xcc, 0xce, 0x4c, 0xe9, 0xa2, 0xad, 0x70, 0xda, 0x7d, 0xbf, 0xe6, 0xfb, 0x79, 0xf3, 0x5e, + 0x06, 0xac, 0x7d, 0xca, 0x48, 0xfc, 0x81, 0xba, 0x15, 0x11, 0x70, 0x81, 0xf7, 0xa2, 0x38, 0x74, + 0x0f, 0x96, 0x5d, 0xd1, 0x72, 0x1a, 0x8c, 0x0a, 0x8a, 0x1e, 0xe8, 0xb8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x1a, 0x65, 0x91, 0x50, 0xab, 0x90, 0xf3, 0x0a, 0x3f, + 0xbf, 0x2f, 0x4d, 0xe8, 0xad, 0xd7, 0x88, 0xdb, 0x82, 0x25, 0x37, 0xd1, 0x4d, 0x45, 0xcf, 0x20, + 0xab, 0xd6, 0x5b, 0xcf, 0x65, 0xba, 0xcf, 0x5c, 0x94, 0x8c, 0x37, 0x94, 0xb4, 0xe4, 0xeb, 0x92, + 0xd5, 0xd1, 0x04, 0xb4, 0x7b, 0x98, 0x3d, 0x05, 0x93, 0x7f, 0x71, 0x75, 0x98, 0x8b, 0x3f, 0x06, + 0x60, 0x70, 0x93, 0x87, 0x88, 0xc1, 0xf8, 0x3f, 0x7b, 0xb3, 0xd8, 0x47, 0xb3, 0xc7, 0x10, 0xcd, + 0xe2, 0xed, 0x73, 0x3b, 0xda, 0x68, 0x07, 0x86, 0x92, 0xfb, 0x43, 0x73, 0xfd, 0x6b, 0x53, 0xcb, + 0x60, 0xce, 0xdf, 0x94, 0xa6, 0x8f, 0xdd, 0x85, 0x91, 0x6b, 0x23, 0xf8, 0x4f, 0x5d, 0x3a, 0xcf, + 0x74, 0x6e, 0x97, 0xd7, 0xd1, 0x31, 0x87, 0x3f, 0x5d, 0x1e, 0x2d, 0x1a, 0xde, 0xd6, 0xf1, 0xb9, + 0x65, 0x9c, 0x9c, 0x5b, 0xc6, 0xef, 0x73, 0xcb, 0xf8, 0x7c, 0x61, 0x65, 0x4e, 0x2e, 0xac, 0xcc, + 0xaf, 0x0b, 0x2b, 0xf3, 0x6e, 0xe5, 0x36, 0x0f, 0x4b, 0x2b, 0xfd, 0xa8, 0xc9, 0x9d, 0xab, 0x64, + 0xe5, 0x8b, 0xf6, 0xe4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x94, 0xa1, 0x0a, 0xfc, 0x78, 0x05, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -588,11 +493,9 @@ 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 { - // CreateBTCDelegation creates a new BTC delegation CreateBTCStaking(ctx context.Context, in *MsgCreateBTCStaking, opts ...grpc.CallOption) (*MsgCreateBTCStakingResponse, error) Burn(ctx context.Context, in *MsgBurnRequest, opts ...grpc.CallOption) (*MsgBurnResponse, error) - AddReceiver(ctx context.Context, in *MsgAddReceiver, opts ...grpc.CallOption) (*MsgAddReceiverResponse, error) - RemoveReceiver(ctx context.Context, in *MsgRemoveReceiver, opts ...grpc.CallOption) (*MsgRemoveReceiverResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -621,18 +524,9 @@ func (c *msgClient) Burn(ctx context.Context, in *MsgBurnRequest, opts ...grpc.C return out, nil } -func (c *msgClient) AddReceiver(ctx context.Context, in *MsgAddReceiver, opts ...grpc.CallOption) (*MsgAddReceiverResponse, error) { - out := new(MsgAddReceiverResponse) - err := c.cc.Invoke(ctx, "/lorenzo.btcstaking.v1.Msg/AddReceiver", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RemoveReceiver(ctx context.Context, in *MsgRemoveReceiver, opts ...grpc.CallOption) (*MsgRemoveReceiverResponse, error) { - out := new(MsgRemoveReceiverResponse) - err := c.cc.Invoke(ctx, "/lorenzo.btcstaking.v1.Msg/RemoveReceiver", in, out, opts...) +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/lorenzo.btcstaking.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -641,11 +535,9 @@ func (c *msgClient) RemoveReceiver(ctx context.Context, in *MsgRemoveReceiver, o // MsgServer is the server API for Msg service. type MsgServer interface { - // CreateBTCDelegation creates a new BTC delegation CreateBTCStaking(context.Context, *MsgCreateBTCStaking) (*MsgCreateBTCStakingResponse, error) Burn(context.Context, *MsgBurnRequest) (*MsgBurnResponse, error) - AddReceiver(context.Context, *MsgAddReceiver) (*MsgAddReceiverResponse, error) - RemoveReceiver(context.Context, *MsgRemoveReceiver) (*MsgRemoveReceiverResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -658,11 +550,8 @@ func (*UnimplementedMsgServer) CreateBTCStaking(ctx context.Context, req *MsgCre func (*UnimplementedMsgServer) Burn(ctx context.Context, req *MsgBurnRequest) (*MsgBurnResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented") } -func (*UnimplementedMsgServer) AddReceiver(ctx context.Context, req *MsgAddReceiver) (*MsgAddReceiverResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddReceiver not implemented") -} -func (*UnimplementedMsgServer) RemoveReceiver(ctx context.Context, req *MsgRemoveReceiver) (*MsgRemoveReceiverResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveReceiver not implemented") +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -705,38 +594,20 @@ func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{ return interceptor(ctx, in, info, handler) } -func _Msg_AddReceiver_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddReceiver) +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AddReceiver(ctx, in) + return srv.(MsgServer).UpdateParams(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/lorenzo.btcstaking.v1.Msg/AddReceiver", + FullMethod: "/lorenzo.btcstaking.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddReceiver(ctx, req.(*MsgAddReceiver)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RemoveReceiver_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemoveReceiver) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RemoveReceiver(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lorenzo.btcstaking.v1.Msg/RemoveReceiver", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RemoveReceiver(ctx, req.(*MsgRemoveReceiver)) + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) } return interceptor(ctx, in, info, handler) } @@ -754,12 +625,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_Burn_Handler, }, { - MethodName: "AddReceiver", - Handler: _Msg_AddReceiver_Handler, - }, - { - MethodName: "RemoveReceiver", - Handler: _Msg_RemoveReceiver_Handler, + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -997,7 +864,7 @@ func (m *MsgBurnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgAddReceiver) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1007,18 +874,18 @@ func (m *MsgAddReceiver) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgAddReceiver) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAddReceiver) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.Receiver.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1037,7 +904,7 @@ func (m *MsgAddReceiver) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgAddReceiverResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1047,72 +914,12 @@ func (m *MsgAddReceiverResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgAddReceiverResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAddReceiverResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRemoveReceiver) 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 *MsgRemoveReceiver) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRemoveReceiver) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Receiver) > 0 { - i -= len(m.Receiver) - copy(dAtA[i:], m.Receiver) - i = encodeVarintTx(dAtA, i, uint64(len(m.Receiver))) - 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 *MsgRemoveReceiverResponse) 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 *MsgRemoveReceiverResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRemoveReceiverResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1226,7 +1033,7 @@ func (m *MsgBurnResponse) Size() (n int) { return n } -func (m *MsgAddReceiver) Size() (n int) { +func (m *MsgUpdateParams) Size() (n int) { if m == nil { return 0 } @@ -1236,38 +1043,12 @@ func (m *MsgAddReceiver) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Receiver.Size() + l = m.Params.Size() n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgAddReceiverResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRemoveReceiver) 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)) - } - l = len(m.Receiver) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRemoveReceiverResponse) Size() (n int) { +func (m *MsgUpdateParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -1938,7 +1719,7 @@ func (m *MsgBurnResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAddReceiver) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1961,10 +1742,10 @@ func (m *MsgAddReceiver) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAddReceiver: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddReceiver: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2001,7 +1782,7 @@ func (m *MsgAddReceiver) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2028,7 +1809,7 @@ func (m *MsgAddReceiver) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Receiver.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2053,171 +1834,7 @@ func (m *MsgAddReceiver) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAddReceiverResponse) 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: MsgAddReceiverResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddReceiverResponse: 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 *MsgRemoveReceiver) 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: MsgRemoveReceiver: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveReceiver: 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 Receiver", 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.Receiver = string(dAtA[iNdEx:postIndex]) - 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 *MsgRemoveReceiverResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2240,10 +1857,10 @@ func (m *MsgRemoveReceiverResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveReceiverResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveReceiverResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: