From 0850ba0d35d872eee330016f3d756ce15cbb01c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Mon, 21 Oct 2019 17:29:17 +0200 Subject: [PATCH 01/16] blue account --- cmd/bnsd/app/app.go | 3 + cmd/bnsd/app/codec.pb.go | 5273 ++++++++++++++--- cmd/bnsd/app/codec.proto | 37 + cmd/bnsd/x/blueaccount/codec.pb.go | 4305 ++++++++++++++ cmd/bnsd/x/blueaccount/codec.proto | 192 + cmd/bnsd/x/blueaccount/configuration.go | 57 + cmd/bnsd/x/blueaccount/doc.go | 6 + cmd/bnsd/x/blueaccount/handler.go | 519 ++ cmd/bnsd/x/blueaccount/handler_test.go | 1018 ++++ cmd/bnsd/x/blueaccount/model.go | 130 + cmd/bnsd/x/blueaccount/msg.go | 180 + docs/proto/index.html | 900 +++ gconf/doc.go | 3 +- go.mod | 2 + spec/gogo/cmd/bnsd/app/codec.proto | 37 + spec/gogo/cmd/bnsd/x/blueaccount/codec.proto | 192 + spec/proto/cmd/bnsd/app/codec.proto | 37 + spec/proto/cmd/bnsd/x/blueaccount/codec.proto | 191 + 18 files changed, 12150 insertions(+), 932 deletions(-) create mode 100644 cmd/bnsd/x/blueaccount/codec.pb.go create mode 100644 cmd/bnsd/x/blueaccount/codec.proto create mode 100644 cmd/bnsd/x/blueaccount/configuration.go create mode 100644 cmd/bnsd/x/blueaccount/doc.go create mode 100644 cmd/bnsd/x/blueaccount/handler.go create mode 100644 cmd/bnsd/x/blueaccount/handler_test.go create mode 100644 cmd/bnsd/x/blueaccount/model.go create mode 100644 cmd/bnsd/x/blueaccount/msg.go create mode 100644 spec/gogo/cmd/bnsd/x/blueaccount/codec.proto create mode 100644 spec/proto/cmd/bnsd/x/blueaccount/codec.proto diff --git a/cmd/bnsd/app/app.go b/cmd/bnsd/app/app.go index 90c97b61..bb0f1570 100644 --- a/cmd/bnsd/app/app.go +++ b/cmd/bnsd/app/app.go @@ -12,6 +12,7 @@ import ( "github.com/iov-one/weave" "github.com/iov-one/weave/app" + "github.com/iov-one/weave/cmd/bnsd/x/blueaccount" "github.com/iov-one/weave/cmd/bnsd/x/username" "github.com/iov-one/weave/coin" "github.com/iov-one/weave/commands/server" @@ -89,6 +90,7 @@ func Router(authFn x.Authenticator, issuer weave.Address) *app.Router { gov.RegisterRoutes(r, authFn, decodeProposalOptions, proposalOptionsExecutor(ctrl), scheduler) username.RegisterRoutes(r, authFn) msgfee.RegisterRoutes(r, authFn) + blueaccount.RegisterRoutes(r, authFn) return r } @@ -112,6 +114,7 @@ func QueryRouter(minFee coin.Coin) weave.QueryRouter { gov.RegisterQuery, username.RegisterQuery, cron.RegisterQuery, + blueaccount.RegisterQuery, ) return r } diff --git a/cmd/bnsd/app/codec.pb.go b/cmd/bnsd/app/codec.pb.go index 1b72dddb..316f2768 100644 --- a/cmd/bnsd/app/codec.pb.go +++ b/cmd/bnsd/app/codec.pb.go @@ -8,6 +8,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_iov_one_weave "github.com/iov-one/weave" + blueaccount "github.com/iov-one/weave/cmd/bnsd/x/blueaccount" username "github.com/iov-one/weave/cmd/bnsd/x/username" migration "github.com/iov-one/weave/migration" aswap "github.com/iov-one/weave/x/aswap" @@ -82,6 +83,15 @@ type Tx struct { // *Tx_GovUpdateElectorateMsg // *Tx_GovUpdateElectionRuleMsg // *Tx_MsgfeeSetMsgFeeMsg + // *Tx_BlueaccountRegisterDomainMsg + // *Tx_BlueaccountTransferDomainMsg + // *Tx_BlueaccountRenewDomainMsg + // *Tx_BlueaccountDeleteDomainMsg + // *Tx_BlueaccountRegisterAccountMsg + // *Tx_BlueaccountTransferAccountMsg + // *Tx_BlueaccountReplaceAccountTargetMsg + // *Tx_BlueaccountDeleteAccountMsg + // *Tx_BlueaccountUpdateConfigurationMsg Sum isTx_Sum `protobuf_oneof:"sum"` } @@ -202,33 +212,69 @@ type Tx_GovUpdateElectionRuleMsg struct { type Tx_MsgfeeSetMsgFeeMsg struct { MsgfeeSetMsgFeeMsg *msgfee.SetMsgFeeMsg `protobuf:"bytes,80,opt,name=msgfee_set_msg_fee_msg,json=msgfeeSetMsgFeeMsg,proto3,oneof"` } - -func (*Tx_CashSendMsg) isTx_Sum() {} -func (*Tx_EscrowCreateMsg) isTx_Sum() {} -func (*Tx_EscrowReleaseMsg) isTx_Sum() {} -func (*Tx_EscrowReturnMsg) isTx_Sum() {} -func (*Tx_EscrowUpdatePartiesMsg) isTx_Sum() {} -func (*Tx_MultisigCreateMsg) isTx_Sum() {} -func (*Tx_MultisigUpdateMsg) isTx_Sum() {} -func (*Tx_ValidatorsApplyDiffMsg) isTx_Sum() {} -func (*Tx_CurrencyCreateMsg) isTx_Sum() {} -func (*Tx_ExecuteBatchMsg) isTx_Sum() {} -func (*Tx_UsernameRegisterTokenMsg) isTx_Sum() {} -func (*Tx_UsernameTransferTokenMsg) isTx_Sum() {} -func (*Tx_UsernameChangeTokenTargetsMsg) isTx_Sum() {} -func (*Tx_DistributionCreateMsg) isTx_Sum() {} -func (*Tx_DistributionMsg) isTx_Sum() {} -func (*Tx_DistributionResetMsg) isTx_Sum() {} -func (*Tx_MigrationUpgradeSchemaMsg) isTx_Sum() {} -func (*Tx_AswapCreateMsg) isTx_Sum() {} -func (*Tx_AswapReleaseMsg) isTx_Sum() {} -func (*Tx_AswapReturnMsg) isTx_Sum() {} -func (*Tx_GovCreateProposalMsg) isTx_Sum() {} -func (*Tx_GovDeleteProposalMsg) isTx_Sum() {} -func (*Tx_GovVoteMsg) isTx_Sum() {} -func (*Tx_GovUpdateElectorateMsg) isTx_Sum() {} -func (*Tx_GovUpdateElectionRuleMsg) isTx_Sum() {} -func (*Tx_MsgfeeSetMsgFeeMsg) isTx_Sum() {} +type Tx_BlueaccountRegisterDomainMsg struct { + BlueaccountRegisterDomainMsg *blueaccount.RegisterDomainMsg `protobuf:"bytes,81,opt,name=blueaccount_register_domain_msg,json=blueaccountRegisterDomainMsg,proto3,oneof"` +} +type Tx_BlueaccountTransferDomainMsg struct { + BlueaccountTransferDomainMsg *blueaccount.TransferDomainMsg `protobuf:"bytes,82,opt,name=blueaccount_transfer_domain_msg,json=blueaccountTransferDomainMsg,proto3,oneof"` +} +type Tx_BlueaccountRenewDomainMsg struct { + BlueaccountRenewDomainMsg *blueaccount.RenewDomainMsg `protobuf:"bytes,83,opt,name=blueaccount_renew_domain_msg,json=blueaccountRenewDomainMsg,proto3,oneof"` +} +type Tx_BlueaccountDeleteDomainMsg struct { + BlueaccountDeleteDomainMsg *blueaccount.DeleteDomainMsg `protobuf:"bytes,84,opt,name=blueaccount_delete_domain_msg,json=blueaccountDeleteDomainMsg,proto3,oneof"` +} +type Tx_BlueaccountRegisterAccountMsg struct { + BlueaccountRegisterAccountMsg *blueaccount.RegisterAccountMsg `protobuf:"bytes,85,opt,name=blueaccount_register_account_msg,json=blueaccountRegisterAccountMsg,proto3,oneof"` +} +type Tx_BlueaccountTransferAccountMsg struct { + BlueaccountTransferAccountMsg *blueaccount.TransferAccountMsg `protobuf:"bytes,86,opt,name=blueaccount_transfer_account_msg,json=blueaccountTransferAccountMsg,proto3,oneof"` +} +type Tx_BlueaccountReplaceAccountTargetMsg struct { + BlueaccountReplaceAccountTargetMsg *blueaccount.ReplaceAccountTargetsMsg `protobuf:"bytes,87,opt,name=blueaccount_replace_account_target_msg,json=blueaccountReplaceAccountTargetMsg,proto3,oneof"` +} +type Tx_BlueaccountDeleteAccountMsg struct { + BlueaccountDeleteAccountMsg *blueaccount.DeleteAccountMsg `protobuf:"bytes,88,opt,name=blueaccount_delete_account_msg,json=blueaccountDeleteAccountMsg,proto3,oneof"` +} +type Tx_BlueaccountUpdateConfigurationMsg struct { + BlueaccountUpdateConfigurationMsg *blueaccount.UpdateConfigurationMsg `protobuf:"bytes,89,opt,name=blueaccount_update_configuration_msg,json=blueaccountUpdateConfigurationMsg,proto3,oneof"` +} + +func (*Tx_CashSendMsg) isTx_Sum() {} +func (*Tx_EscrowCreateMsg) isTx_Sum() {} +func (*Tx_EscrowReleaseMsg) isTx_Sum() {} +func (*Tx_EscrowReturnMsg) isTx_Sum() {} +func (*Tx_EscrowUpdatePartiesMsg) isTx_Sum() {} +func (*Tx_MultisigCreateMsg) isTx_Sum() {} +func (*Tx_MultisigUpdateMsg) isTx_Sum() {} +func (*Tx_ValidatorsApplyDiffMsg) isTx_Sum() {} +func (*Tx_CurrencyCreateMsg) isTx_Sum() {} +func (*Tx_ExecuteBatchMsg) isTx_Sum() {} +func (*Tx_UsernameRegisterTokenMsg) isTx_Sum() {} +func (*Tx_UsernameTransferTokenMsg) isTx_Sum() {} +func (*Tx_UsernameChangeTokenTargetsMsg) isTx_Sum() {} +func (*Tx_DistributionCreateMsg) isTx_Sum() {} +func (*Tx_DistributionMsg) isTx_Sum() {} +func (*Tx_DistributionResetMsg) isTx_Sum() {} +func (*Tx_MigrationUpgradeSchemaMsg) isTx_Sum() {} +func (*Tx_AswapCreateMsg) isTx_Sum() {} +func (*Tx_AswapReleaseMsg) isTx_Sum() {} +func (*Tx_AswapReturnMsg) isTx_Sum() {} +func (*Tx_GovCreateProposalMsg) isTx_Sum() {} +func (*Tx_GovDeleteProposalMsg) isTx_Sum() {} +func (*Tx_GovVoteMsg) isTx_Sum() {} +func (*Tx_GovUpdateElectorateMsg) isTx_Sum() {} +func (*Tx_GovUpdateElectionRuleMsg) isTx_Sum() {} +func (*Tx_MsgfeeSetMsgFeeMsg) isTx_Sum() {} +func (*Tx_BlueaccountRegisterDomainMsg) isTx_Sum() {} +func (*Tx_BlueaccountTransferDomainMsg) isTx_Sum() {} +func (*Tx_BlueaccountRenewDomainMsg) isTx_Sum() {} +func (*Tx_BlueaccountDeleteDomainMsg) isTx_Sum() {} +func (*Tx_BlueaccountRegisterAccountMsg) isTx_Sum() {} +func (*Tx_BlueaccountTransferAccountMsg) isTx_Sum() {} +func (*Tx_BlueaccountReplaceAccountTargetMsg) isTx_Sum() {} +func (*Tx_BlueaccountDeleteAccountMsg) isTx_Sum() {} +func (*Tx_BlueaccountUpdateConfigurationMsg) isTx_Sum() {} func (m *Tx) GetSum() isTx_Sum { if m != nil { @@ -440,6 +486,69 @@ func (m *Tx) GetMsgfeeSetMsgFeeMsg() *msgfee.SetMsgFeeMsg { return nil } +func (m *Tx) GetBlueaccountRegisterDomainMsg() *blueaccount.RegisterDomainMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountRegisterDomainMsg); ok { + return x.BlueaccountRegisterDomainMsg + } + return nil +} + +func (m *Tx) GetBlueaccountTransferDomainMsg() *blueaccount.TransferDomainMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountTransferDomainMsg); ok { + return x.BlueaccountTransferDomainMsg + } + return nil +} + +func (m *Tx) GetBlueaccountRenewDomainMsg() *blueaccount.RenewDomainMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountRenewDomainMsg); ok { + return x.BlueaccountRenewDomainMsg + } + return nil +} + +func (m *Tx) GetBlueaccountDeleteDomainMsg() *blueaccount.DeleteDomainMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountDeleteDomainMsg); ok { + return x.BlueaccountDeleteDomainMsg + } + return nil +} + +func (m *Tx) GetBlueaccountRegisterAccountMsg() *blueaccount.RegisterAccountMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountRegisterAccountMsg); ok { + return x.BlueaccountRegisterAccountMsg + } + return nil +} + +func (m *Tx) GetBlueaccountTransferAccountMsg() *blueaccount.TransferAccountMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountTransferAccountMsg); ok { + return x.BlueaccountTransferAccountMsg + } + return nil +} + +func (m *Tx) GetBlueaccountReplaceAccountTargetMsg() *blueaccount.ReplaceAccountTargetsMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountReplaceAccountTargetMsg); ok { + return x.BlueaccountReplaceAccountTargetMsg + } + return nil +} + +func (m *Tx) GetBlueaccountDeleteAccountMsg() *blueaccount.DeleteAccountMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountDeleteAccountMsg); ok { + return x.BlueaccountDeleteAccountMsg + } + return nil +} + +func (m *Tx) GetBlueaccountUpdateConfigurationMsg() *blueaccount.UpdateConfigurationMsg { + if x, ok := m.GetSum().(*Tx_BlueaccountUpdateConfigurationMsg); ok { + return x.BlueaccountUpdateConfigurationMsg + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*Tx) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Tx_OneofMarshaler, _Tx_OneofUnmarshaler, _Tx_OneofSizer, []interface{}{ @@ -469,6 +578,15 @@ func (*Tx) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, fun (*Tx_GovUpdateElectorateMsg)(nil), (*Tx_GovUpdateElectionRuleMsg)(nil), (*Tx_MsgfeeSetMsgFeeMsg)(nil), + (*Tx_BlueaccountRegisterDomainMsg)(nil), + (*Tx_BlueaccountTransferDomainMsg)(nil), + (*Tx_BlueaccountRenewDomainMsg)(nil), + (*Tx_BlueaccountDeleteDomainMsg)(nil), + (*Tx_BlueaccountRegisterAccountMsg)(nil), + (*Tx_BlueaccountTransferAccountMsg)(nil), + (*Tx_BlueaccountReplaceAccountTargetMsg)(nil), + (*Tx_BlueaccountDeleteAccountMsg)(nil), + (*Tx_BlueaccountUpdateConfigurationMsg)(nil), } } @@ -606,6 +724,51 @@ func _Tx_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.MsgfeeSetMsgFeeMsg); err != nil { return err } + case *Tx_BlueaccountRegisterDomainMsg: + _ = b.EncodeVarint(81<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterDomainMsg); err != nil { + return err + } + case *Tx_BlueaccountTransferDomainMsg: + _ = b.EncodeVarint(82<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferDomainMsg); err != nil { + return err + } + case *Tx_BlueaccountRenewDomainMsg: + _ = b.EncodeVarint(83<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRenewDomainMsg); err != nil { + return err + } + case *Tx_BlueaccountDeleteDomainMsg: + _ = b.EncodeVarint(84<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteDomainMsg); err != nil { + return err + } + case *Tx_BlueaccountRegisterAccountMsg: + _ = b.EncodeVarint(85<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterAccountMsg); err != nil { + return err + } + case *Tx_BlueaccountTransferAccountMsg: + _ = b.EncodeVarint(86<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferAccountMsg); err != nil { + return err + } + case *Tx_BlueaccountReplaceAccountTargetMsg: + _ = b.EncodeVarint(87<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountReplaceAccountTargetMsg); err != nil { + return err + } + case *Tx_BlueaccountDeleteAccountMsg: + _ = b.EncodeVarint(88<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteAccountMsg); err != nil { + return err + } + case *Tx_BlueaccountUpdateConfigurationMsg: + _ = b.EncodeVarint(89<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountUpdateConfigurationMsg); err != nil { + return err + } case nil: default: return fmt.Errorf("Tx.Sum has unexpected type %T", x) @@ -824,6 +987,78 @@ func _Tx_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bo err := b.DecodeMessage(msg) m.Sum = &Tx_MsgfeeSetMsgFeeMsg{msg} return true, err + case 81: // sum.blueaccount_register_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountRegisterDomainMsg{msg} + return true, err + case 82: // sum.blueaccount_transfer_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountTransferDomainMsg{msg} + return true, err + case 83: // sum.blueaccount_renew_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RenewDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountRenewDomainMsg{msg} + return true, err + case 84: // sum.blueaccount_delete_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountDeleteDomainMsg{msg} + return true, err + case 85: // sum.blueaccount_register_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountRegisterAccountMsg{msg} + return true, err + case 86: // sum.blueaccount_transfer_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountTransferAccountMsg{msg} + return true, err + case 87: // sum.blueaccount_replace_account_target_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.ReplaceAccountTargetsMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountReplaceAccountTargetMsg{msg} + return true, err + case 88: // sum.blueaccount_delete_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountDeleteAccountMsg{msg} + return true, err + case 89: // sum.blueaccount_update_configuration_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.UpdateConfigurationMsg) + err := b.DecodeMessage(msg) + m.Sum = &Tx_BlueaccountUpdateConfigurationMsg{msg} + return true, err default: return false, nil } @@ -963,6 +1198,51 @@ func _Tx_OneofSizer(msg proto.Message) (n int) { n += 2 // tag and wire n += proto.SizeVarint(uint64(s)) n += s + case *Tx_BlueaccountRegisterDomainMsg: + s := proto.Size(x.BlueaccountRegisterDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountTransferDomainMsg: + s := proto.Size(x.BlueaccountTransferDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountRenewDomainMsg: + s := proto.Size(x.BlueaccountRenewDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountDeleteDomainMsg: + s := proto.Size(x.BlueaccountDeleteDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountRegisterAccountMsg: + s := proto.Size(x.BlueaccountRegisterAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountTransferAccountMsg: + s := proto.Size(x.BlueaccountTransferAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountReplaceAccountTargetMsg: + s := proto.Size(x.BlueaccountReplaceAccountTargetMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountDeleteAccountMsg: + s := proto.Size(x.BlueaccountDeleteAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Tx_BlueaccountUpdateConfigurationMsg: + s := proto.Size(x.BlueaccountUpdateConfigurationMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -1033,6 +1313,15 @@ type ExecuteBatchMsg_Union struct { // *ExecuteBatchMsg_Union_DistributionMsg // *ExecuteBatchMsg_Union_DistributionResetMsg // *ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg + // *ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg + // *ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg + // *ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg + // *ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg + // *ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg + // *ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg + // *ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg + // *ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg + // *ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg Sum isExecuteBatchMsg_Union_Sum `protobuf_oneof:"sum"` } @@ -1123,23 +1412,59 @@ type ExecuteBatchMsg_Union_DistributionResetMsg struct { type ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg struct { MsgfeeSetMsgFeeMsg *msgfee.SetMsgFeeMsg `protobuf:"bytes,80,opt,name=msgfee_set_msg_fee_msg,json=msgfeeSetMsgFeeMsg,proto3,oneof"` } - -func (*ExecuteBatchMsg_Union_CashSendMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_EscrowCreateMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_EscrowReleaseMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_EscrowReturnMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_EscrowUpdatePartiesMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_MultisigCreateMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_MultisigUpdateMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_ValidatorsApplyDiffMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_CurrencyCreateMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_UsernameRegisterTokenMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_UsernameTransferTokenMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_UsernameChangeTokenTargetsMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_DistributionCreateMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_DistributionMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_DistributionResetMsg) isExecuteBatchMsg_Union_Sum() {} -func (*ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg) isExecuteBatchMsg_Union_Sum() {} +type ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg struct { + BlueaccountRegisterDomainMsg *blueaccount.RegisterDomainMsg `protobuf:"bytes,81,opt,name=blueaccount_register_domain_msg,json=blueaccountRegisterDomainMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg struct { + BlueaccountTransferDomainMsg *blueaccount.TransferDomainMsg `protobuf:"bytes,82,opt,name=blueaccount_transfer_domain_msg,json=blueaccountTransferDomainMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg struct { + BlueaccountRenewDomainMsg *blueaccount.RenewDomainMsg `protobuf:"bytes,83,opt,name=blueaccount_renew_domain_msg,json=blueaccountRenewDomainMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg struct { + BlueaccountDeleteDomainMsg *blueaccount.DeleteDomainMsg `protobuf:"bytes,84,opt,name=blueaccount_delete_domain_msg,json=blueaccountDeleteDomainMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg struct { + BlueaccountRegisterAccountMsg *blueaccount.RegisterAccountMsg `protobuf:"bytes,85,opt,name=blueaccount_register_account_msg,json=blueaccountRegisterAccountMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg struct { + BlueaccountTransferAccountMsg *blueaccount.TransferAccountMsg `protobuf:"bytes,86,opt,name=blueaccount_transfer_account_msg,json=blueaccountTransferAccountMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg struct { + BlueaccountReplaceAccountTargetMsg *blueaccount.ReplaceAccountTargetsMsg `protobuf:"bytes,87,opt,name=blueaccount_replace_account_target_msg,json=blueaccountReplaceAccountTargetMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg struct { + BlueaccountDeleteAccountMsg *blueaccount.DeleteAccountMsg `protobuf:"bytes,88,opt,name=blueaccount_delete_account_msg,json=blueaccountDeleteAccountMsg,proto3,oneof"` +} +type ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg struct { + BlueaccountUpdateConfigurationMsg *blueaccount.UpdateConfigurationMsg `protobuf:"bytes,89,opt,name=blueaccount_update_configuration_msg,json=blueaccountUpdateConfigurationMsg,proto3,oneof"` +} + +func (*ExecuteBatchMsg_Union_CashSendMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_EscrowCreateMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_EscrowReleaseMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_EscrowReturnMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_EscrowUpdatePartiesMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_MultisigCreateMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_MultisigUpdateMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_ValidatorsApplyDiffMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_CurrencyCreateMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_UsernameRegisterTokenMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_UsernameTransferTokenMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_UsernameChangeTokenTargetsMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_DistributionCreateMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_DistributionMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_DistributionResetMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg) isExecuteBatchMsg_Union_Sum() {} +func (*ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg) isExecuteBatchMsg_Union_Sum() {} func (m *ExecuteBatchMsg_Union) GetSum() isExecuteBatchMsg_Union_Sum { if m != nil { @@ -1260,6 +1585,69 @@ func (m *ExecuteBatchMsg_Union) GetMsgfeeSetMsgFeeMsg() *msgfee.SetMsgFeeMsg { return nil } +func (m *ExecuteBatchMsg_Union) GetBlueaccountRegisterDomainMsg() *blueaccount.RegisterDomainMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg); ok { + return x.BlueaccountRegisterDomainMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountTransferDomainMsg() *blueaccount.TransferDomainMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg); ok { + return x.BlueaccountTransferDomainMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountRenewDomainMsg() *blueaccount.RenewDomainMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg); ok { + return x.BlueaccountRenewDomainMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountDeleteDomainMsg() *blueaccount.DeleteDomainMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg); ok { + return x.BlueaccountDeleteDomainMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountRegisterAccountMsg() *blueaccount.RegisterAccountMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg); ok { + return x.BlueaccountRegisterAccountMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountTransferAccountMsg() *blueaccount.TransferAccountMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg); ok { + return x.BlueaccountTransferAccountMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountReplaceAccountTargetMsg() *blueaccount.ReplaceAccountTargetsMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg); ok { + return x.BlueaccountReplaceAccountTargetMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountDeleteAccountMsg() *blueaccount.DeleteAccountMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg); ok { + return x.BlueaccountDeleteAccountMsg + } + return nil +} + +func (m *ExecuteBatchMsg_Union) GetBlueaccountUpdateConfigurationMsg() *blueaccount.UpdateConfigurationMsg { + if x, ok := m.GetSum().(*ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg); ok { + return x.BlueaccountUpdateConfigurationMsg + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*ExecuteBatchMsg_Union) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ExecuteBatchMsg_Union_OneofMarshaler, _ExecuteBatchMsg_Union_OneofUnmarshaler, _ExecuteBatchMsg_Union_OneofSizer, []interface{}{ @@ -1279,6 +1667,15 @@ func (*ExecuteBatchMsg_Union) XXX_OneofFuncs() (func(msg proto.Message, b *proto (*ExecuteBatchMsg_Union_DistributionMsg)(nil), (*ExecuteBatchMsg_Union_DistributionResetMsg)(nil), (*ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg)(nil), + (*ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg)(nil), } } @@ -1366,6 +1763,51 @@ func _ExecuteBatchMsg_Union_OneofMarshaler(msg proto.Message, b *proto.Buffer) e if err := b.EncodeMessage(x.MsgfeeSetMsgFeeMsg); err != nil { return err } + case *ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg: + _ = b.EncodeVarint(81<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterDomainMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg: + _ = b.EncodeVarint(82<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferDomainMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg: + _ = b.EncodeVarint(83<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRenewDomainMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg: + _ = b.EncodeVarint(84<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteDomainMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg: + _ = b.EncodeVarint(85<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterAccountMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg: + _ = b.EncodeVarint(86<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferAccountMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg: + _ = b.EncodeVarint(87<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountReplaceAccountTargetMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg: + _ = b.EncodeVarint(88<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteAccountMsg); err != nil { + return err + } + case *ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg: + _ = b.EncodeVarint(89<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountUpdateConfigurationMsg); err != nil { + return err + } case nil: default: return fmt.Errorf("ExecuteBatchMsg_Union.Sum has unexpected type %T", x) @@ -1504,6 +1946,78 @@ func _ExecuteBatchMsg_Union_OneofUnmarshaler(msg proto.Message, tag, wire int, b err := b.DecodeMessage(msg) m.Sum = &ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg{msg} return true, err + case 81: // sum.blueaccount_register_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg{msg} + return true, err + case 82: // sum.blueaccount_transfer_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg{msg} + return true, err + case 83: // sum.blueaccount_renew_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RenewDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg{msg} + return true, err + case 84: // sum.blueaccount_delete_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg{msg} + return true, err + case 85: // sum.blueaccount_register_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg{msg} + return true, err + case 86: // sum.blueaccount_transfer_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg{msg} + return true, err + case 87: // sum.blueaccount_replace_account_target_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.ReplaceAccountTargetsMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg{msg} + return true, err + case 88: // sum.blueaccount_delete_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg{msg} + return true, err + case 89: // sum.blueaccount_update_configuration_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.UpdateConfigurationMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg{msg} + return true, err default: return false, nil } @@ -1593,6 +2107,51 @@ func _ExecuteBatchMsg_Union_OneofSizer(msg proto.Message) (n int) { n += 2 // tag and wire n += proto.SizeVarint(uint64(s)) n += s + case *ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg: + s := proto.Size(x.BlueaccountRegisterDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg: + s := proto.Size(x.BlueaccountTransferDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg: + s := proto.Size(x.BlueaccountRenewDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg: + s := proto.Size(x.BlueaccountDeleteDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg: + s := proto.Size(x.BlueaccountRegisterAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg: + s := proto.Size(x.BlueaccountTransferAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg: + s := proto.Size(x.BlueaccountReplaceAccountTargetMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg: + s := proto.Size(x.BlueaccountDeleteAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg: + s := proto.Size(x.BlueaccountUpdateConfigurationMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -1622,6 +2181,15 @@ type ProposalOptions struct { // *ProposalOptions_GovUpdateElectionRuleMsg // *ProposalOptions_GovCreateTextResolutionMsg // *ProposalOptions_MsgfeeSetMsgFeeMsg + // *ProposalOptions_BlueaccountRegisterDomainMsg + // *ProposalOptions_BlueaccountTransferDomainMsg + // *ProposalOptions_BlueaccountRenewDomainMsg + // *ProposalOptions_BlueaccountDeleteDomainMsg + // *ProposalOptions_BlueaccountRegisterAccountMsg + // *ProposalOptions_BlueaccountTransferAccountMsg + // *ProposalOptions_BlueaccountReplaceAccountTargetMsg + // *ProposalOptions_BlueaccountDeleteAccountMsg + // *ProposalOptions_BlueaccountUpdateConfigurationMsg Option isProposalOptions_Option `protobuf_oneof:"option"` } @@ -1718,25 +2286,61 @@ type ProposalOptions_GovCreateTextResolutionMsg struct { type ProposalOptions_MsgfeeSetMsgFeeMsg struct { MsgfeeSetMsgFeeMsg *msgfee.SetMsgFeeMsg `protobuf:"bytes,80,opt,name=msgfee_set_msg_fee_msg,json=msgfeeSetMsgFeeMsg,proto3,oneof"` } - -func (*ProposalOptions_CashSendMsg) isProposalOptions_Option() {} -func (*ProposalOptions_EscrowReleaseMsg) isProposalOptions_Option() {} -func (*ProposalOptions_UpdateEscrowPartiesMsg) isProposalOptions_Option() {} -func (*ProposalOptions_MultisigUpdateMsg) isProposalOptions_Option() {} -func (*ProposalOptions_ValidatorsApplyDiffMsg) isProposalOptions_Option() {} -func (*ProposalOptions_CurrencyCreateMsg) isProposalOptions_Option() {} -func (*ProposalOptions_ExecuteProposalBatchMsg) isProposalOptions_Option() {} -func (*ProposalOptions_UsernameRegisterTokenMsg) isProposalOptions_Option() {} -func (*ProposalOptions_UsernameTransferTokenMsg) isProposalOptions_Option() {} -func (*ProposalOptions_UsernameChangeTokenTargetsMsg) isProposalOptions_Option() {} -func (*ProposalOptions_DistributionCreateMsg) isProposalOptions_Option() {} -func (*ProposalOptions_DistributionMsg) isProposalOptions_Option() {} -func (*ProposalOptions_DistributionResetMsg) isProposalOptions_Option() {} -func (*ProposalOptions_MigrationUpgradeSchemaMsg) isProposalOptions_Option() {} -func (*ProposalOptions_GovUpdateElectorateMsg) isProposalOptions_Option() {} -func (*ProposalOptions_GovUpdateElectionRuleMsg) isProposalOptions_Option() {} -func (*ProposalOptions_GovCreateTextResolutionMsg) isProposalOptions_Option() {} -func (*ProposalOptions_MsgfeeSetMsgFeeMsg) isProposalOptions_Option() {} +type ProposalOptions_BlueaccountRegisterDomainMsg struct { + BlueaccountRegisterDomainMsg *blueaccount.RegisterDomainMsg `protobuf:"bytes,81,opt,name=blueaccount_register_domain_msg,json=blueaccountRegisterDomainMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountTransferDomainMsg struct { + BlueaccountTransferDomainMsg *blueaccount.TransferDomainMsg `protobuf:"bytes,82,opt,name=blueaccount_transfer_domain_msg,json=blueaccountTransferDomainMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountRenewDomainMsg struct { + BlueaccountRenewDomainMsg *blueaccount.RenewDomainMsg `protobuf:"bytes,83,opt,name=blueaccount_renew_domain_msg,json=blueaccountRenewDomainMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountDeleteDomainMsg struct { + BlueaccountDeleteDomainMsg *blueaccount.DeleteDomainMsg `protobuf:"bytes,84,opt,name=blueaccount_delete_domain_msg,json=blueaccountDeleteDomainMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountRegisterAccountMsg struct { + BlueaccountRegisterAccountMsg *blueaccount.RegisterAccountMsg `protobuf:"bytes,85,opt,name=blueaccount_register_account_msg,json=blueaccountRegisterAccountMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountTransferAccountMsg struct { + BlueaccountTransferAccountMsg *blueaccount.TransferAccountMsg `protobuf:"bytes,86,opt,name=blueaccount_transfer_account_msg,json=blueaccountTransferAccountMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountReplaceAccountTargetMsg struct { + BlueaccountReplaceAccountTargetMsg *blueaccount.ReplaceAccountTargetsMsg `protobuf:"bytes,87,opt,name=blueaccount_replace_account_target_msg,json=blueaccountReplaceAccountTargetMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountDeleteAccountMsg struct { + BlueaccountDeleteAccountMsg *blueaccount.DeleteAccountMsg `protobuf:"bytes,88,opt,name=blueaccount_delete_account_msg,json=blueaccountDeleteAccountMsg,proto3,oneof"` +} +type ProposalOptions_BlueaccountUpdateConfigurationMsg struct { + BlueaccountUpdateConfigurationMsg *blueaccount.UpdateConfigurationMsg `protobuf:"bytes,89,opt,name=blueaccount_update_configuration_msg,json=blueaccountUpdateConfigurationMsg,proto3,oneof"` +} + +func (*ProposalOptions_CashSendMsg) isProposalOptions_Option() {} +func (*ProposalOptions_EscrowReleaseMsg) isProposalOptions_Option() {} +func (*ProposalOptions_UpdateEscrowPartiesMsg) isProposalOptions_Option() {} +func (*ProposalOptions_MultisigUpdateMsg) isProposalOptions_Option() {} +func (*ProposalOptions_ValidatorsApplyDiffMsg) isProposalOptions_Option() {} +func (*ProposalOptions_CurrencyCreateMsg) isProposalOptions_Option() {} +func (*ProposalOptions_ExecuteProposalBatchMsg) isProposalOptions_Option() {} +func (*ProposalOptions_UsernameRegisterTokenMsg) isProposalOptions_Option() {} +func (*ProposalOptions_UsernameTransferTokenMsg) isProposalOptions_Option() {} +func (*ProposalOptions_UsernameChangeTokenTargetsMsg) isProposalOptions_Option() {} +func (*ProposalOptions_DistributionCreateMsg) isProposalOptions_Option() {} +func (*ProposalOptions_DistributionMsg) isProposalOptions_Option() {} +func (*ProposalOptions_DistributionResetMsg) isProposalOptions_Option() {} +func (*ProposalOptions_MigrationUpgradeSchemaMsg) isProposalOptions_Option() {} +func (*ProposalOptions_GovUpdateElectorateMsg) isProposalOptions_Option() {} +func (*ProposalOptions_GovUpdateElectionRuleMsg) isProposalOptions_Option() {} +func (*ProposalOptions_GovCreateTextResolutionMsg) isProposalOptions_Option() {} +func (*ProposalOptions_MsgfeeSetMsgFeeMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountRegisterDomainMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountTransferDomainMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountRenewDomainMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountDeleteDomainMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountRegisterAccountMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountTransferAccountMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountReplaceAccountTargetMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountDeleteAccountMsg) isProposalOptions_Option() {} +func (*ProposalOptions_BlueaccountUpdateConfigurationMsg) isProposalOptions_Option() {} func (m *ProposalOptions) GetOption() isProposalOptions_Option { if m != nil { @@ -1871,7 +2475,70 @@ func (m *ProposalOptions) GetMsgfeeSetMsgFeeMsg() *msgfee.SetMsgFeeMsg { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. +func (m *ProposalOptions) GetBlueaccountRegisterDomainMsg() *blueaccount.RegisterDomainMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountRegisterDomainMsg); ok { + return x.BlueaccountRegisterDomainMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountTransferDomainMsg() *blueaccount.TransferDomainMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountTransferDomainMsg); ok { + return x.BlueaccountTransferDomainMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountRenewDomainMsg() *blueaccount.RenewDomainMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountRenewDomainMsg); ok { + return x.BlueaccountRenewDomainMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountDeleteDomainMsg() *blueaccount.DeleteDomainMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountDeleteDomainMsg); ok { + return x.BlueaccountDeleteDomainMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountRegisterAccountMsg() *blueaccount.RegisterAccountMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountRegisterAccountMsg); ok { + return x.BlueaccountRegisterAccountMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountTransferAccountMsg() *blueaccount.TransferAccountMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountTransferAccountMsg); ok { + return x.BlueaccountTransferAccountMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountReplaceAccountTargetMsg() *blueaccount.ReplaceAccountTargetsMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountReplaceAccountTargetMsg); ok { + return x.BlueaccountReplaceAccountTargetMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountDeleteAccountMsg() *blueaccount.DeleteAccountMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountDeleteAccountMsg); ok { + return x.BlueaccountDeleteAccountMsg + } + return nil +} + +func (m *ProposalOptions) GetBlueaccountUpdateConfigurationMsg() *blueaccount.UpdateConfigurationMsg { + if x, ok := m.GetOption().(*ProposalOptions_BlueaccountUpdateConfigurationMsg); ok { + return x.BlueaccountUpdateConfigurationMsg + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. func (*ProposalOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ProposalOptions_OneofMarshaler, _ProposalOptions_OneofUnmarshaler, _ProposalOptions_OneofSizer, []interface{}{ (*ProposalOptions_CashSendMsg)(nil), @@ -1892,6 +2559,15 @@ func (*ProposalOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffe (*ProposalOptions_GovUpdateElectionRuleMsg)(nil), (*ProposalOptions_GovCreateTextResolutionMsg)(nil), (*ProposalOptions_MsgfeeSetMsgFeeMsg)(nil), + (*ProposalOptions_BlueaccountRegisterDomainMsg)(nil), + (*ProposalOptions_BlueaccountTransferDomainMsg)(nil), + (*ProposalOptions_BlueaccountRenewDomainMsg)(nil), + (*ProposalOptions_BlueaccountDeleteDomainMsg)(nil), + (*ProposalOptions_BlueaccountRegisterAccountMsg)(nil), + (*ProposalOptions_BlueaccountTransferAccountMsg)(nil), + (*ProposalOptions_BlueaccountReplaceAccountTargetMsg)(nil), + (*ProposalOptions_BlueaccountDeleteAccountMsg)(nil), + (*ProposalOptions_BlueaccountUpdateConfigurationMsg)(nil), } } @@ -1989,6 +2665,51 @@ func _ProposalOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.MsgfeeSetMsgFeeMsg); err != nil { return err } + case *ProposalOptions_BlueaccountRegisterDomainMsg: + _ = b.EncodeVarint(81<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterDomainMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountTransferDomainMsg: + _ = b.EncodeVarint(82<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferDomainMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountRenewDomainMsg: + _ = b.EncodeVarint(83<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRenewDomainMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountDeleteDomainMsg: + _ = b.EncodeVarint(84<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteDomainMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountRegisterAccountMsg: + _ = b.EncodeVarint(85<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterAccountMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountTransferAccountMsg: + _ = b.EncodeVarint(86<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferAccountMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountReplaceAccountTargetMsg: + _ = b.EncodeVarint(87<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountReplaceAccountTargetMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountDeleteAccountMsg: + _ = b.EncodeVarint(88<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteAccountMsg); err != nil { + return err + } + case *ProposalOptions_BlueaccountUpdateConfigurationMsg: + _ = b.EncodeVarint(89<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountUpdateConfigurationMsg); err != nil { + return err + } case nil: default: return fmt.Errorf("ProposalOptions.Option has unexpected type %T", x) @@ -2143,6 +2864,78 @@ func _ProposalOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *prot err := b.DecodeMessage(msg) m.Option = &ProposalOptions_MsgfeeSetMsgFeeMsg{msg} return true, err + case 81: // option.blueaccount_register_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterDomainMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountRegisterDomainMsg{msg} + return true, err + case 82: // option.blueaccount_transfer_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferDomainMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountTransferDomainMsg{msg} + return true, err + case 83: // option.blueaccount_renew_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RenewDomainMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountRenewDomainMsg{msg} + return true, err + case 84: // option.blueaccount_delete_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteDomainMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountDeleteDomainMsg{msg} + return true, err + case 85: // option.blueaccount_register_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterAccountMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountRegisterAccountMsg{msg} + return true, err + case 86: // option.blueaccount_transfer_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferAccountMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountTransferAccountMsg{msg} + return true, err + case 87: // option.blueaccount_replace_account_target_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.ReplaceAccountTargetsMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountReplaceAccountTargetMsg{msg} + return true, err + case 88: // option.blueaccount_delete_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteAccountMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountDeleteAccountMsg{msg} + return true, err + case 89: // option.blueaccount_update_configuration_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.UpdateConfigurationMsg) + err := b.DecodeMessage(msg) + m.Option = &ProposalOptions_BlueaccountUpdateConfigurationMsg{msg} + return true, err default: return false, nil } @@ -2242,6 +3035,51 @@ func _ProposalOptions_OneofSizer(msg proto.Message) (n int) { n += 2 // tag and wire n += proto.SizeVarint(uint64(s)) n += s + case *ProposalOptions_BlueaccountRegisterDomainMsg: + s := proto.Size(x.BlueaccountRegisterDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountTransferDomainMsg: + s := proto.Size(x.BlueaccountTransferDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountRenewDomainMsg: + s := proto.Size(x.BlueaccountRenewDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountDeleteDomainMsg: + s := proto.Size(x.BlueaccountDeleteDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountRegisterAccountMsg: + s := proto.Size(x.BlueaccountRegisterAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountTransferAccountMsg: + s := proto.Size(x.BlueaccountTransferAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountReplaceAccountTargetMsg: + s := proto.Size(x.BlueaccountReplaceAccountTargetMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountDeleteAccountMsg: + s := proto.Size(x.BlueaccountDeleteAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ProposalOptions_BlueaccountUpdateConfigurationMsg: + s := proto.Size(x.BlueaccountUpdateConfigurationMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -2310,6 +3148,15 @@ type ExecuteProposalBatchMsg_Union struct { // *ExecuteProposalBatchMsg_Union_GovUpdateElectionRuleMsg // *ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg // *ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg + // *ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg Sum isExecuteProposalBatchMsg_Union_Sum `protobuf_oneof:"sum"` } @@ -2397,6 +3244,33 @@ type ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg struct { type ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg struct { MsgfeeSetMsgFeeMsg *msgfee.SetMsgFeeMsg `protobuf:"bytes,80,opt,name=msgfee_set_msg_fee_msg,json=msgfeeSetMsgFeeMsg,proto3,oneof"` } +type ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg struct { + BlueaccountRegisterDomainMsg *blueaccount.RegisterDomainMsg `protobuf:"bytes,81,opt,name=blueaccount_register_domain_msg,json=blueaccountRegisterDomainMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg struct { + BlueaccountTransferDomainMsg *blueaccount.TransferDomainMsg `protobuf:"bytes,82,opt,name=blueaccount_transfer_domain_msg,json=blueaccountTransferDomainMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg struct { + BlueaccountRenewDomainMsg *blueaccount.RenewDomainMsg `protobuf:"bytes,83,opt,name=blueaccount_renew_domain_msg,json=blueaccountRenewDomainMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg struct { + BlueaccountDeleteDomainMsg *blueaccount.DeleteDomainMsg `protobuf:"bytes,84,opt,name=blueaccount_delete_domain_msg,json=blueaccountDeleteDomainMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg struct { + BlueaccountRegisterAccountMsg *blueaccount.RegisterAccountMsg `protobuf:"bytes,85,opt,name=blueaccount_register_account_msg,json=blueaccountRegisterAccountMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg struct { + BlueaccountTransferAccountMsg *blueaccount.TransferAccountMsg `protobuf:"bytes,86,opt,name=blueaccount_transfer_account_msg,json=blueaccountTransferAccountMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg struct { + BlueaccountReplaceAccountTargetMsg *blueaccount.ReplaceAccountTargetsMsg `protobuf:"bytes,87,opt,name=blueaccount_replace_account_target_msg,json=blueaccountReplaceAccountTargetMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg struct { + BlueaccountDeleteAccountMsg *blueaccount.DeleteAccountMsg `protobuf:"bytes,88,opt,name=blueaccount_delete_account_msg,json=blueaccountDeleteAccountMsg,proto3,oneof"` +} +type ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg struct { + BlueaccountUpdateConfigurationMsg *blueaccount.UpdateConfigurationMsg `protobuf:"bytes,89,opt,name=blueaccount_update_configuration_msg,json=blueaccountUpdateConfigurationMsg,proto3,oneof"` +} func (*ExecuteProposalBatchMsg_Union_SendMsg) isExecuteProposalBatchMsg_Union_Sum() {} func (*ExecuteProposalBatchMsg_Union_EscrowReleaseMsg) isExecuteProposalBatchMsg_Union_Sum() {} @@ -2415,6 +3289,24 @@ func (*ExecuteProposalBatchMsg_Union_GovUpdateElectionRuleMsg) isExecuteProposal func (*ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg) isExecuteProposalBatchMsg_Union_Sum() { } func (*ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg) isExecuteProposalBatchMsg_Union_Sum() {} +func (*ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg) isExecuteProposalBatchMsg_Union_Sum() { +} +func (*ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg) isExecuteProposalBatchMsg_Union_Sum() { +} func (m *ExecuteProposalBatchMsg_Union) GetSum() isExecuteProposalBatchMsg_Union_Sum { if m != nil { @@ -2528,6 +3420,69 @@ func (m *ExecuteProposalBatchMsg_Union) GetMsgfeeSetMsgFeeMsg() *msgfee.SetMsgFe return nil } +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountRegisterDomainMsg() *blueaccount.RegisterDomainMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg); ok { + return x.BlueaccountRegisterDomainMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountTransferDomainMsg() *blueaccount.TransferDomainMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg); ok { + return x.BlueaccountTransferDomainMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountRenewDomainMsg() *blueaccount.RenewDomainMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg); ok { + return x.BlueaccountRenewDomainMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountDeleteDomainMsg() *blueaccount.DeleteDomainMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg); ok { + return x.BlueaccountDeleteDomainMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountRegisterAccountMsg() *blueaccount.RegisterAccountMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg); ok { + return x.BlueaccountRegisterAccountMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountTransferAccountMsg() *blueaccount.TransferAccountMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg); ok { + return x.BlueaccountTransferAccountMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountReplaceAccountTargetMsg() *blueaccount.ReplaceAccountTargetsMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg); ok { + return x.BlueaccountReplaceAccountTargetMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountDeleteAccountMsg() *blueaccount.DeleteAccountMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg); ok { + return x.BlueaccountDeleteAccountMsg + } + return nil +} + +func (m *ExecuteProposalBatchMsg_Union) GetBlueaccountUpdateConfigurationMsg() *blueaccount.UpdateConfigurationMsg { + if x, ok := m.GetSum().(*ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg); ok { + return x.BlueaccountUpdateConfigurationMsg + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*ExecuteProposalBatchMsg_Union) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ExecuteProposalBatchMsg_Union_OneofMarshaler, _ExecuteProposalBatchMsg_Union_OneofUnmarshaler, _ExecuteProposalBatchMsg_Union_OneofSizer, []interface{}{ @@ -2546,6 +3501,15 @@ func (*ExecuteProposalBatchMsg_Union) XXX_OneofFuncs() (func(msg proto.Message, (*ExecuteProposalBatchMsg_Union_GovUpdateElectionRuleMsg)(nil), (*ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg)(nil), (*ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg)(nil), + (*ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg)(nil), } } @@ -2628,6 +3592,51 @@ func _ExecuteProposalBatchMsg_Union_OneofMarshaler(msg proto.Message, b *proto.B if err := b.EncodeMessage(x.MsgfeeSetMsgFeeMsg); err != nil { return err } + case *ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg: + _ = b.EncodeVarint(81<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterDomainMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg: + _ = b.EncodeVarint(82<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferDomainMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg: + _ = b.EncodeVarint(83<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRenewDomainMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg: + _ = b.EncodeVarint(84<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteDomainMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg: + _ = b.EncodeVarint(85<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountRegisterAccountMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg: + _ = b.EncodeVarint(86<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountTransferAccountMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg: + _ = b.EncodeVarint(87<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountReplaceAccountTargetMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg: + _ = b.EncodeVarint(88<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountDeleteAccountMsg); err != nil { + return err + } + case *ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg: + _ = b.EncodeVarint(89<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BlueaccountUpdateConfigurationMsg); err != nil { + return err + } case nil: default: return fmt.Errorf("ExecuteProposalBatchMsg_Union.Sum has unexpected type %T", x) @@ -2758,6 +3767,78 @@ func _ExecuteProposalBatchMsg_Union_OneofUnmarshaler(msg proto.Message, tag, wir err := b.DecodeMessage(msg) m.Sum = &ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg{msg} return true, err + case 81: // sum.blueaccount_register_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg{msg} + return true, err + case 82: // sum.blueaccount_transfer_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg{msg} + return true, err + case 83: // sum.blueaccount_renew_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RenewDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg{msg} + return true, err + case 84: // sum.blueaccount_delete_domain_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteDomainMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg{msg} + return true, err + case 85: // sum.blueaccount_register_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.RegisterAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg{msg} + return true, err + case 86: // sum.blueaccount_transfer_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.TransferAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg{msg} + return true, err + case 87: // sum.blueaccount_replace_account_target_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.ReplaceAccountTargetsMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg{msg} + return true, err + case 88: // sum.blueaccount_delete_account_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.DeleteAccountMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg{msg} + return true, err + case 89: // sum.blueaccount_update_configuration_msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(blueaccount.UpdateConfigurationMsg) + err := b.DecodeMessage(msg) + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg{msg} + return true, err default: return false, nil } @@ -2842,18 +3923,63 @@ func _ExecuteProposalBatchMsg_Union_OneofSizer(msg proto.Message) (n int) { n += 2 // tag and wire n += proto.SizeVarint(uint64(s)) n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// CronTask is a format used by the CronMarshaler to marshal and unmarshal cron -// task. -// -// When there is a gap in message sequence numbers - that most likely means some -// old fields got deprecated. This is done to maintain binary compatibility. + case *ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg: + s := proto.Size(x.BlueaccountRegisterDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg: + s := proto.Size(x.BlueaccountTransferDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg: + s := proto.Size(x.BlueaccountRenewDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg: + s := proto.Size(x.BlueaccountDeleteDomainMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg: + s := proto.Size(x.BlueaccountRegisterAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg: + s := proto.Size(x.BlueaccountTransferAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg: + s := proto.Size(x.BlueaccountReplaceAccountTargetMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg: + s := proto.Size(x.BlueaccountDeleteAccountMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg: + s := proto.Size(x.BlueaccountUpdateConfigurationMsg) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// CronTask is a format used by the CronMarshaler to marshal and unmarshal cron +// task. +// +// When there is a gap in message sequence numbers - that most likely means some +// old fields got deprecated. This is done to maintain binary compatibility. type CronTask struct { // Authenticators contains a list of conditions that authenticate execution // of this task. @@ -3128,90 +4254,107 @@ func init() { func init() { proto.RegisterFile("cmd/bnsd/app/codec.proto", fileDescriptor_a8efb1d2ea3c411d) } var fileDescriptor_a8efb1d2ea3c411d = []byte{ - // 1326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x99, 0x4d, 0x73, 0x14, 0xc5, - 0x1f, 0xc7, 0x13, 0x12, 0xf8, 0xe7, 0xdf, 0x04, 0x92, 0x34, 0x21, 0xd9, 0x2c, 0xb0, 0x81, 0x58, - 0x65, 0x51, 0x56, 0x39, 0x63, 0x11, 0x9f, 0x05, 0x29, 0x37, 0x09, 0x02, 0xca, 0x83, 0x9b, 0x8d, - 0x17, 0xd1, 0xa9, 0xce, 0x4c, 0xef, 0x64, 0x8a, 0xd9, 0xe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ptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xdb, 0x72, 0xdb, 0x44, + 0x18, 0x4e, 0x9a, 0xb4, 0x64, 0xb6, 0x69, 0x93, 0x6c, 0xd2, 0xc4, 0x71, 0x12, 0x27, 0x4d, 0xa1, + 0xd3, 0x61, 0x06, 0x89, 0x69, 0x38, 0xd3, 0xd2, 0xa9, 0x9d, 0x94, 0xb6, 0xd0, 0x93, 0xe3, 0x14, + 0x18, 0x0a, 0x9e, 0xb5, 0xb4, 0x56, 0x44, 0x65, 0xad, 0x47, 0x2b, 0x39, 0xee, 0xf0, 0x00, 0x5c, + 0xc2, 0x1d, 0x2f, 0xc2, 0x1d, 0x2f, 0xd0, 0x3b, 0x7a, 0xc9, 0x55, 0x87, 0x69, 0xdf, 0x82, 0x2b, + 0x66, 0x4f, 0xd2, 0xae, 0xac, 0xd0, 0x42, 0x19, 0x4e, 0xa3, 0x3b, 0xef, 0xff, 0xfd, 0xfb, 0x7d, + 0x7b, 0xf2, 0xbf, 0x9f, 0x37, 0x01, 0x15, 0xa7, 0xe7, 0xda, 0x9d, 0x90, 0xba, 0x36, 0xea, 0xf7, + 0x6d, 0x87, 0xb8, 0xd8, 0xb1, 0xfa, 0x11, 0x89, 0x09, 0x9c, 0x64, 0xd1, 0xea, 0x66, 0x8a, 0x0f, + 0xed, 0x4e, 0x90, 0x60, 0xe4, 0x38, 0x24, 0x09, 0x63, 0x3d, 0xb3, 0xba, 0xae, 0xe5, 0x24, 0x14, + 0x47, 0x21, 0xea, 0x61, 0x23, 0x61, 0xc1, 0x23, 0x1e, 0xe1, 0x1f, 0x6d, 0xf6, 0x49, 0x46, 0x4f, + 0xf5, 0x7c, 0x2f, 0x42, 0xb1, 0x4f, 0x42, 0x23, 0x79, 0x7e, 0x68, 0x23, 0x7a, 0x80, 0x8c, 0xc1, + 0x54, 0xe1, 0xd0, 0x76, 0x10, 0xdd, 0x37, 0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95, 0xcb, 0x0d, 0xd1, 0x74, 0xfd, 0xec, 0xaf, 0x8f, 0xd7, 0x37, 0x3d, 0x3f, 0xde, + 0x4f, 0x3a, 0x96, 0x43, 0x7a, 0xb6, 0x4f, 0x06, 0xaf, 0x91, 0x10, 0xdb, 0x07, 0x18, 0x0d, 0xb0, + 0xd5, 0x20, 0xa1, 0xeb, 0xf3, 0x92, 0x96, 0xeb, 0xfd, 0xef, 0xf8, 0xfb, 0xdb, 0x17, 0x60, 0xc5, + 0xb8, 0x65, 0xd2, 0x06, 0x7e, 0xfe, 0xab, 0x6b, 0x59, 0x47, 0x0d, 0xf0, 0xc5, 0xff, 0xb3, 0x66, + 0x0b, 0x9c, 0x60, 0x17, 0x40, 0x8c, 0x82, 0xe0, 0x01, 0xef, 0xfc, 0xb1, 0xf4, 0x8c, 0xac, 0xde, + 0xb7, 0x58, 0x54, 0xbe, 0x2c, 0x7a, 0x64, 0xa0, 0x9a, 0x72, 0xf7, 0xea, 0x95, 0x87, 0x4f, 0x6a, + 0xe3, 0x8f, 0x9e, 0xd4, 0xc6, 0x7f, 0x79, 0x52, 0x1b, 0xff, 0xee, 0x69, 0x6d, 0xec, 0xd1, 0xd3, + 0xda, 0xd8, 0xcf, 0x4f, 0x6b, 0x63, 0x9d, 0x63, 0xfc, 0xdf, 0x3c, 0xb7, 0x7e, 0x0b, 0x00, 0x00, + 0xff, 0xff, 0xe1, 0x66, 0x2d, 0xa8, 0x5c, 0x2b, 0x00, 0x00, } func (m *Tx) Marshal() (dAtA []byte, err error) { @@ -3685,6 +4828,150 @@ func (m *Tx_MsgfeeSetMsgFeeMsg) MarshalTo(dAtA []byte) (int, error) { } return i, nil } +func (m *Tx_BlueaccountRegisterDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRegisterDomainMsg != nil { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterDomainMsg.Size())) + n29, err := m.BlueaccountRegisterDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n29 + } + return i, nil +} +func (m *Tx_BlueaccountTransferDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountTransferDomainMsg != nil { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferDomainMsg.Size())) + n30, err := m.BlueaccountTransferDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n30 + } + return i, nil +} +func (m *Tx_BlueaccountRenewDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRenewDomainMsg != nil { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRenewDomainMsg.Size())) + n31, err := m.BlueaccountRenewDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n31 + } + return i, nil +} +func (m *Tx_BlueaccountDeleteDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountDeleteDomainMsg != nil { + dAtA[i] = 0xa2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteDomainMsg.Size())) + n32, err := m.BlueaccountDeleteDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n32 + } + return i, nil +} +func (m *Tx_BlueaccountRegisterAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRegisterAccountMsg != nil { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterAccountMsg.Size())) + n33, err := m.BlueaccountRegisterAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n33 + } + return i, nil +} +func (m *Tx_BlueaccountTransferAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountTransferAccountMsg != nil { + dAtA[i] = 0xb2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferAccountMsg.Size())) + n34, err := m.BlueaccountTransferAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n34 + } + return i, nil +} +func (m *Tx_BlueaccountReplaceAccountTargetMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountReplaceAccountTargetMsg != nil { + dAtA[i] = 0xba + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountReplaceAccountTargetMsg.Size())) + n35, err := m.BlueaccountReplaceAccountTargetMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n35 + } + return i, nil +} +func (m *Tx_BlueaccountDeleteAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountDeleteAccountMsg != nil { + dAtA[i] = 0xc2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteAccountMsg.Size())) + n36, err := m.BlueaccountDeleteAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n36 + } + return i, nil +} +func (m *Tx_BlueaccountUpdateConfigurationMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountUpdateConfigurationMsg != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountUpdateConfigurationMsg.Size())) + n37, err := m.BlueaccountUpdateConfigurationMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n37 + } + return i, nil +} func (m *ExecuteBatchMsg) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3731,11 +5018,11 @@ func (m *ExecuteBatchMsg_Union) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if m.Sum != nil { - nn29, err := m.Sum.MarshalTo(dAtA[i:]) + nn38, err := m.Sum.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn29 + i += nn38 } return i, nil } @@ -3748,11 +5035,11 @@ func (m *ExecuteBatchMsg_Union_CashSendMsg) MarshalTo(dAtA []byte) (int, error) dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.CashSendMsg.Size())) - n30, err := m.CashSendMsg.MarshalTo(dAtA[i:]) + n39, err := m.CashSendMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n39 } return i, nil } @@ -3764,11 +5051,11 @@ func (m *ExecuteBatchMsg_Union_EscrowCreateMsg) MarshalTo(dAtA []byte) (int, err dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.EscrowCreateMsg.Size())) - n31, err := m.EscrowCreateMsg.MarshalTo(dAtA[i:]) + n40, err := m.EscrowCreateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n40 } return i, nil } @@ -3780,11 +5067,11 @@ func (m *ExecuteBatchMsg_Union_EscrowReleaseMsg) MarshalTo(dAtA []byte) (int, er dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReleaseMsg.Size())) - n32, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) + n41, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n41 } return i, nil } @@ -3796,11 +5083,11 @@ func (m *ExecuteBatchMsg_Union_EscrowReturnMsg) MarshalTo(dAtA []byte) (int, err dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReturnMsg.Size())) - n33, err := m.EscrowReturnMsg.MarshalTo(dAtA[i:]) + n42, err := m.EscrowReturnMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n42 } return i, nil } @@ -3812,11 +5099,11 @@ func (m *ExecuteBatchMsg_Union_EscrowUpdatePartiesMsg) MarshalTo(dAtA []byte) (i dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.EscrowUpdatePartiesMsg.Size())) - n34, err := m.EscrowUpdatePartiesMsg.MarshalTo(dAtA[i:]) + n43, err := m.EscrowUpdatePartiesMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n43 } return i, nil } @@ -3828,11 +5115,11 @@ func (m *ExecuteBatchMsg_Union_MultisigCreateMsg) MarshalTo(dAtA []byte) (int, e dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.MultisigCreateMsg.Size())) - n35, err := m.MultisigCreateMsg.MarshalTo(dAtA[i:]) + n44, err := m.MultisigCreateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n44 } return i, nil } @@ -3844,11 +5131,11 @@ func (m *ExecuteBatchMsg_Union_MultisigUpdateMsg) MarshalTo(dAtA []byte) (int, e dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.MultisigUpdateMsg.Size())) - n36, err := m.MultisigUpdateMsg.MarshalTo(dAtA[i:]) + n45, err := m.MultisigUpdateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n45 } return i, nil } @@ -3860,11 +5147,11 @@ func (m *ExecuteBatchMsg_Union_ValidatorsApplyDiffMsg) MarshalTo(dAtA []byte) (i dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.ValidatorsApplyDiffMsg.Size())) - n37, err := m.ValidatorsApplyDiffMsg.MarshalTo(dAtA[i:]) + n46, err := m.ValidatorsApplyDiffMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n46 } return i, nil } @@ -3876,11 +5163,11 @@ func (m *ExecuteBatchMsg_Union_CurrencyCreateMsg) MarshalTo(dAtA []byte) (int, e dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.CurrencyCreateMsg.Size())) - n38, err := m.CurrencyCreateMsg.MarshalTo(dAtA[i:]) + n47, err := m.CurrencyCreateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n47 } return i, nil } @@ -3892,11 +5179,11 @@ func (m *ExecuteBatchMsg_Union_UsernameRegisterTokenMsg) MarshalTo(dAtA []byte) dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameRegisterTokenMsg.Size())) - n39, err := m.UsernameRegisterTokenMsg.MarshalTo(dAtA[i:]) + n48, err := m.UsernameRegisterTokenMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n48 } return i, nil } @@ -3908,11 +5195,11 @@ func (m *ExecuteBatchMsg_Union_UsernameTransferTokenMsg) MarshalTo(dAtA []byte) dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameTransferTokenMsg.Size())) - n40, err := m.UsernameTransferTokenMsg.MarshalTo(dAtA[i:]) + n49, err := m.UsernameTransferTokenMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n40 + i += n49 } return i, nil } @@ -3924,11 +5211,11 @@ func (m *ExecuteBatchMsg_Union_UsernameChangeTokenTargetsMsg) MarshalTo(dAtA []b dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameChangeTokenTargetsMsg.Size())) - n41, err := m.UsernameChangeTokenTargetsMsg.MarshalTo(dAtA[i:]) + n50, err := m.UsernameChangeTokenTargetsMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n41 + i += n50 } return i, nil } @@ -3940,11 +5227,11 @@ func (m *ExecuteBatchMsg_Union_DistributionCreateMsg) MarshalTo(dAtA []byte) (in dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionCreateMsg.Size())) - n42, err := m.DistributionCreateMsg.MarshalTo(dAtA[i:]) + n51, err := m.DistributionCreateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n42 + i += n51 } return i, nil } @@ -3956,11 +5243,11 @@ func (m *ExecuteBatchMsg_Union_DistributionMsg) MarshalTo(dAtA []byte) (int, err dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionMsg.Size())) - n43, err := m.DistributionMsg.MarshalTo(dAtA[i:]) + n52, err := m.DistributionMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n43 + i += n52 } return i, nil } @@ -3972,11 +5259,11 @@ func (m *ExecuteBatchMsg_Union_DistributionResetMsg) MarshalTo(dAtA []byte) (int dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionResetMsg.Size())) - n44, err := m.DistributionResetMsg.MarshalTo(dAtA[i:]) + n53, err := m.DistributionResetMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n44 + i += n53 } return i, nil } @@ -3988,148 +5275,292 @@ func (m *ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg) MarshalTo(dAtA []byte) (int, dAtA[i] = 0x5 i++ i = encodeVarintCodec(dAtA, i, uint64(m.MsgfeeSetMsgFeeMsg.Size())) - n45, err := m.MsgfeeSetMsgFeeMsg.MarshalTo(dAtA[i:]) + n54, err := m.MsgfeeSetMsgFeeMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n45 + i += n54 } return i, nil } -func (m *ProposalOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProposalOptions) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Option != nil { - nn46, err := m.Option.MarshalTo(dAtA[i:]) +func (m *ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRegisterDomainMsg != nil { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterDomainMsg.Size())) + n55, err := m.BlueaccountRegisterDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn46 + i += n55 } return i, nil } - -func (m *ProposalOptions_CashSendMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.CashSendMsg != nil { - dAtA[i] = 0x9a + if m.BlueaccountTransferDomainMsg != nil { + dAtA[i] = 0x92 i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.CashSendMsg.Size())) - n47, err := m.CashSendMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferDomainMsg.Size())) + n56, err := m.BlueaccountTransferDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n47 + i += n56 } return i, nil } -func (m *ProposalOptions_EscrowReleaseMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.EscrowReleaseMsg != nil { - dAtA[i] = 0xaa + if m.BlueaccountRenewDomainMsg != nil { + dAtA[i] = 0x9a i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReleaseMsg.Size())) - n48, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRenewDomainMsg.Size())) + n57, err := m.BlueaccountRenewDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n48 + i += n57 } return i, nil } -func (m *ProposalOptions_UpdateEscrowPartiesMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.UpdateEscrowPartiesMsg != nil { - dAtA[i] = 0xba + if m.BlueaccountDeleteDomainMsg != nil { + dAtA[i] = 0xa2 i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.UpdateEscrowPartiesMsg.Size())) - n49, err := m.UpdateEscrowPartiesMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteDomainMsg.Size())) + n58, err := m.BlueaccountDeleteDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n49 + i += n58 } return i, nil } -func (m *ProposalOptions_MultisigUpdateMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.MultisigUpdateMsg != nil { - dAtA[i] = 0xca + if m.BlueaccountRegisterAccountMsg != nil { + dAtA[i] = 0xaa i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.MultisigUpdateMsg.Size())) - n50, err := m.MultisigUpdateMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterAccountMsg.Size())) + n59, err := m.BlueaccountRegisterAccountMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n50 + i += n59 } return i, nil } -func (m *ProposalOptions_ValidatorsApplyDiffMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.ValidatorsApplyDiffMsg != nil { - dAtA[i] = 0xd2 + if m.BlueaccountTransferAccountMsg != nil { + dAtA[i] = 0xb2 i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.ValidatorsApplyDiffMsg.Size())) - n51, err := m.ValidatorsApplyDiffMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferAccountMsg.Size())) + n60, err := m.BlueaccountTransferAccountMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n51 + i += n60 } return i, nil } -func (m *ProposalOptions_CurrencyCreateMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.CurrencyCreateMsg != nil { - dAtA[i] = 0xda + if m.BlueaccountReplaceAccountTargetMsg != nil { + dAtA[i] = 0xba i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.CurrencyCreateMsg.Size())) - n52, err := m.CurrencyCreateMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountReplaceAccountTargetMsg.Size())) + n61, err := m.BlueaccountReplaceAccountTargetMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n52 + i += n61 } return i, nil } -func (m *ProposalOptions_ExecuteProposalBatchMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.ExecuteProposalBatchMsg != nil { - dAtA[i] = 0xe2 + if m.BlueaccountDeleteAccountMsg != nil { + dAtA[i] = 0xc2 i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteAccountMsg.Size())) + n62, err := m.BlueaccountDeleteAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n62 + } + return i, nil +} +func (m *ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountUpdateConfigurationMsg != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountUpdateConfigurationMsg.Size())) + n63, err := m.BlueaccountUpdateConfigurationMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n63 + } + return i, nil +} +func (m *ProposalOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProposalOptions) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Option != nil { + nn64, err := m.Option.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += nn64 + } + return i, nil +} + +func (m *ProposalOptions_CashSendMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.CashSendMsg != nil { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.CashSendMsg.Size())) + n65, err := m.CashSendMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n65 + } + return i, nil +} +func (m *ProposalOptions_EscrowReleaseMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.EscrowReleaseMsg != nil { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReleaseMsg.Size())) + n66, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n66 + } + return i, nil +} +func (m *ProposalOptions_UpdateEscrowPartiesMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.UpdateEscrowPartiesMsg != nil { + dAtA[i] = 0xba + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.UpdateEscrowPartiesMsg.Size())) + n67, err := m.UpdateEscrowPartiesMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n67 + } + return i, nil +} +func (m *ProposalOptions_MultisigUpdateMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.MultisigUpdateMsg != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.MultisigUpdateMsg.Size())) + n68, err := m.MultisigUpdateMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n68 + } + return i, nil +} +func (m *ProposalOptions_ValidatorsApplyDiffMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.ValidatorsApplyDiffMsg != nil { + dAtA[i] = 0xd2 + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.ValidatorsApplyDiffMsg.Size())) + n69, err := m.ValidatorsApplyDiffMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n69 + } + return i, nil +} +func (m *ProposalOptions_CurrencyCreateMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.CurrencyCreateMsg != nil { + dAtA[i] = 0xda + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.CurrencyCreateMsg.Size())) + n70, err := m.CurrencyCreateMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n70 + } + return i, nil +} +func (m *ProposalOptions_ExecuteProposalBatchMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.ExecuteProposalBatchMsg != nil { + dAtA[i] = 0xe2 + i++ + dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.ExecuteProposalBatchMsg.Size())) - n53, err := m.ExecuteProposalBatchMsg.MarshalTo(dAtA[i:]) + n71, err := m.ExecuteProposalBatchMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n53 + i += n71 } return i, nil } @@ -4141,11 +5572,11 @@ func (m *ProposalOptions_UsernameRegisterTokenMsg) MarshalTo(dAtA []byte) (int, dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameRegisterTokenMsg.Size())) - n54, err := m.UsernameRegisterTokenMsg.MarshalTo(dAtA[i:]) + n72, err := m.UsernameRegisterTokenMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n54 + i += n72 } return i, nil } @@ -4157,11 +5588,11 @@ func (m *ProposalOptions_UsernameTransferTokenMsg) MarshalTo(dAtA []byte) (int, dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameTransferTokenMsg.Size())) - n55, err := m.UsernameTransferTokenMsg.MarshalTo(dAtA[i:]) + n73, err := m.UsernameTransferTokenMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n55 + i += n73 } return i, nil } @@ -4173,11 +5604,11 @@ func (m *ProposalOptions_UsernameChangeTokenTargetsMsg) MarshalTo(dAtA []byte) ( dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameChangeTokenTargetsMsg.Size())) - n56, err := m.UsernameChangeTokenTargetsMsg.MarshalTo(dAtA[i:]) + n74, err := m.UsernameChangeTokenTargetsMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n56 + i += n74 } return i, nil } @@ -4189,11 +5620,11 @@ func (m *ProposalOptions_DistributionCreateMsg) MarshalTo(dAtA []byte) (int, err dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionCreateMsg.Size())) - n57, err := m.DistributionCreateMsg.MarshalTo(dAtA[i:]) + n75, err := m.DistributionCreateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n57 + i += n75 } return i, nil } @@ -4205,11 +5636,11 @@ func (m *ProposalOptions_DistributionMsg) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionMsg.Size())) - n58, err := m.DistributionMsg.MarshalTo(dAtA[i:]) + n76, err := m.DistributionMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n58 + i += n76 } return i, nil } @@ -4221,11 +5652,11 @@ func (m *ProposalOptions_DistributionResetMsg) MarshalTo(dAtA []byte) (int, erro dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionResetMsg.Size())) - n59, err := m.DistributionResetMsg.MarshalTo(dAtA[i:]) + n77, err := m.DistributionResetMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n59 + i += n77 } return i, nil } @@ -4237,11 +5668,11 @@ func (m *ProposalOptions_MigrationUpgradeSchemaMsg) MarshalTo(dAtA []byte) (int, dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.MigrationUpgradeSchemaMsg.Size())) - n60, err := m.MigrationUpgradeSchemaMsg.MarshalTo(dAtA[i:]) + n78, err := m.MigrationUpgradeSchemaMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n60 + i += n78 } return i, nil } @@ -4253,11 +5684,11 @@ func (m *ProposalOptions_GovUpdateElectorateMsg) MarshalTo(dAtA []byte) (int, er dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovUpdateElectorateMsg.Size())) - n61, err := m.GovUpdateElectorateMsg.MarshalTo(dAtA[i:]) + n79, err := m.GovUpdateElectorateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n61 + i += n79 } return i, nil } @@ -4269,11 +5700,11 @@ func (m *ProposalOptions_GovUpdateElectionRuleMsg) MarshalTo(dAtA []byte) (int, dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovUpdateElectionRuleMsg.Size())) - n62, err := m.GovUpdateElectionRuleMsg.MarshalTo(dAtA[i:]) + n80, err := m.GovUpdateElectionRuleMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n62 + i += n80 } return i, nil } @@ -4285,11 +5716,11 @@ func (m *ProposalOptions_GovCreateTextResolutionMsg) MarshalTo(dAtA []byte) (int dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovCreateTextResolutionMsg.Size())) - n63, err := m.GovCreateTextResolutionMsg.MarshalTo(dAtA[i:]) + n81, err := m.GovCreateTextResolutionMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n63 + i += n81 } return i, nil } @@ -4301,146 +5732,290 @@ func (m *ProposalOptions_MsgfeeSetMsgFeeMsg) MarshalTo(dAtA []byte) (int, error) dAtA[i] = 0x5 i++ i = encodeVarintCodec(dAtA, i, uint64(m.MsgfeeSetMsgFeeMsg.Size())) - n64, err := m.MsgfeeSetMsgFeeMsg.MarshalTo(dAtA[i:]) + n82, err := m.MsgfeeSetMsgFeeMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n64 + i += n82 } return i, nil } -func (m *ExecuteProposalBatchMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ExecuteProposalBatchMsg) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Messages) > 0 { - for _, msg := range m.Messages { - dAtA[i] = 0xa - i++ - i = encodeVarintCodec(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n +func (m *ProposalOptions_BlueaccountRegisterDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRegisterDomainMsg != nil { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterDomainMsg.Size())) + n83, err := m.BlueaccountRegisterDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n83 } return i, nil } - -func (m *ExecuteProposalBatchMsg_Union) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ExecuteProposalBatchMsg_Union) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Sum != nil { - nn65, err := m.Sum.MarshalTo(dAtA[i:]) +func (m *ProposalOptions_BlueaccountTransferDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountTransferDomainMsg != nil { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferDomainMsg.Size())) + n84, err := m.BlueaccountTransferDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn65 + i += n84 } return i, nil } - -func (m *ExecuteProposalBatchMsg_Union_SendMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalOptions_BlueaccountRenewDomainMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.SendMsg != nil { + if m.BlueaccountRenewDomainMsg != nil { dAtA[i] = 0x9a i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.SendMsg.Size())) - n66, err := m.SendMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRenewDomainMsg.Size())) + n85, err := m.BlueaccountRenewDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n66 + i += n85 } return i, nil } -func (m *ExecuteProposalBatchMsg_Union_EscrowReleaseMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalOptions_BlueaccountDeleteDomainMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.EscrowReleaseMsg != nil { - dAtA[i] = 0xaa + if m.BlueaccountDeleteDomainMsg != nil { + dAtA[i] = 0xa2 i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReleaseMsg.Size())) - n67, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteDomainMsg.Size())) + n86, err := m.BlueaccountDeleteDomainMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n67 + i += n86 } return i, nil } -func (m *ExecuteProposalBatchMsg_Union_UpdateEscrowPartiesMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalOptions_BlueaccountRegisterAccountMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.UpdateEscrowPartiesMsg != nil { - dAtA[i] = 0xba + if m.BlueaccountRegisterAccountMsg != nil { + dAtA[i] = 0xaa i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.UpdateEscrowPartiesMsg.Size())) - n68, err := m.UpdateEscrowPartiesMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterAccountMsg.Size())) + n87, err := m.BlueaccountRegisterAccountMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n68 + i += n87 } return i, nil } -func (m *ExecuteProposalBatchMsg_Union_MultisigUpdateMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalOptions_BlueaccountTransferAccountMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.MultisigUpdateMsg != nil { - dAtA[i] = 0xca + if m.BlueaccountTransferAccountMsg != nil { + dAtA[i] = 0xb2 i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.MultisigUpdateMsg.Size())) - n69, err := m.MultisigUpdateMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferAccountMsg.Size())) + n88, err := m.BlueaccountTransferAccountMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n69 + i += n88 } return i, nil } -func (m *ExecuteProposalBatchMsg_Union_ValidatorsApplyDiffMsg) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalOptions_BlueaccountReplaceAccountTargetMsg) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.ValidatorsApplyDiffMsg != nil { - dAtA[i] = 0xd2 + if m.BlueaccountReplaceAccountTargetMsg != nil { + dAtA[i] = 0xba i++ - dAtA[i] = 0x3 + dAtA[i] = 0x5 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.ValidatorsApplyDiffMsg.Size())) - n70, err := m.ValidatorsApplyDiffMsg.MarshalTo(dAtA[i:]) + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountReplaceAccountTargetMsg.Size())) + n89, err := m.BlueaccountReplaceAccountTargetMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n70 + i += n89 + } + return i, nil +} +func (m *ProposalOptions_BlueaccountDeleteAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountDeleteAccountMsg != nil { + dAtA[i] = 0xc2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteAccountMsg.Size())) + n90, err := m.BlueaccountDeleteAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n90 + } + return i, nil +} +func (m *ProposalOptions_BlueaccountUpdateConfigurationMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountUpdateConfigurationMsg != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountUpdateConfigurationMsg.Size())) + n91, err := m.BlueaccountUpdateConfigurationMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n91 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExecuteProposalBatchMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Messages) > 0 { + for _, msg := range m.Messages { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *ExecuteProposalBatchMsg_Union) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExecuteProposalBatchMsg_Union) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Sum != nil { + nn92, err := m.Sum.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += nn92 + } + return i, nil +} + +func (m *ExecuteProposalBatchMsg_Union_SendMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.SendMsg != nil { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.SendMsg.Size())) + n93, err := m.SendMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n93 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_EscrowReleaseMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.EscrowReleaseMsg != nil { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReleaseMsg.Size())) + n94, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n94 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_UpdateEscrowPartiesMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.UpdateEscrowPartiesMsg != nil { + dAtA[i] = 0xba + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.UpdateEscrowPartiesMsg.Size())) + n95, err := m.UpdateEscrowPartiesMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n95 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_MultisigUpdateMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.MultisigUpdateMsg != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.MultisigUpdateMsg.Size())) + n96, err := m.MultisigUpdateMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n96 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_ValidatorsApplyDiffMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.ValidatorsApplyDiffMsg != nil { + dAtA[i] = 0xd2 + i++ + dAtA[i] = 0x3 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.ValidatorsApplyDiffMsg.Size())) + n97, err := m.ValidatorsApplyDiffMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n97 } return i, nil } @@ -4452,11 +6027,11 @@ func (m *ExecuteProposalBatchMsg_Union_UsernameRegisterTokenMsg) MarshalTo(dAtA dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameRegisterTokenMsg.Size())) - n71, err := m.UsernameRegisterTokenMsg.MarshalTo(dAtA[i:]) + n98, err := m.UsernameRegisterTokenMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n71 + i += n98 } return i, nil } @@ -4468,11 +6043,11 @@ func (m *ExecuteProposalBatchMsg_Union_UsernameTransferTokenMsg) MarshalTo(dAtA dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameTransferTokenMsg.Size())) - n72, err := m.UsernameTransferTokenMsg.MarshalTo(dAtA[i:]) + n99, err := m.UsernameTransferTokenMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n72 + i += n99 } return i, nil } @@ -4484,11 +6059,11 @@ func (m *ExecuteProposalBatchMsg_Union_UsernameChangeTokenTargetsMsg) MarshalTo( dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.UsernameChangeTokenTargetsMsg.Size())) - n73, err := m.UsernameChangeTokenTargetsMsg.MarshalTo(dAtA[i:]) + n100, err := m.UsernameChangeTokenTargetsMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n73 + i += n100 } return i, nil } @@ -4500,11 +6075,11 @@ func (m *ExecuteProposalBatchMsg_Union_DistributionCreateMsg) MarshalTo(dAtA []b dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionCreateMsg.Size())) - n74, err := m.DistributionCreateMsg.MarshalTo(dAtA[i:]) + n101, err := m.DistributionCreateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n74 + i += n101 } return i, nil } @@ -4516,11 +6091,11 @@ func (m *ExecuteProposalBatchMsg_Union_DistributionMsg) MarshalTo(dAtA []byte) ( dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionMsg.Size())) - n75, err := m.DistributionMsg.MarshalTo(dAtA[i:]) + n102, err := m.DistributionMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n75 + i += n102 } return i, nil } @@ -4532,11 +6107,11 @@ func (m *ExecuteProposalBatchMsg_Union_DistributionResetMsg) MarshalTo(dAtA []by dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionResetMsg.Size())) - n76, err := m.DistributionResetMsg.MarshalTo(dAtA[i:]) + n103, err := m.DistributionResetMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n76 + i += n103 } return i, nil } @@ -4548,11 +6123,11 @@ func (m *ExecuteProposalBatchMsg_Union_GovUpdateElectorateMsg) MarshalTo(dAtA [] dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovUpdateElectorateMsg.Size())) - n77, err := m.GovUpdateElectorateMsg.MarshalTo(dAtA[i:]) + n104, err := m.GovUpdateElectorateMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n77 + i += n104 } return i, nil } @@ -4564,11 +6139,11 @@ func (m *ExecuteProposalBatchMsg_Union_GovUpdateElectionRuleMsg) MarshalTo(dAtA dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovUpdateElectionRuleMsg.Size())) - n78, err := m.GovUpdateElectionRuleMsg.MarshalTo(dAtA[i:]) + n105, err := m.GovUpdateElectionRuleMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n78 + i += n105 } return i, nil } @@ -4580,11 +6155,11 @@ func (m *ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg) MarshalTo(dAt dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovCreateTextResolutionMsg.Size())) - n79, err := m.GovCreateTextResolutionMsg.MarshalTo(dAtA[i:]) + n106, err := m.GovCreateTextResolutionMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n79 + i += n106 } return i, nil } @@ -4596,11 +6171,155 @@ func (m *ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg) MarshalTo(dAtA []byte dAtA[i] = 0x5 i++ i = encodeVarintCodec(dAtA, i, uint64(m.MsgfeeSetMsgFeeMsg.Size())) - n80, err := m.MsgfeeSetMsgFeeMsg.MarshalTo(dAtA[i:]) + n107, err := m.MsgfeeSetMsgFeeMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n80 + i += n107 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRegisterDomainMsg != nil { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterDomainMsg.Size())) + n108, err := m.BlueaccountRegisterDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n108 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountTransferDomainMsg != nil { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferDomainMsg.Size())) + n109, err := m.BlueaccountTransferDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n109 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRenewDomainMsg != nil { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRenewDomainMsg.Size())) + n110, err := m.BlueaccountRenewDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n110 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountDeleteDomainMsg != nil { + dAtA[i] = 0xa2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteDomainMsg.Size())) + n111, err := m.BlueaccountDeleteDomainMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n111 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountRegisterAccountMsg != nil { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountRegisterAccountMsg.Size())) + n112, err := m.BlueaccountRegisterAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n112 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountTransferAccountMsg != nil { + dAtA[i] = 0xb2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountTransferAccountMsg.Size())) + n113, err := m.BlueaccountTransferAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n113 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountReplaceAccountTargetMsg != nil { + dAtA[i] = 0xba + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountReplaceAccountTargetMsg.Size())) + n114, err := m.BlueaccountReplaceAccountTargetMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n114 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountDeleteAccountMsg != nil { + dAtA[i] = 0xc2 + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountDeleteAccountMsg.Size())) + n115, err := m.BlueaccountDeleteAccountMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n115 + } + return i, nil +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.BlueaccountUpdateConfigurationMsg != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x5 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.BlueaccountUpdateConfigurationMsg.Size())) + n116, err := m.BlueaccountUpdateConfigurationMsg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n116 } return i, nil } @@ -4628,11 +6347,11 @@ func (m *CronTask) MarshalTo(dAtA []byte) (int, error) { } } if m.Sum != nil { - nn81, err := m.Sum.MarshalTo(dAtA[i:]) + nn117, err := m.Sum.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn81 + i += nn117 } return i, nil } @@ -4645,11 +6364,11 @@ func (m *CronTask_EscrowReleaseMsg) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReleaseMsg.Size())) - n82, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) + n118, err := m.EscrowReleaseMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n82 + i += n118 } return i, nil } @@ -4661,11 +6380,11 @@ func (m *CronTask_EscrowReturnMsg) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3 i++ i = encodeVarintCodec(dAtA, i, uint64(m.EscrowReturnMsg.Size())) - n83, err := m.EscrowReturnMsg.MarshalTo(dAtA[i:]) + n119, err := m.EscrowReturnMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n83 + i += n119 } return i, nil } @@ -4677,11 +6396,11 @@ func (m *CronTask_DistributionDistributeMsg) MarshalTo(dAtA []byte) (int, error) dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.DistributionDistributeMsg.Size())) - n84, err := m.DistributionDistributeMsg.MarshalTo(dAtA[i:]) + n120, err := m.DistributionDistributeMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n84 + i += n120 } return i, nil } @@ -4693,11 +6412,11 @@ func (m *CronTask_AswapReleaseMsg) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.AswapReleaseMsg.Size())) - n85, err := m.AswapReleaseMsg.MarshalTo(dAtA[i:]) + n121, err := m.AswapReleaseMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n85 + i += n121 } return i, nil } @@ -4709,11 +6428,11 @@ func (m *CronTask_GovTallyMsg) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4 i++ i = encodeVarintCodec(dAtA, i, uint64(m.GovTallyMsg.Size())) - n86, err := m.GovTallyMsg.MarshalTo(dAtA[i:]) + n122, err := m.GovTallyMsg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n86 + i += n122 } return i, nil } @@ -5066,6 +6785,114 @@ func (m *Tx_MsgfeeSetMsgFeeMsg) Size() (n int) { } return n } +func (m *Tx_BlueaccountRegisterDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterDomainMsg != nil { + l = m.BlueaccountRegisterDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountTransferDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferDomainMsg != nil { + l = m.BlueaccountTransferDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountRenewDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRenewDomainMsg != nil { + l = m.BlueaccountRenewDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountDeleteDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteDomainMsg != nil { + l = m.BlueaccountDeleteDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountRegisterAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterAccountMsg != nil { + l = m.BlueaccountRegisterAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountTransferAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferAccountMsg != nil { + l = m.BlueaccountTransferAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountReplaceAccountTargetMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountReplaceAccountTargetMsg != nil { + l = m.BlueaccountReplaceAccountTargetMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountDeleteAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteAccountMsg != nil { + l = m.BlueaccountDeleteAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Tx_BlueaccountUpdateConfigurationMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountUpdateConfigurationMsg != nil { + l = m.BlueaccountUpdateConfigurationMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} func (m *ExecuteBatchMsg) Size() (n int) { if m == nil { return 0 @@ -5285,6 +7112,114 @@ func (m *ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg) Size() (n int) { } return n } +func (m *ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterDomainMsg != nil { + l = m.BlueaccountRegisterDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferDomainMsg != nil { + l = m.BlueaccountTransferDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRenewDomainMsg != nil { + l = m.BlueaccountRenewDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteDomainMsg != nil { + l = m.BlueaccountDeleteDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterAccountMsg != nil { + l = m.BlueaccountRegisterAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferAccountMsg != nil { + l = m.BlueaccountTransferAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountReplaceAccountTargetMsg != nil { + l = m.BlueaccountReplaceAccountTargetMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteAccountMsg != nil { + l = m.BlueaccountDeleteAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountUpdateConfigurationMsg != nil { + l = m.BlueaccountUpdateConfigurationMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} func (m *ProposalOptions) Size() (n int) { if m == nil { return 0 @@ -5513,6 +7448,114 @@ func (m *ProposalOptions_MsgfeeSetMsgFeeMsg) Size() (n int) { } return n } +func (m *ProposalOptions_BlueaccountRegisterDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterDomainMsg != nil { + l = m.BlueaccountRegisterDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountTransferDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferDomainMsg != nil { + l = m.BlueaccountTransferDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountRenewDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRenewDomainMsg != nil { + l = m.BlueaccountRenewDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountDeleteDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteDomainMsg != nil { + l = m.BlueaccountDeleteDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountRegisterAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterAccountMsg != nil { + l = m.BlueaccountRegisterAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountTransferAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferAccountMsg != nil { + l = m.BlueaccountTransferAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountReplaceAccountTargetMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountReplaceAccountTargetMsg != nil { + l = m.BlueaccountReplaceAccountTargetMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountDeleteAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteAccountMsg != nil { + l = m.BlueaccountDeleteAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ProposalOptions_BlueaccountUpdateConfigurationMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountUpdateConfigurationMsg != nil { + l = m.BlueaccountUpdateConfigurationMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} func (m *ExecuteProposalBatchMsg) Size() (n int) { if m == nil { return 0 @@ -5720,20 +7763,128 @@ func (m *ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg) Size() (n int) { } return n } -func (m *CronTask) Size() (n int) { +func (m *ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Authenticators) > 0 { - for _, b := range m.Authenticators { - l = len(b) - n += 1 + l + sovCodec(uint64(l)) - } - } - if m.Sum != nil { - n += m.Sum.Size() + if m.BlueaccountRegisterDomainMsg != nil { + l = m.BlueaccountRegisterDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferDomainMsg != nil { + l = m.BlueaccountTransferDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRenewDomainMsg != nil { + l = m.BlueaccountRenewDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteDomainMsg != nil { + l = m.BlueaccountDeleteDomainMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountRegisterAccountMsg != nil { + l = m.BlueaccountRegisterAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountTransferAccountMsg != nil { + l = m.BlueaccountTransferAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountReplaceAccountTargetMsg != nil { + l = m.BlueaccountReplaceAccountTargetMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountDeleteAccountMsg != nil { + l = m.BlueaccountDeleteAccountMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlueaccountUpdateConfigurationMsg != nil { + l = m.BlueaccountUpdateConfigurationMsg.Size() + n += 2 + l + sovCodec(uint64(l)) + } + return n +} +func (m *CronTask) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Authenticators) > 0 { + for _, b := range m.Authenticators { + l = len(b) + n += 1 + l + sovCodec(uint64(l)) + } + } + if m.Sum != nil { + n += m.Sum.Size() } return n } @@ -5822,28 +7973,1180 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowCodec } - if iNdEx >= l { + 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: Tx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fees == nil { + m.Fees = &cash.FeeInfo{} + } + if err := m.Fees.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, &sigs.StdSignature{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Multisig", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Multisig = append(m.Multisig, make([]byte, postIndex-iNdEx)) + copy(m.Multisig[len(m.Multisig)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 51: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CashSendMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &cash.SendMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_CashSendMsg{v} + iNdEx = postIndex + case 52: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowCreateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &escrow.CreateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_EscrowCreateMsg{v} + iNdEx = postIndex + case 53: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &escrow.ReleaseMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_EscrowReleaseMsg{v} + iNdEx = postIndex + case 54: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowReturnMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &escrow.ReturnMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_EscrowReturnMsg{v} + iNdEx = postIndex + case 55: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowUpdatePartiesMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &escrow.UpdatePartiesMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_EscrowUpdatePartiesMsg{v} + iNdEx = postIndex + case 56: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MultisigCreateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &multisig.CreateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_MultisigCreateMsg{v} + iNdEx = postIndex + case 57: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &multisig.UpdateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_MultisigUpdateMsg{v} + iNdEx = postIndex + case 58: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &validators.ApplyDiffMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_ValidatorsApplyDiffMsg{v} + iNdEx = postIndex + case 59: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCreateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := ¤cy.CreateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_CurrencyCreateMsg{v} + iNdEx = postIndex + case 60: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteBatchMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ExecuteBatchMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_ExecuteBatchMsg{v} + iNdEx = postIndex + case 61: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsernameRegisterTokenMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &username.RegisterTokenMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_UsernameRegisterTokenMsg{v} + iNdEx = postIndex + case 62: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsernameTransferTokenMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &username.TransferTokenMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_UsernameTransferTokenMsg{v} + iNdEx = postIndex + case 63: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsernameChangeTokenTargetsMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &username.ChangeTokenTargetsMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_UsernameChangeTokenTargetsMsg{v} + iNdEx = postIndex + case 66: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionCreateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &distribution.CreateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_DistributionCreateMsg{v} + iNdEx = postIndex + case 67: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &distribution.DistributeMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_DistributionMsg{v} + iNdEx = postIndex + case 68: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionResetMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &distribution.ResetMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_DistributionResetMsg{v} + iNdEx = postIndex + case 69: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MigrationUpgradeSchemaMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &migration.UpgradeSchemaMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_MigrationUpgradeSchemaMsg{v} + iNdEx = postIndex + case 70: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AswapCreateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &aswap.CreateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_AswapCreateMsg{v} + iNdEx = postIndex + case 71: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AswapReleaseMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &aswap.ReleaseMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_AswapReleaseMsg{v} + iNdEx = postIndex + case 72: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AswapReturnMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &aswap.ReturnMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_AswapReturnMsg{v} + iNdEx = postIndex + case 73: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovCreateProposalMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &gov.CreateProposalMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_GovCreateProposalMsg{v} + iNdEx = postIndex + case 74: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovDeleteProposalMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &gov.DeleteProposalMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_GovDeleteProposalMsg{v} + iNdEx = postIndex + case 75: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovVoteMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &gov.VoteMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_GovVoteMsg{v} + iNdEx = postIndex + case 77: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectorateMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &gov.UpdateElectorateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_GovUpdateElectorateMsg{v} + iNdEx = postIndex + case 78: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectionRuleMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &gov.UpdateElectionRuleMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_GovUpdateElectionRuleMsg{v} + iNdEx = postIndex + case 80: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgfeeSetMsgFeeMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &msgfee.SetMsgFeeMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_MsgfeeSetMsgFeeMsg{v} + iNdEx = postIndex + case 81: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterDomainMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &blueaccount.RegisterDomainMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_BlueaccountRegisterDomainMsg{v} + iNdEx = postIndex + case 82: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferDomainMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &blueaccount.TransferDomainMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_BlueaccountTransferDomainMsg{v} + iNdEx = postIndex + case 83: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRenewDomainMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &blueaccount.RenewDomainMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_BlueaccountRenewDomainMsg{v} + iNdEx = postIndex + case 84: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteDomainMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &blueaccount.DeleteDomainMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Tx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Tx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Sum = &Tx_BlueaccountDeleteDomainMsg{v} + iNdEx = postIndex + case 85: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fees", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5870,16 +9173,50 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Fees == nil { - m.Fees = &cash.FeeInfo{} + v := &blueaccount.RegisterAccountMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.Fees.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Sum = &Tx_BlueaccountRegisterAccountMsg{v} + iNdEx = postIndex + case 86: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferAccountMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &blueaccount.TransferAccountMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Sum = &Tx_BlueaccountTransferAccountMsg{v} iNdEx = postIndex - case 2: + case 87: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountReplaceAccountTargetMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5906,16 +9243,17 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signatures = append(m.Signatures, &sigs.StdSignature{}) - if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &blueaccount.ReplaceAccountTargetsMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Sum = &Tx_BlueaccountReplaceAccountTargetMsg{v} iNdEx = postIndex - case 4: + case 88: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Multisig", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteAccountMsg", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCodec @@ -5925,27 +9263,30 @@ func (m *Tx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthCodec } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCodec } if postIndex > l { return io.ErrUnexpectedEOF } - m.Multisig = append(m.Multisig, make([]byte, postIndex-iNdEx)) - copy(m.Multisig[len(m.Multisig)-1], dAtA[iNdEx:postIndex]) + v := &blueaccount.DeleteAccountMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Tx_BlueaccountDeleteAccountMsg{v} iNdEx = postIndex - case 51: + case 89: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CashSendMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountUpdateConfigurationMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5972,15 +9313,68 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &cash.SendMsg{} + v := &blueaccount.UpdateConfigurationMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_CashSendMsg{v} + m.Sum = &Tx_BlueaccountUpdateConfigurationMsg{v} iNdEx = postIndex - case 52: + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExecuteBatchMsg) 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 ErrIntOverflowCodec + } + 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: ExecuteBatchMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExecuteBatchMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6007,15 +9401,102 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.CreateMsg{} + m.Messages = append(m.Messages, ExecuteBatchMsg_Union{}) + if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExecuteBatchMsg_Union) 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 ErrIntOverflowCodec + } + 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: Union: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Union: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 51: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CashSendMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &cash.SendMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_EscrowCreateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_CashSendMsg{v} iNdEx = postIndex - case 53: + case 52: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EscrowCreateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6042,15 +9523,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.ReleaseMsg{} + v := &escrow.CreateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_EscrowReleaseMsg{v} + m.Sum = &ExecuteBatchMsg_Union_EscrowCreateMsg{v} iNdEx = postIndex - case 54: + case 53: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowReturnMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6077,15 +9558,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.ReturnMsg{} + v := &escrow.ReleaseMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_EscrowReturnMsg{v} + m.Sum = &ExecuteBatchMsg_Union_EscrowReleaseMsg{v} iNdEx = postIndex - case 55: + case 54: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowUpdatePartiesMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EscrowReturnMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6112,15 +9593,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.UpdatePartiesMsg{} + v := &escrow.ReturnMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_EscrowUpdatePartiesMsg{v} + m.Sum = &ExecuteBatchMsg_Union_EscrowReturnMsg{v} iNdEx = postIndex - case 56: + case 55: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultisigCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EscrowUpdatePartiesMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6147,15 +9628,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &multisig.CreateMsg{} + v := &escrow.UpdatePartiesMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_MultisigCreateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_EscrowUpdatePartiesMsg{v} iNdEx = postIndex - case 57: + case 56: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MultisigCreateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6182,15 +9663,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &multisig.UpdateMsg{} + v := &multisig.CreateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_MultisigUpdateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_MultisigCreateMsg{v} iNdEx = postIndex - case 58: + case 57: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6217,15 +9698,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &validators.ApplyDiffMsg{} + v := &multisig.UpdateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_ValidatorsApplyDiffMsg{v} + m.Sum = &ExecuteBatchMsg_Union_MultisigUpdateMsg{v} iNdEx = postIndex - case 59: + case 58: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6252,15 +9733,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := ¤cy.CreateMsg{} + v := &validators.ApplyDiffMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_CurrencyCreateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_ValidatorsApplyDiffMsg{v} iNdEx = postIndex - case 60: + case 59: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecuteBatchMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCreateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6287,11 +9768,11 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ExecuteBatchMsg{} + v := ¤cy.CreateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_ExecuteBatchMsg{v} + m.Sum = &ExecuteBatchMsg_Union_CurrencyCreateMsg{v} iNdEx = postIndex case 61: if wireType != 2 { @@ -6326,7 +9807,7 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_UsernameRegisterTokenMsg{v} + m.Sum = &ExecuteBatchMsg_Union_UsernameRegisterTokenMsg{v} iNdEx = postIndex case 62: if wireType != 2 { @@ -6361,7 +9842,7 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_UsernameTransferTokenMsg{v} + m.Sum = &ExecuteBatchMsg_Union_UsernameTransferTokenMsg{v} iNdEx = postIndex case 63: if wireType != 2 { @@ -6396,7 +9877,7 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_UsernameChangeTokenTargetsMsg{v} + m.Sum = &ExecuteBatchMsg_Union_UsernameChangeTokenTargetsMsg{v} iNdEx = postIndex case 66: if wireType != 2 { @@ -6431,7 +9912,7 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_DistributionCreateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_DistributionCreateMsg{v} iNdEx = postIndex case 67: if wireType != 2 { @@ -6466,7 +9947,7 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_DistributionMsg{v} + m.Sum = &ExecuteBatchMsg_Union_DistributionMsg{v} iNdEx = postIndex case 68: if wireType != 2 { @@ -6501,11 +9982,11 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_DistributionResetMsg{v} + m.Sum = &ExecuteBatchMsg_Union_DistributionResetMsg{v} iNdEx = postIndex - case 69: + case 80: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MigrationUpgradeSchemaMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MsgfeeSetMsgFeeMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6532,15 +10013,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &migration.UpgradeSchemaMsg{} + v := &msgfee.SetMsgFeeMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_MigrationUpgradeSchemaMsg{v} + m.Sum = &ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg{v} iNdEx = postIndex - case 70: + case 81: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AswapCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6567,15 +10048,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &aswap.CreateMsg{} + v := &blueaccount.RegisterDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_AswapCreateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountRegisterDomainMsg{v} iNdEx = postIndex - case 71: + case 82: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AswapReleaseMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6602,15 +10083,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &aswap.ReleaseMsg{} + v := &blueaccount.TransferDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_AswapReleaseMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountTransferDomainMsg{v} iNdEx = postIndex - case 72: + case 83: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AswapReturnMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRenewDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6637,15 +10118,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &aswap.ReturnMsg{} + v := &blueaccount.RenewDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_AswapReturnMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountRenewDomainMsg{v} iNdEx = postIndex - case 73: + case 84: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovCreateProposalMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6672,15 +10153,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.CreateProposalMsg{} + v := &blueaccount.DeleteDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_GovCreateProposalMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountDeleteDomainMsg{v} iNdEx = postIndex - case 74: + case 85: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovDeleteProposalMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6707,15 +10188,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.DeleteProposalMsg{} + v := &blueaccount.RegisterAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_GovDeleteProposalMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountRegisterAccountMsg{v} iNdEx = postIndex - case 75: + case 86: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovVoteMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6742,15 +10223,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.VoteMsg{} + v := &blueaccount.TransferAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_GovVoteMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountTransferAccountMsg{v} iNdEx = postIndex - case 77: + case 87: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectorateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountReplaceAccountTargetMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6777,15 +10258,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.UpdateElectorateMsg{} + v := &blueaccount.ReplaceAccountTargetsMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_GovUpdateElectorateMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountReplaceAccountTargetMsg{v} iNdEx = postIndex - case 78: + case 88: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectionRuleMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6812,15 +10293,15 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.UpdateElectionRuleMsg{} + v := &blueaccount.DeleteAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_GovUpdateElectionRuleMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountDeleteAccountMsg{v} iNdEx = postIndex - case 80: + case 89: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgfeeSetMsgFeeMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountUpdateConfigurationMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6847,11 +10328,11 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &msgfee.SetMsgFeeMsg{} + v := &blueaccount.UpdateConfigurationMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &Tx_MsgfeeSetMsgFeeMsg{v} + m.Sum = &ExecuteBatchMsg_Union_BlueaccountUpdateConfigurationMsg{v} iNdEx = postIndex default: iNdEx = preIndex @@ -6877,7 +10358,7 @@ func (m *Tx) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExecuteBatchMsg) Unmarshal(dAtA []byte) error { +func (m *ProposalOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6900,15 +10381,15 @@ func (m *ExecuteBatchMsg) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecuteBatchMsg: wiretype end group for non-group") + return fmt.Errorf("proto: ProposalOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteBatchMsg: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProposalOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 51: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CashSendMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6935,67 +10416,50 @@ func (m *ExecuteBatchMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, ExecuteBatchMsg_Union{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &cash.SendMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Option = &ProposalOptions_CashSendMsg{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err + case 53: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) } - if skippy < 0 { - return ErrInvalidLengthCodec + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthCodec } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExecuteBatchMsg_Union) 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 ErrIntOverflowCodec + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &escrow.ReleaseMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Union: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Union: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 51: + m.Option = &ProposalOptions_EscrowReleaseMsg{v} + iNdEx = postIndex + case 55: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CashSendMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpdateEscrowPartiesMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7022,15 +10486,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &cash.SendMsg{} + v := &escrow.UpdatePartiesMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_CashSendMsg{v} + m.Option = &ProposalOptions_UpdateEscrowPartiesMsg{v} iNdEx = postIndex - case 52: + case 57: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7057,15 +10521,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.CreateMsg{} + v := &multisig.UpdateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_EscrowCreateMsg{v} + m.Option = &ProposalOptions_MultisigUpdateMsg{v} iNdEx = postIndex - case 53: + case 58: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7092,15 +10556,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.ReleaseMsg{} + v := &validators.ApplyDiffMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_EscrowReleaseMsg{v} + m.Option = &ProposalOptions_ValidatorsApplyDiffMsg{v} iNdEx = postIndex - case 54: + case 59: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowReturnMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCreateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7127,15 +10591,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.ReturnMsg{} + v := ¤cy.CreateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_EscrowReturnMsg{v} + m.Option = &ProposalOptions_CurrencyCreateMsg{v} iNdEx = postIndex - case 55: + case 60: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowUpdatePartiesMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteProposalBatchMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7162,15 +10626,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.UpdatePartiesMsg{} + v := &ExecuteProposalBatchMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_EscrowUpdatePartiesMsg{v} + m.Option = &ProposalOptions_ExecuteProposalBatchMsg{v} iNdEx = postIndex - case 56: + case 61: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultisigCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsernameRegisterTokenMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7197,15 +10661,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &multisig.CreateMsg{} + v := &username.RegisterTokenMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_MultisigCreateMsg{v} + m.Option = &ProposalOptions_UsernameRegisterTokenMsg{v} iNdEx = postIndex - case 57: + case 62: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsernameTransferTokenMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7232,15 +10696,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &multisig.UpdateMsg{} + v := &username.TransferTokenMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_MultisigUpdateMsg{v} + m.Option = &ProposalOptions_UsernameTransferTokenMsg{v} iNdEx = postIndex - case 58: + case 63: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsernameChangeTokenTargetsMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7267,15 +10731,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &validators.ApplyDiffMsg{} + v := &username.ChangeTokenTargetsMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_ValidatorsApplyDiffMsg{v} + m.Option = &ProposalOptions_UsernameChangeTokenTargetsMsg{v} iNdEx = postIndex - case 59: + case 66: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionCreateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7302,15 +10766,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := ¤cy.CreateMsg{} + v := &distribution.CreateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_CurrencyCreateMsg{v} + m.Option = &ProposalOptions_DistributionCreateMsg{v} iNdEx = postIndex - case 61: + case 67: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameRegisterTokenMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7337,15 +10801,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.RegisterTokenMsg{} + v := &distribution.DistributeMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_UsernameRegisterTokenMsg{v} + m.Option = &ProposalOptions_DistributionMsg{v} iNdEx = postIndex - case 62: + case 68: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameTransferTokenMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionResetMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7372,15 +10836,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.TransferTokenMsg{} + v := &distribution.ResetMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_UsernameTransferTokenMsg{v} + m.Option = &ProposalOptions_DistributionResetMsg{v} iNdEx = postIndex - case 63: + case 69: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameChangeTokenTargetsMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MigrationUpgradeSchemaMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7407,15 +10871,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.ChangeTokenTargetsMsg{} + v := &migration.UpgradeSchemaMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_UsernameChangeTokenTargetsMsg{v} + m.Option = &ProposalOptions_MigrationUpgradeSchemaMsg{v} iNdEx = postIndex - case 66: + case 77: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectorateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7442,15 +10906,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.CreateMsg{} + v := &gov.UpdateElectorateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_DistributionCreateMsg{v} + m.Option = &ProposalOptions_GovUpdateElectorateMsg{v} iNdEx = postIndex - case 67: + case 78: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectionRuleMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7477,15 +10941,15 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.DistributeMsg{} + v := &gov.UpdateElectionRuleMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_DistributionMsg{v} + m.Option = &ProposalOptions_GovUpdateElectionRuleMsg{v} iNdEx = postIndex - case 68: + case 79: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionResetMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovCreateTextResolutionMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7512,11 +10976,11 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.ResetMsg{} + v := &gov.CreateTextResolutionMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_DistributionResetMsg{v} + m.Option = &ProposalOptions_GovCreateTextResolutionMsg{v} iNdEx = postIndex case 80: if wireType != 2 { @@ -7551,64 +11015,11 @@ func (m *ExecuteBatchMsg_Union) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteBatchMsg_Union_MsgfeeSetMsgFeeMsg{v} + m.Option = &ProposalOptions_MsgfeeSetMsgFeeMsg{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposalOptions) 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 ErrIntOverflowCodec - } - 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: ProposalOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 51: + case 81: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CashSendMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7635,15 +11046,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &cash.SendMsg{} + v := &blueaccount.RegisterDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_CashSendMsg{v} + m.Option = &ProposalOptions_BlueaccountRegisterDomainMsg{v} iNdEx = postIndex - case 53: + case 82: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7670,15 +11081,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.ReleaseMsg{} + v := &blueaccount.TransferDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_EscrowReleaseMsg{v} + m.Option = &ProposalOptions_BlueaccountTransferDomainMsg{v} iNdEx = postIndex - case 55: + case 83: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateEscrowPartiesMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRenewDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7705,15 +11116,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.UpdatePartiesMsg{} + v := &blueaccount.RenewDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_UpdateEscrowPartiesMsg{v} + m.Option = &ProposalOptions_BlueaccountRenewDomainMsg{v} iNdEx = postIndex - case 57: + case 84: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7740,15 +11151,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &multisig.UpdateMsg{} + v := &blueaccount.DeleteDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_MultisigUpdateMsg{v} + m.Option = &ProposalOptions_BlueaccountDeleteDomainMsg{v} iNdEx = postIndex - case 58: + case 85: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7775,15 +11186,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &validators.ApplyDiffMsg{} + v := &blueaccount.RegisterAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_ValidatorsApplyDiffMsg{v} + m.Option = &ProposalOptions_BlueaccountRegisterAccountMsg{v} iNdEx = postIndex - case 59: + case 86: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7810,15 +11221,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := ¤cy.CreateMsg{} + v := &blueaccount.TransferAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_CurrencyCreateMsg{v} + m.Option = &ProposalOptions_BlueaccountTransferAccountMsg{v} iNdEx = postIndex - case 60: + case 87: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecuteProposalBatchMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountReplaceAccountTargetMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7845,15 +11256,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ExecuteProposalBatchMsg{} + v := &blueaccount.ReplaceAccountTargetsMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_ExecuteProposalBatchMsg{v} + m.Option = &ProposalOptions_BlueaccountReplaceAccountTargetMsg{v} iNdEx = postIndex - case 61: + case 88: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameRegisterTokenMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7880,15 +11291,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.RegisterTokenMsg{} + v := &blueaccount.DeleteAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_UsernameRegisterTokenMsg{v} + m.Option = &ProposalOptions_BlueaccountDeleteAccountMsg{v} iNdEx = postIndex - case 62: + case 89: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameTransferTokenMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountUpdateConfigurationMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7915,15 +11326,68 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.TransferTokenMsg{} + v := &blueaccount.UpdateConfigurationMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_UsernameTransferTokenMsg{v} + m.Option = &ProposalOptions_BlueaccountUpdateConfigurationMsg{v} iNdEx = postIndex - case 63: + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExecuteProposalBatchMsg) 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 ErrIntOverflowCodec + } + 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: ExecuteProposalBatchMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExecuteProposalBatchMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameChangeTokenTargetsMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7950,15 +11414,67 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.ChangeTokenTargetsMsg{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Messages = append(m.Messages, ExecuteProposalBatchMsg_Union{}) + if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_UsernameChangeTokenTargetsMsg{v} iNdEx = postIndex - case 66: + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExecuteProposalBatchMsg_Union) 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 ErrIntOverflowCodec + } + 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: Union: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Union: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 51: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SendMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7985,15 +11501,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.CreateMsg{} + v := &cash.SendMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_DistributionCreateMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_SendMsg{v} iNdEx = postIndex - case 67: + case 53: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8020,15 +11536,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.DistributeMsg{} + v := &escrow.ReleaseMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_DistributionMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_EscrowReleaseMsg{v} iNdEx = postIndex - case 68: + case 55: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionResetMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpdateEscrowPartiesMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8055,15 +11571,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.ResetMsg{} + v := &escrow.UpdatePartiesMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_DistributionResetMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_UpdateEscrowPartiesMsg{v} iNdEx = postIndex - case 69: + case 57: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MigrationUpgradeSchemaMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8090,15 +11606,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &migration.UpgradeSchemaMsg{} + v := &multisig.UpdateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_MigrationUpgradeSchemaMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_MultisigUpdateMsg{v} iNdEx = postIndex - case 77: + case 58: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectorateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8125,15 +11641,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.UpdateElectorateMsg{} + v := &validators.ApplyDiffMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_GovUpdateElectorateMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_ValidatorsApplyDiffMsg{v} iNdEx = postIndex - case 78: + case 61: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectionRuleMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsernameRegisterTokenMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8160,15 +11676,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.UpdateElectionRuleMsg{} + v := &username.RegisterTokenMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_GovUpdateElectionRuleMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_UsernameRegisterTokenMsg{v} iNdEx = postIndex - case 79: + case 62: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovCreateTextResolutionMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsernameTransferTokenMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8195,15 +11711,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.CreateTextResolutionMsg{} + v := &username.TransferTokenMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_GovCreateTextResolutionMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_UsernameTransferTokenMsg{v} iNdEx = postIndex - case 80: + case 63: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgfeeSetMsgFeeMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsernameChangeTokenTargetsMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8230,68 +11746,15 @@ func (m *ProposalOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &msgfee.SetMsgFeeMsg{} + v := &username.ChangeTokenTargetsMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Option = &ProposalOptions_MsgfeeSetMsgFeeMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_UsernameChangeTokenTargetsMsg{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExecuteProposalBatchMsg) 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 ErrIntOverflowCodec - } - 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: ExecuteProposalBatchMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteProposalBatchMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 66: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionCreateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8318,67 +11781,15 @@ func (m *ExecuteProposalBatchMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, ExecuteProposalBatchMsg_Union{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &distribution.CreateMsg{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Sum = &ExecuteProposalBatchMsg_Union_DistributionCreateMsg{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExecuteProposalBatchMsg_Union) 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 ErrIntOverflowCodec - } - 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: Union: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Union: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 51: + case 67: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8405,15 +11816,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &cash.SendMsg{} + v := &distribution.DistributeMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_SendMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_DistributionMsg{v} iNdEx = postIndex - case 53: + case 68: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EscrowReleaseMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionResetMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8440,15 +11851,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.ReleaseMsg{} + v := &distribution.ResetMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_EscrowReleaseMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_DistributionResetMsg{v} iNdEx = postIndex - case 55: + case 77: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateEscrowPartiesMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectorateMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8475,15 +11886,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &escrow.UpdatePartiesMsg{} + v := &gov.UpdateElectorateMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_UpdateEscrowPartiesMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_GovUpdateElectorateMsg{v} iNdEx = postIndex - case 57: + case 78: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultisigUpdateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectionRuleMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8510,15 +11921,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &multisig.UpdateMsg{} + v := &gov.UpdateElectionRuleMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_MultisigUpdateMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_GovUpdateElectionRuleMsg{v} iNdEx = postIndex - case 58: + case 79: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsApplyDiffMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovCreateTextResolutionMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8545,15 +11956,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &validators.ApplyDiffMsg{} + v := &gov.CreateTextResolutionMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_ValidatorsApplyDiffMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg{v} iNdEx = postIndex - case 61: + case 80: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameRegisterTokenMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MsgfeeSetMsgFeeMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8580,15 +11991,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.RegisterTokenMsg{} + v := &msgfee.SetMsgFeeMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_UsernameRegisterTokenMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg{v} iNdEx = postIndex - case 62: + case 81: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameTransferTokenMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8615,15 +12026,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.TransferTokenMsg{} + v := &blueaccount.RegisterDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_UsernameTransferTokenMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountRegisterDomainMsg{v} iNdEx = postIndex - case 63: + case 82: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsernameChangeTokenTargetsMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8650,15 +12061,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &username.ChangeTokenTargetsMsg{} + v := &blueaccount.TransferDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_UsernameChangeTokenTargetsMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountTransferDomainMsg{v} iNdEx = postIndex - case 66: + case 83: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionCreateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRenewDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8685,15 +12096,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.CreateMsg{} + v := &blueaccount.RenewDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_DistributionCreateMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountRenewDomainMsg{v} iNdEx = postIndex - case 67: + case 84: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteDomainMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8720,15 +12131,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.DistributeMsg{} + v := &blueaccount.DeleteDomainMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_DistributionMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountDeleteDomainMsg{v} iNdEx = postIndex - case 68: + case 85: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionResetMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountRegisterAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8755,15 +12166,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &distribution.ResetMsg{} + v := &blueaccount.RegisterAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_DistributionResetMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountRegisterAccountMsg{v} iNdEx = postIndex - case 77: + case 86: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectorateMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountTransferAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8790,15 +12201,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.UpdateElectorateMsg{} + v := &blueaccount.TransferAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_GovUpdateElectorateMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountTransferAccountMsg{v} iNdEx = postIndex - case 78: + case 87: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovUpdateElectionRuleMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountReplaceAccountTargetMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8825,15 +12236,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.UpdateElectionRuleMsg{} + v := &blueaccount.ReplaceAccountTargetsMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_GovUpdateElectionRuleMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountReplaceAccountTargetMsg{v} iNdEx = postIndex - case 79: + case 88: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovCreateTextResolutionMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountDeleteAccountMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8860,15 +12271,15 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &gov.CreateTextResolutionMsg{} + v := &blueaccount.DeleteAccountMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_GovCreateTextResolutionMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountDeleteAccountMsg{v} iNdEx = postIndex - case 80: + case 89: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgfeeSetMsgFeeMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlueaccountUpdateConfigurationMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8895,11 +12306,11 @@ func (m *ExecuteProposalBatchMsg_Union) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &msgfee.SetMsgFeeMsg{} + v := &blueaccount.UpdateConfigurationMsg{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &ExecuteProposalBatchMsg_Union_MsgfeeSetMsgFeeMsg{v} + m.Sum = &ExecuteProposalBatchMsg_Union_BlueaccountUpdateConfigurationMsg{v} iNdEx = postIndex default: iNdEx = preIndex diff --git a/cmd/bnsd/app/codec.proto b/cmd/bnsd/app/codec.proto index 4b0dd61d..fc421d22 100644 --- a/cmd/bnsd/app/codec.proto +++ b/cmd/bnsd/app/codec.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package bnsd; +import "cmd/bnsd/x/blueaccount/codec.proto"; import "cmd/bnsd/x/username/codec.proto"; import "gogoproto/gogo.proto"; import "migration/codec.proto"; @@ -65,6 +66,15 @@ message Tx { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; // 79 is reserved (see ProposalOptions: TextResolutionMsg) msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } @@ -91,6 +101,15 @@ message ExecuteBatchMsg { // upgrade schema is important enough, it should be a solo action // aswap and gov don't make much sense as part of a batch (no vote buying) msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } repeated Union messages = 1 [(gogoproto.nullable) = false]; @@ -118,6 +137,15 @@ message ProposalOptions { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79; msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } @@ -141,6 +169,15 @@ message ExecuteProposalBatchMsg { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79; msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } repeated Union messages = 1 [(gogoproto.nullable) = false]; diff --git a/cmd/bnsd/x/blueaccount/codec.pb.go b/cmd/bnsd/x/blueaccount/codec.pb.go new file mode 100644 index 00000000..0d18e075 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/codec.pb.go @@ -0,0 +1,4305 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cmd/bnsd/x/blueaccount/codec.proto + +package blueaccount + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_iov_one_weave "github.com/iov-one/weave" + weave "github.com/iov-one/weave" + io "io" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// Domain represents a blue account domain. +// +// Domain is a container for accounts. Account representation is +// `*`. +// Each domain owner controls all accounts that belong to that domain. +// Each domain controls expiration of all accounts that belong to that domain. +// +// Because of the functionality that the Red Account provides, Blue Account +// domain must not be `iov` as this is a domain used by Red Account +// functionality. +type Domain struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + // Owner is a weave.Address that controls this domain and all accounts that + // belong to this domain. + Owner github_com_iov_one_weave.Address `protobuf:"bytes,3,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` + // Valid till defines the expiration date for the domain. Expired domain + // cannot be used or modified. None of the accounts that belong to an expired + // domain can be used of modified as well. + ValidTill github_com_iov_one_weave.UnixTime `protobuf:"varint,4,opt,name=valid_till,json=validTill,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"valid_till,omitempty"` +} + +func (m *Domain) Reset() { *m = Domain{} } +func (m *Domain) String() string { return proto.CompactTextString(m) } +func (*Domain) ProtoMessage() {} +func (*Domain) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{0} +} +func (m *Domain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Domain.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Domain) XXX_Merge(src proto.Message) { + xxx_messageInfo_Domain.Merge(m, src) +} +func (m *Domain) XXX_Size() int { + return m.Size() +} +func (m *Domain) XXX_DiscardUnknown() { + xxx_messageInfo_Domain.DiscardUnknown(m) +} + +var xxx_messageInfo_Domain proto.InternalMessageInfo + +func (m *Domain) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Domain) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *Domain) GetOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.Owner + } + return nil +} + +func (m *Domain) GetValidTill() github_com_iov_one_weave.UnixTime { + if m != nil { + return m.ValidTill + } + return 0 +} + +// Account represents a blue account name. +// +// String representation of an account is `*`. Empty name is an +// acceptable account string. Complete validation rules for name and domain are +// declared by configuration entity. +// +// An account must always belong to an existing domain. +type Account struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Domain references a domain that this account belongs to. + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // Owner is a weave.Address that controls this account. Can be empty. + // + // An account is always owned by the domain owner and as such, regardless + // the owner field value, can be edited by the domain owner that this account + // belongs to. + // Setting the owner attribute to an address different than the domain owner + // extends the domain owner permission and allows to manage a single account + // to someone else than the domain owner. + Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` + Targets []BlockchainAddress `protobuf:"bytes,5,rep,name=targets,proto3" json:"targets"` +} + +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} +func (*Account) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{1} +} +func (m *Account) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Account.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return m.Size() +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) +} + +var xxx_messageInfo_Account proto.InternalMessageInfo + +func (m *Account) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Account) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *Account) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Account) GetOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.Owner + } + return nil +} + +func (m *Account) GetTargets() []BlockchainAddress { + if m != nil { + return m.Targets + } + return nil +} + +// BlockchainAddress represents a blochain address. This structure clubs together +// blokchain ID together with an address on that network. It is used to point +// to an address on any blockchain network. +type BlockchainAddress struct { + // An arbitrary blockchain ID. + BlockchainID string `protobuf:"bytes,1,opt,name=blockchain_id,json=blockchainId,proto3" json:"blockchain_id,omitempty"` + // An address on the specified blockchain network. Address is not a + // weave.Address as we cannot know what is the format of an address on the + // chain that this token instance links to. Because we do not know the rules + // to validate an address for any blockchain ID, this is an arbitrary bulk of + // data. + // It is more convinient to always use encoded representation of each address + // and store it as a string. Using bytes while compact is not as comfortable + // to use. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *BlockchainAddress) Reset() { *m = BlockchainAddress{} } +func (m *BlockchainAddress) String() string { return proto.CompactTextString(m) } +func (*BlockchainAddress) ProtoMessage() {} +func (*BlockchainAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{2} +} +func (m *BlockchainAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockchainAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockchainAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockchainAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockchainAddress.Merge(m, src) +} +func (m *BlockchainAddress) XXX_Size() int { + return m.Size() +} +func (m *BlockchainAddress) XXX_DiscardUnknown() { + xxx_messageInfo_BlockchainAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockchainAddress proto.InternalMessageInfo + +func (m *BlockchainAddress) GetBlockchainID() string { + if m != nil { + return m.BlockchainID + } + return "" +} + +func (m *BlockchainAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// Configuration is a dynamic configuration used by this extension, managed by +// the functionality provided by gconf package. +type Configuration struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Owner is present to implement gconf.OwnedConfig interface + // This defines the Address that is allowed to update the Configuration object and is + // needed to make use of gconf.NewUpdateConfigurationHandler + Owner github_com_iov_one_weave.Address `protobuf:"bytes,2,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` + // Valid domain defines a regular expression that every valid domain of an + // account must match. Rule must not include the asterisk (*) character. + ValidDomain string `protobuf:"bytes,3,opt,name=valid_domain,json=validDomain,proto3" json:"valid_domain,omitempty"` + // Valid name defines a regular expression that every valid name of an + // account must match. Rule must not include the asterisk (*) character. + ValidName string `protobuf:"bytes,4,opt,name=valid_name,json=validName,proto3" json:"valid_name,omitempty"` + // Domain review defines the duration of the domain renewal period. + DomainRenew github_com_iov_one_weave.UnixDuration `protobuf:"varint,6,opt,name=domain_renew,json=domainRenew,proto3,casttype=github.com/iov-one/weave.UnixDuration" json:"domain_renew,omitempty"` +} + +func (m *Configuration) Reset() { *m = Configuration{} } +func (m *Configuration) String() string { return proto.CompactTextString(m) } +func (*Configuration) ProtoMessage() {} +func (*Configuration) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{3} +} +func (m *Configuration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Configuration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Configuration) XXX_Merge(src proto.Message) { + xxx_messageInfo_Configuration.Merge(m, src) +} +func (m *Configuration) XXX_Size() int { + return m.Size() +} +func (m *Configuration) XXX_DiscardUnknown() { + xxx_messageInfo_Configuration.DiscardUnknown(m) +} + +var xxx_messageInfo_Configuration proto.InternalMessageInfo + +func (m *Configuration) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Configuration) GetOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.Owner + } + return nil +} + +func (m *Configuration) GetValidDomain() string { + if m != nil { + return m.ValidDomain + } + return "" +} + +func (m *Configuration) GetValidName() string { + if m != nil { + return m.ValidName + } + return "" +} + +func (m *Configuration) GetDomainRenew() github_com_iov_one_weave.UnixDuration { + if m != nil { + return m.DomainRenew + } + return 0 +} + +// UpdateConfigurationMsg is used by the gconf extension to update the +// configuration. +type UpdateConfigurationMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Patch *Configuration `protobuf:"bytes,2,opt,name=patch,proto3" json:"patch,omitempty"` +} + +func (m *UpdateConfigurationMsg) Reset() { *m = UpdateConfigurationMsg{} } +func (m *UpdateConfigurationMsg) String() string { return proto.CompactTextString(m) } +func (*UpdateConfigurationMsg) ProtoMessage() {} +func (*UpdateConfigurationMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{4} +} +func (m *UpdateConfigurationMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateConfigurationMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateConfigurationMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdateConfigurationMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateConfigurationMsg.Merge(m, src) +} +func (m *UpdateConfigurationMsg) XXX_Size() int { + return m.Size() +} +func (m *UpdateConfigurationMsg) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateConfigurationMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateConfigurationMsg proto.InternalMessageInfo + +func (m *UpdateConfigurationMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *UpdateConfigurationMsg) GetPatch() *Configuration { + if m != nil { + return m.Patch + } + return nil +} + +// RegisterDomainMsg is issuing registration of a new domain. Requested +// domain name must be available (not yet registed) in order for the request to +// succeed. +// Registering a domain creates an account with no name that belongs to this +// domain. +type RegisterDomainMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Owner holds the address of the newly registered domain. If not provided, + // main signer is used. + Owner github_com_iov_one_weave.Address `protobuf:"bytes,2,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` + // Domain part of the account that should be registered. + Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to register a domain. Storing a client token + // helps identify contribution of such party later. + ClientToken []byte `protobuf:"bytes,4,opt,name=client_token,json=clientToken,proto3" json:"client_token,omitempty"` +} + +func (m *RegisterDomainMsg) Reset() { *m = RegisterDomainMsg{} } +func (m *RegisterDomainMsg) String() string { return proto.CompactTextString(m) } +func (*RegisterDomainMsg) ProtoMessage() {} +func (*RegisterDomainMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{5} +} +func (m *RegisterDomainMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RegisterDomainMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RegisterDomainMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RegisterDomainMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterDomainMsg.Merge(m, src) +} +func (m *RegisterDomainMsg) XXX_Size() int { + return m.Size() +} +func (m *RegisterDomainMsg) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterDomainMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisterDomainMsg proto.InternalMessageInfo + +func (m *RegisterDomainMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *RegisterDomainMsg) GetOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.Owner + } + return nil +} + +func (m *RegisterDomainMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *RegisterDomainMsg) GetClientToken() []byte { + if m != nil { + return m.ClientToken + } + return nil +} + +// TransferDomainMsg is issuing an ownership transfer over specified domain. +type TransferDomainMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Name of the domain that is transferred. + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + // New owner holds the address that the ownership of the domain is + // transferred to. + NewOwner github_com_iov_one_weave.Address `protobuf:"bytes,3,opt,name=new_owner,json=newOwner,proto3,casttype=github.com/iov-one/weave.Address" json:"new_owner,omitempty"` +} + +func (m *TransferDomainMsg) Reset() { *m = TransferDomainMsg{} } +func (m *TransferDomainMsg) String() string { return proto.CompactTextString(m) } +func (*TransferDomainMsg) ProtoMessage() {} +func (*TransferDomainMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{6} +} +func (m *TransferDomainMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransferDomainMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransferDomainMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TransferDomainMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferDomainMsg.Merge(m, src) +} +func (m *TransferDomainMsg) XXX_Size() int { + return m.Size() +} +func (m *TransferDomainMsg) XXX_DiscardUnknown() { + xxx_messageInfo_TransferDomainMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferDomainMsg proto.InternalMessageInfo + +func (m *TransferDomainMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *TransferDomainMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *TransferDomainMsg) GetNewOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.NewOwner + } + return nil +} + +// RenewDomainMsg is issuing a domain expiration time extension. Extension +// period is defined by the configuration entity. +type RenewDomainMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Name of the domain that is transferred. + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + ClientToken []byte `protobuf:"bytes,3,opt,name=client_token,json=clientToken,proto3" json:"client_token,omitempty"` +} + +func (m *RenewDomainMsg) Reset() { *m = RenewDomainMsg{} } +func (m *RenewDomainMsg) String() string { return proto.CompactTextString(m) } +func (*RenewDomainMsg) ProtoMessage() {} +func (*RenewDomainMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{7} +} +func (m *RenewDomainMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RenewDomainMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RenewDomainMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RenewDomainMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_RenewDomainMsg.Merge(m, src) +} +func (m *RenewDomainMsg) XXX_Size() int { + return m.Size() +} +func (m *RenewDomainMsg) XXX_DiscardUnknown() { + xxx_messageInfo_RenewDomainMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_RenewDomainMsg proto.InternalMessageInfo + +func (m *RenewDomainMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *RenewDomainMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *RenewDomainMsg) GetClientToken() []byte { + if m != nil { + return m.ClientToken + } + return nil +} + +// DeleteDomainMsg issues deletion of a domain and all accounts that belong to +// that domain. +type DeleteDomainMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Name of the domain that is deleted. + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` +} + +func (m *DeleteDomainMsg) Reset() { *m = DeleteDomainMsg{} } +func (m *DeleteDomainMsg) String() string { return proto.CompactTextString(m) } +func (*DeleteDomainMsg) ProtoMessage() {} +func (*DeleteDomainMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{8} +} +func (m *DeleteDomainMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteDomainMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteDomainMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteDomainMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteDomainMsg.Merge(m, src) +} +func (m *DeleteDomainMsg) XXX_Size() int { + return m.Size() +} +func (m *DeleteDomainMsg) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteDomainMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteDomainMsg proto.InternalMessageInfo + +func (m *DeleteDomainMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *DeleteDomainMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +// RegisterAccountMsg issues registration of an account. Requested domain must +// exist and belong to the same user that signs this message. +type RegisterAccountMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Domain that a new account is the be registered under. + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + // Name that a new account is the be registered with. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // Owner holds the address of the newly registered account. Can be empty to + // leave the administration to the domain owner only. + Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + Targets []BlockchainAddress `protobuf:"bytes,5,rep,name=targets,proto3" json:"targets"` + ClientToken []byte `protobuf:"bytes,6,opt,name=client_token,json=clientToken,proto3" json:"client_token,omitempty"` +} + +func (m *RegisterAccountMsg) Reset() { *m = RegisterAccountMsg{} } +func (m *RegisterAccountMsg) String() string { return proto.CompactTextString(m) } +func (*RegisterAccountMsg) ProtoMessage() {} +func (*RegisterAccountMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{9} +} +func (m *RegisterAccountMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RegisterAccountMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RegisterAccountMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RegisterAccountMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterAccountMsg.Merge(m, src) +} +func (m *RegisterAccountMsg) XXX_Size() int { + return m.Size() +} +func (m *RegisterAccountMsg) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterAccountMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisterAccountMsg proto.InternalMessageInfo + +func (m *RegisterAccountMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *RegisterAccountMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *RegisterAccountMsg) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *RegisterAccountMsg) GetOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.Owner + } + return nil +} + +func (m *RegisterAccountMsg) GetTargets() []BlockchainAddress { + if m != nil { + return m.Targets + } + return nil +} + +func (m *RegisterAccountMsg) GetClientToken() []byte { + if m != nil { + return m.ClientToken + } + return nil +} + +// TransferAccountMsg is issuing an ownership transfer over specified account. +// Transfering an account ownership does not affect related domain owner +// permissions to administrate that account. +type TransferAccountMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // New owner holds the address that the ownership of the domain is + // transferred to. + NewOwner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=new_owner,json=newOwner,proto3,casttype=github.com/iov-one/weave.Address" json:"new_owner,omitempty"` +} + +func (m *TransferAccountMsg) Reset() { *m = TransferAccountMsg{} } +func (m *TransferAccountMsg) String() string { return proto.CompactTextString(m) } +func (*TransferAccountMsg) ProtoMessage() {} +func (*TransferAccountMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{10} +} +func (m *TransferAccountMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransferAccountMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransferAccountMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TransferAccountMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferAccountMsg.Merge(m, src) +} +func (m *TransferAccountMsg) XXX_Size() int { + return m.Size() +} +func (m *TransferAccountMsg) XXX_DiscardUnknown() { + xxx_messageInfo_TransferAccountMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferAccountMsg proto.InternalMessageInfo + +func (m *TransferAccountMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *TransferAccountMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *TransferAccountMsg) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TransferAccountMsg) GetNewOwner() github_com_iov_one_weave.Address { + if m != nil { + return m.NewOwner + } + return nil +} + +// ReplaceAccountTargetsMsg is issuing rewrite of all targets that given +// account points to. +type ReplaceAccountTargetsMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + NewTargets []BlockchainAddress `protobuf:"bytes,5,rep,name=new_targets,json=newTargets,proto3" json:"new_targets"` +} + +func (m *ReplaceAccountTargetsMsg) Reset() { *m = ReplaceAccountTargetsMsg{} } +func (m *ReplaceAccountTargetsMsg) String() string { return proto.CompactTextString(m) } +func (*ReplaceAccountTargetsMsg) ProtoMessage() {} +func (*ReplaceAccountTargetsMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{11} +} +func (m *ReplaceAccountTargetsMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ReplaceAccountTargetsMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ReplaceAccountTargetsMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ReplaceAccountTargetsMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReplaceAccountTargetsMsg.Merge(m, src) +} +func (m *ReplaceAccountTargetsMsg) XXX_Size() int { + return m.Size() +} +func (m *ReplaceAccountTargetsMsg) XXX_DiscardUnknown() { + xxx_messageInfo_ReplaceAccountTargetsMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_ReplaceAccountTargetsMsg proto.InternalMessageInfo + +func (m *ReplaceAccountTargetsMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *ReplaceAccountTargetsMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *ReplaceAccountTargetsMsg) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ReplaceAccountTargetsMsg) GetNewTargets() []BlockchainAddress { + if m != nil { + return m.NewTargets + } + return nil +} + +// DeleteAccountMsg issues deletion of a name that belongs to given domain. +// Message must be signed by the domain owner. +type DeleteAccountMsg struct { + Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *DeleteAccountMsg) Reset() { *m = DeleteAccountMsg{} } +func (m *DeleteAccountMsg) String() string { return proto.CompactTextString(m) } +func (*DeleteAccountMsg) ProtoMessage() {} +func (*DeleteAccountMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_df2ac0ab2dae2b1e, []int{12} +} +func (m *DeleteAccountMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteAccountMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteAccountMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteAccountMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteAccountMsg.Merge(m, src) +} +func (m *DeleteAccountMsg) XXX_Size() int { + return m.Size() +} +func (m *DeleteAccountMsg) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteAccountMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteAccountMsg proto.InternalMessageInfo + +func (m *DeleteAccountMsg) GetMetadata() *weave.Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *DeleteAccountMsg) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *DeleteAccountMsg) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Domain)(nil), "blueaccount.Domain") + proto.RegisterType((*Account)(nil), "blueaccount.Account") + proto.RegisterType((*BlockchainAddress)(nil), "blueaccount.BlockchainAddress") + proto.RegisterType((*Configuration)(nil), "blueaccount.Configuration") + proto.RegisterType((*UpdateConfigurationMsg)(nil), "blueaccount.UpdateConfigurationMsg") + proto.RegisterType((*RegisterDomainMsg)(nil), "blueaccount.RegisterDomainMsg") + proto.RegisterType((*TransferDomainMsg)(nil), "blueaccount.TransferDomainMsg") + proto.RegisterType((*RenewDomainMsg)(nil), "blueaccount.RenewDomainMsg") + proto.RegisterType((*DeleteDomainMsg)(nil), "blueaccount.DeleteDomainMsg") + proto.RegisterType((*RegisterAccountMsg)(nil), "blueaccount.RegisterAccountMsg") + proto.RegisterType((*TransferAccountMsg)(nil), "blueaccount.TransferAccountMsg") + proto.RegisterType((*ReplaceAccountTargetsMsg)(nil), "blueaccount.ReplaceAccountTargetsMsg") + proto.RegisterType((*DeleteAccountMsg)(nil), "blueaccount.DeleteAccountMsg") +} + +func init() { proto.RegisterFile("cmd/bnsd/x/blueaccount/codec.proto", fileDescriptor_df2ac0ab2dae2b1e) } + +var fileDescriptor_df2ac0ab2dae2b1e = []byte{ + // 677 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x6a, 0xdb, 0x4a, + 0x14, 0xf6, 0xd8, 0x8a, 0x13, 0x1f, 0x39, 0x37, 0x89, 0xb8, 0x04, 0x11, 0xb8, 0xb2, 0x23, 0x6e, + 0xc0, 0x97, 0x4b, 0xad, 0x92, 0xd2, 0x4d, 0x17, 0x85, 0xb8, 0xee, 0x22, 0xd0, 0xb4, 0x20, 0x9c, + 0x6e, 0xcd, 0x58, 0x3a, 0x51, 0x86, 0xc8, 0x33, 0x46, 0x1a, 0x47, 0x79, 0x84, 0x2e, 0xba, 0xe8, + 0xbe, 0x2f, 0xd1, 0x5d, 0xa1, 0x4f, 0x90, 0x5d, 0xb3, 0xec, 0xca, 0x14, 0xe7, 0x2d, 0xb2, 0x2a, + 0xd6, 0xc8, 0xb1, 0x5d, 0x93, 0x82, 0x53, 0x13, 0xba, 0x1b, 0x1d, 0x9d, 0x6f, 0x74, 0xbe, 0x9f, + 0x19, 0x04, 0xb6, 0xd7, 0xf5, 0x9d, 0x0e, 0x8f, 0x7d, 0xe7, 0xc2, 0xe9, 0x84, 0x7d, 0xa4, 0x9e, + 0x27, 0xfa, 0x5c, 0x3a, 0x9e, 0xf0, 0xd1, 0xab, 0xf7, 0x22, 0x21, 0x85, 0xa1, 0x4f, 0xbd, 0xd8, + 0xd1, 0xa7, 0xde, 0xec, 0xfc, 0x1d, 0x88, 0x40, 0xa4, 0x4b, 0x67, 0xb4, 0x52, 0x55, 0xfb, 0x2b, + 0x81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b5, 0xd6, 0xa8, + 0x64, 0x7f, 0x24, 0xb0, 0xd5, 0x8a, 0x28, 0x8f, 0x4f, 0xee, 0x3d, 0xf9, 0x5d, 0xc7, 0xf1, 0x00, + 0x4a, 0x1c, 0x93, 0xf6, 0xe2, 0xb7, 0xcc, 0x1a, 0xc7, 0xe4, 0xcd, 0x08, 0x65, 0x5f, 0xc0, 0x5f, + 0xa9, 0xb3, 0x4b, 0x9e, 0xec, 0x67, 0x5d, 0x0a, 0xf3, 0xba, 0xbc, 0x85, 0x8d, 0x26, 0x86, 0x28, + 0x71, 0xb9, 0x9f, 0xb6, 0xdf, 0xe7, 0xc1, 0x18, 0x27, 0x25, 0xbb, 0xfc, 0x96, 0x46, 0xeb, 0x0f, + 0xbb, 0xff, 0xe6, 0x64, 0x2e, 0xce, 0xcb, 0xfc, 0x89, 0x80, 0x31, 0x8e, 0xdf, 0x43, 0xc8, 0x31, + 0x93, 0x49, 0xed, 0x5e, 0x99, 0xfc, 0x42, 0xc0, 0x74, 0xb1, 0x17, 0x52, 0x0f, 0xb3, 0x89, 0x5b, + 0x8a, 0xef, 0xd2, 0x07, 0xd7, 0xa6, 0x06, 0x7f, 0x09, 0xfa, 0x68, 0xf0, 0xfb, 0xf8, 0x01, 0x1c, + 0x93, 0x6c, 0x44, 0xfb, 0x0c, 0x36, 0x55, 0xac, 0x1f, 0x40, 0xec, 0x86, 0x79, 0x39, 0xb4, 0xc8, + 0xd5, 0xd0, 0x22, 0xdf, 0x87, 0x16, 0xf9, 0x70, 0x6d, 0xe5, 0xae, 0xae, 0xad, 0xdc, 0xb7, 0x6b, + 0x2b, 0xd7, 0x29, 0xa6, 0xff, 0x34, 0x4f, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x41, 0xf5, 0x92, + 0x94, 0x29, 0x09, 0x00, 0x00, +} + +func (m *Domain) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Domain) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n1, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.Owner) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) + i += copy(dAtA[i:], m.Owner) + } + if m.ValidTill != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.ValidTill)) + } + return i, nil +} + +func (m *Account) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Account) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n2, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.Name) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Owner) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) + i += copy(dAtA[i:], m.Owner) + } + if len(m.Targets) > 0 { + for _, msg := range m.Targets { + dAtA[i] = 0x2a + i++ + i = encodeVarintCodec(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *BlockchainAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockchainAddress) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.BlockchainID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.BlockchainID))) + i += copy(dAtA[i:], m.BlockchainID) + } + if len(m.Address) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Address))) + i += copy(dAtA[i:], m.Address) + } + return i, nil +} + +func (m *Configuration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Configuration) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n3, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + if len(m.Owner) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) + i += copy(dAtA[i:], m.Owner) + } + if len(m.ValidDomain) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.ValidDomain))) + i += copy(dAtA[i:], m.ValidDomain) + } + if len(m.ValidName) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.ValidName))) + i += copy(dAtA[i:], m.ValidName) + } + if m.DomainRenew != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.DomainRenew)) + } + return i, nil +} + +func (m *UpdateConfigurationMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateConfigurationMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n4, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + if m.Patch != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Patch.Size())) + n5, err := m.Patch.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + } + return i, nil +} + +func (m *RegisterDomainMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisterDomainMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n6, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + } + if len(m.Owner) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) + i += copy(dAtA[i:], m.Owner) + } + if len(m.Domain) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.ClientToken) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.ClientToken))) + i += copy(dAtA[i:], m.ClientToken) + } + return i, nil +} + +func (m *TransferDomainMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TransferDomainMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n7, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.NewOwner) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.NewOwner))) + i += copy(dAtA[i:], m.NewOwner) + } + return i, nil +} + +func (m *RenewDomainMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RenewDomainMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n8, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.ClientToken) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.ClientToken))) + i += copy(dAtA[i:], m.ClientToken) + } + return i, nil +} + +func (m *DeleteDomainMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteDomainMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n9, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + return i, nil +} + +func (m *RegisterAccountMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisterAccountMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n10, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n10 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.Name) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Owner) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) + i += copy(dAtA[i:], m.Owner) + } + if len(m.Targets) > 0 { + for _, msg := range m.Targets { + dAtA[i] = 0x2a + i++ + i = encodeVarintCodec(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.ClientToken) > 0 { + dAtA[i] = 0x32 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.ClientToken))) + i += copy(dAtA[i:], m.ClientToken) + } + return i, nil +} + +func (m *TransferAccountMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TransferAccountMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n11, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n11 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.Name) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.NewOwner) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.NewOwner))) + i += copy(dAtA[i:], m.NewOwner) + } + return i, nil +} + +func (m *ReplaceAccountTargetsMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReplaceAccountTargetsMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n12, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n12 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.Name) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.NewTargets) > 0 { + for _, msg := range m.NewTargets { + dAtA[i] = 0x2a + i++ + i = encodeVarintCodec(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *DeleteAccountMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteAccountMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metadata != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.Metadata.Size())) + n13, err := m.Metadata.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n13 + } + if len(m.Domain) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) + i += copy(dAtA[i:], m.Domain) + } + if len(m.Name) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintCodec(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + return i, nil +} + +func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *Domain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if m.ValidTill != 0 { + n += 1 + sovCodec(uint64(m.ValidTill)) + } + return n +} + +func (m *Account) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if len(m.Targets) > 0 { + for _, e := range m.Targets { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + return n +} + +func (m *BlockchainAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BlockchainID) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *Configuration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.ValidDomain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.ValidName) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if m.DomainRenew != 0 { + n += 1 + sovCodec(uint64(m.DomainRenew)) + } + return n +} + +func (m *UpdateConfigurationMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + if m.Patch != nil { + l = m.Patch.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *RegisterDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.ClientToken) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *TransferDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.NewOwner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *RenewDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.ClientToken) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *DeleteDomainMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *RegisterAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if len(m.Targets) > 0 { + for _, e := range m.Targets { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + l = len(m.ClientToken) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *TransferAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.NewOwner) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *ReplaceAccountTargetsMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if len(m.NewTargets) > 0 { + for _, e := range m.NewTargets { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + return n +} + +func (m *DeleteAccountMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func sovCodec(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozCodec(x uint64) (n int) { + return sovCodec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Domain) 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 ErrIntOverflowCodec + } + 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: Domain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Domain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidTill", wireType) + } + m.ValidTill = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidTill |= github_com_iov_one_weave.UnixTime(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Account) 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 ErrIntOverflowCodec + } + 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: Account: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Targets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Targets = append(m.Targets, BlockchainAddress{}) + if err := m.Targets[len(m.Targets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockchainAddress) 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 ErrIntOverflowCodec + } + 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: BlockchainAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockchainAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockchainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockchainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Configuration) 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 ErrIntOverflowCodec + } + 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: Configuration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Configuration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidDomain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidDomain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DomainRenew", wireType) + } + m.DomainRenew = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DomainRenew |= github_com_iov_one_weave.UnixDuration(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateConfigurationMsg) 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 ErrIntOverflowCodec + } + 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: UpdateConfigurationMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateConfigurationMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Patch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Patch == nil { + m.Patch = &Configuration{} + } + if err := m.Patch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegisterDomainMsg) 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 ErrIntOverflowCodec + } + 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: RegisterDomainMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterDomainMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientToken", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientToken = append(m.ClientToken[:0], dAtA[iNdEx:postIndex]...) + if m.ClientToken == nil { + m.ClientToken = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransferDomainMsg) 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 ErrIntOverflowCodec + } + 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: TransferDomainMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransferDomainMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewOwner = append(m.NewOwner[:0], dAtA[iNdEx:postIndex]...) + if m.NewOwner == nil { + m.NewOwner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RenewDomainMsg) 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 ErrIntOverflowCodec + } + 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: RenewDomainMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RenewDomainMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientToken", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientToken = append(m.ClientToken[:0], dAtA[iNdEx:postIndex]...) + if m.ClientToken == nil { + m.ClientToken = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteDomainMsg) 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 ErrIntOverflowCodec + } + 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: DeleteDomainMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteDomainMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegisterAccountMsg) 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 ErrIntOverflowCodec + } + 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: RegisterAccountMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterAccountMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Targets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Targets = append(m.Targets, BlockchainAddress{}) + if err := m.Targets[len(m.Targets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientToken", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientToken = append(m.ClientToken[:0], dAtA[iNdEx:postIndex]...) + if m.ClientToken == nil { + m.ClientToken = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransferAccountMsg) 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 ErrIntOverflowCodec + } + 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: TransferAccountMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransferAccountMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewOwner = append(m.NewOwner[:0], dAtA[iNdEx:postIndex]...) + if m.NewOwner == nil { + m.NewOwner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ReplaceAccountTargetsMsg) 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 ErrIntOverflowCodec + } + 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: ReplaceAccountTargetsMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReplaceAccountTargetsMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewTargets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewTargets = append(m.NewTargets, BlockchainAddress{}) + if err := m.NewTargets[len(m.NewTargets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteAccountMsg) 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 ErrIntOverflowCodec + } + 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: DeleteAccountMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteAccountMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &weave.Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCodec(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCodec + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCodec + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCodec + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCodec + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthCodec + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCodec + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipCodec(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthCodec + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") +) diff --git a/cmd/bnsd/x/blueaccount/codec.proto b/cmd/bnsd/x/blueaccount/codec.proto new file mode 100644 index 00000000..ad9f2d52 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/codec.proto @@ -0,0 +1,192 @@ +syntax = "proto3"; + +package blueaccount; + +import "codec.proto"; +import "gogoproto/gogo.proto"; + +// Domain represents a blue account domain. +// +// Domain is a container for accounts. Account representation is +// `*`. +// Each domain owner controls all accounts that belong to that domain. +// Each domain controls expiration of all accounts that belong to that domain. +// +// Because of the functionality that the Red Account provides, Blue Account +// domain must not be `iov` as this is a domain used by Red Account +// functionality. +message Domain { + weave.Metadata metadata = 1; + string domain = 2; + // Owner is a weave.Address that controls this domain and all accounts that + // belong to this domain. + bytes owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Valid till defines the expiration date for the domain. Expired domain + // cannot be used or modified. None of the accounts that belong to an expired + // domain can be used of modified as well. + int64 valid_till = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; +} + +// Account represents a blue account name. +// +// String representation of an account is `*`. Empty name is an +// acceptable account string. Complete validation rules for name and domain are +// declared by configuration entity. +// +// An account must always belong to an existing domain. +message Account { + weave.Metadata metadata = 1; + // Domain references a domain that this account belongs to. + string domain = 2; + string name = 3; + // Owner is a weave.Address that controls this account. Can be empty. + // + // An account is always owned by the domain owner and as such, regardless + // the owner field value, can be edited by the domain owner that this account + // belongs to. + // Setting the owner attribute to an address different than the domain owner + // extends the domain owner permission and allows to manage a single account + // to someone else than the domain owner. + bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; +} + +// BlockchainAddress represents a blochain address. This structure clubs together +// blokchain ID together with an address on that network. It is used to point +// to an address on any blockchain network. +message BlockchainAddress { + // An arbitrary blockchain ID. + string blockchain_id = 1 [(gogoproto.customname) = "BlockchainID"]; + // An address on the specified blockchain network. Address is not a + // weave.Address as we cannot know what is the format of an address on the + // chain that this token instance links to. Because we do not know the rules + // to validate an address for any blockchain ID, this is an arbitrary bulk of + // data. + // It is more convinient to always use encoded representation of each address + // and store it as a string. Using bytes while compact is not as comfortable + // to use. + string address = 2; +} + +// Configuration is a dynamic configuration used by this extension, managed by +// the functionality provided by gconf package. +message Configuration { + weave.Metadata metadata = 1; + // Owner is present to implement gconf.OwnedConfig interface + // This defines the Address that is allowed to update the Configuration object and is + // needed to make use of gconf.NewUpdateConfigurationHandler + bytes owner = 2 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Valid domain defines a regular expression that every valid domain of an + // account must match. Rule must not include the asterisk (*) character. + string valid_domain = 3; + // Valid name defines a regular expression that every valid name of an + // account must match. Rule must not include the asterisk (*) character. + string valid_name = 4; + // Domain review defines the duration of the domain renewal period. + int64 domain_renew = 6 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixDuration"]; +} + +// UpdateConfigurationMsg is used by the gconf extension to update the +// configuration. +message UpdateConfigurationMsg { + weave.Metadata metadata = 1; + Configuration patch = 2; +} + +// RegisterDomainMsg is issuing registration of a new domain. Requested +// domain name must be available (not yet registed) in order for the request to +// succeed. +// Registering a domain creates an account with no name that belongs to this +// domain. +message RegisterDomainMsg { + weave.Metadata metadata = 1; + // Owner holds the address of the newly registered domain. If not provided, + // main signer is used. + bytes owner = 2 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Domain part of the account that should be registered. + string domain = 3; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to register a domain. Storing a client token + // helps identify contribution of such party later. + bytes client_token = 4; +} + +// TransferDomainMsg is issuing an ownership transfer over specified domain. +message TransferDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is transferred. + string domain = 2; + // New owner holds the address that the ownership of the domain is + // transferred to. + bytes new_owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; +} + +// RenewDomainMsg is issuing a domain expiration time extension. Extension +// period is defined by the configuration entity. +message RenewDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is transferred. + string domain = 2; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + bytes client_token = 3; +} + +// DeleteDomainMsg issues deletion of a domain and all accounts that belong to +// that domain. +message DeleteDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is deleted. + string domain = 2; +} + +// RegisterAccountMsg issues registration of an account. Requested domain must +// exist and belong to the same user that signs this message. +message RegisterAccountMsg { + weave.Metadata metadata = 1; + // Domain that a new account is the be registered under. + string domain = 2; + // Name that a new account is the be registered with. + string name = 3; + // Owner holds the address of the newly registered account. Can be empty to + // leave the administration to the domain owner only. + bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; + bytes client_token = 6; +} + +// TransferAccountMsg is issuing an ownership transfer over specified account. +// Transfering an account ownership does not affect related domain owner +// permissions to administrate that account. +message TransferAccountMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 3; + // New owner holds the address that the ownership of the domain is + // transferred to. + bytes new_owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; +} + +// ReplaceAccountTargetsMsg is issuing rewrite of all targets that given +// account points to. +message ReplaceAccountTargetsMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 4; + repeated BlockchainAddress new_targets = 5 [(gogoproto.nullable) = false]; +} + +// DeleteAccountMsg issues deletion of a name that belongs to given domain. +// Message must be signed by the domain owner. +message DeleteAccountMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 3; +} diff --git a/cmd/bnsd/x/blueaccount/configuration.go b/cmd/bnsd/x/blueaccount/configuration.go new file mode 100644 index 00000000..33b00ec5 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/configuration.go @@ -0,0 +1,57 @@ +package blueaccount + +import ( + "regexp" + + "github.com/iov-one/weave/errors" + "github.com/iov-one/weave/gconf" + "github.com/iov-one/weave/migration" +) + +func init() { + migration.MustRegister(1, &Configuration{}, migration.NoModification) +} + +func (c *Configuration) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", c.Metadata.Validate()) + errs = errors.AppendField(errs, "Owner", c.Owner.Validate()) + if err := validateRegexp(c.ValidDomain); err != nil { + errs = errors.AppendField(errs, "ValidDomain", err) + } + if err := validateRegexp(c.ValidName); err != nil { + errs = errors.AppendField(errs, "ValidName", err) + } + return errs +} + +// validateRegexp returns an error if provided string is not a valid regular +// expression. +// This function ensures that the regular expression is a complete match test +// by ensuring ^ and $ presence. +func validateRegexp(rx string) error { + if rx == "" { + return nil + } + if len(rx) > 1024 { + return errors.Wrap(errors.ErrInput, "too long") + } + _, err := regexp.Compile(rx) + if err != nil { + return errors.Wrap(errors.ErrInput, err.Error()) + } + + if rx[0] != '^' || rx[len(rx)-1] != '$' { + return errors.Wrap(errors.ErrInput, "regular expression must match the whole input, start with ^ and end with $ characters to enforce full match") + } + + return nil +} + +func loadConf(db gconf.Store) (*Configuration, error) { + var conf Configuration + if err := gconf.Load(db, "blueaccount", &conf); err != nil { + return nil, errors.Wrap(err, "load") + } + return &conf, nil +} diff --git a/cmd/bnsd/x/blueaccount/doc.go b/cmd/bnsd/x/blueaccount/doc.go new file mode 100644 index 00000000..f9e264c6 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/doc.go @@ -0,0 +1,6 @@ +/* +Package blueaccount implements Blue Account functionality. + +For more details, see https://github.com/iov-one/weave/issues/1031 +*/ +package blueaccount diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go new file mode 100644 index 00000000..36d76695 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -0,0 +1,519 @@ +package blueaccount + +import ( + "regexp" + + weave "github.com/iov-one/weave" + "github.com/iov-one/weave/errors" + "github.com/iov-one/weave/gconf" + "github.com/iov-one/weave/migration" + "github.com/iov-one/weave/orm" + "github.com/iov-one/weave/x" +) + +func RegisterQuery(qr weave.QueryRouter) { + NewDomainBucket().Register("domain", qr) + NewAccountBucket().Register("account", qr) +} + +func RegisterRoutes(r weave.Registry, auth x.Authenticator) { + r = migration.SchemaMigratingRegistry("blueaccount", r) + + domains := NewDomainBucket() + accounts := NewAccountBucket() + + r.Handle(&RegisterDomainMsg{}, ®isterDomaiHandler{ + domains: domains, + accounts: accounts, + auth: auth, + }) + r.Handle(&TransferDomainMsg{}, &transferDomaiHandler{ + domains: domains, + auth: auth, + }) + r.Handle(&RenewDomainMsg{}, &renewDomaiHandler{ + domains: domains, + auth: auth, + }) + r.Handle(&DeleteDomainMsg{}, &deleteDomaiHandler{ + domains: domains, + auth: auth, + }) + r.Handle(&RegisterAccountMsg{}, ®isterAccounHandler{ + auth: auth, + domains: domains, + accounts: accounts, + }) + r.Handle(&TransferAccountMsg{}, &transferAccounHandler{ + auth: auth, + domains: domains, + accounts: accounts, + }) + r.Handle(&ReplaceAccountTargetsMsg{}, &replaceAccountTargetHandler{ + auth: auth, + domains: domains, + accounts: accounts, + }) + r.Handle(&DeleteAccountMsg{}, &deleteAccounHandler{ + auth: auth, + domains: domains, + accounts: accounts, + }) + + r.Handle(&UpdateConfigurationMsg{}, gconf.NewUpdateConfigurationHandler( + "blueaccount", &Configuration{}, auth)) +} + +type registerDomaiHandler struct { + auth x.Authenticator + domains orm.ModelBucket + accounts orm.ModelBucket +} + +func (h *registerDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + + owner := msg.Owner + if len(owner) == 0 { + owner = x.MainSigner(ctx, h.auth).Address() + } + + now, err := weave.BlockTime(ctx) + if err != nil { + return nil, errors.Wrap(errors.ErrState, "block time not present in context") + } + conf, err := loadConf(db) + if err != nil { + return nil, errors.Wrap(err, "cannot load configuration") + } + domain := Domain{ + Metadata: &weave.Metadata{}, + Owner: owner, + Domain: msg.Domain, + ValidTill: weave.AsUnixTime(now.Add(conf.DomainRenew.Duration())), + } + if _, err := h.domains.Put(db, []byte(msg.Domain), &domain); err != nil { + return nil, errors.Wrap(err, "cannot store domain entity") + } + + // Registering a domain enforce existence of a username with an empty + // name. + account := Account{ + Metadata: &weave.Metadata{}, + Owner: nil, // Always delegate to the domain owner, never set explicitly. + Domain: msg.Domain, + Name: "", + } + if _, err := h.accounts.Put(db, accountKey("", msg.Domain), &account); err != nil { + return nil, errors.Wrap(err, "cannot store account entity") + } + + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *registerDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*RegisterDomainMsg, error) { + var msg RegisterDomainMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, errors.Wrap(err, "load msg") + } + switch err := h.domains.Has(db, []byte(msg.Domain)); { + case err == nil: + return nil, errors.Wrapf(errors.ErrDuplicate, "domain %q already registered", msg.Domain) + case errors.ErrNotFound.Is(err): + // All good. + default: + return nil, errors.Wrap(err, "cannot check if domain already exists") + } + + conf, err := loadConf(db) + if err != nil { + return nil, errors.Wrap(err, "cannot load configuration") + } + if ok, err := regexp.MatchString(conf.ValidDomain, msg.Domain); err != nil || !ok { + return nil, errors.Wrap(errors.ErrInput, "domain is not allowed") + } + + return &msg, nil +} + +type transferDomaiHandler struct { + auth x.Authenticator + domains orm.ModelBucket +} + +func (h *transferDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *transferDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + domain, msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + domain.Owner = msg.NewOwner + if _, err := h.domains.Put(db, []byte(msg.Domain), domain); err != nil { + return nil, errors.Wrap(err, "cannot store domain") + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *transferDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *TransferDomainMsg, error) { + var msg TransferDomainMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, nil, errors.Wrap(err, "cannot get domain") + } + if !h.auth.HasAddress(ctx, domain.Owner) { + return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only owner can transfer a domain") + } + if weave.IsExpired(ctx, domain.ValidTill) { + return nil, nil, errors.Wrap(errors.ErrExpired, "expired domain cannot be transferred") + } + return &domain, &msg, nil +} + +type renewDomaiHandler struct { + auth x.Authenticator + domains orm.ModelBucket +} + +func (h *renewDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *renewDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + domain, msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + + now, err := weave.BlockTime(ctx) + if err != nil { + return nil, errors.Wrap(errors.ErrState, "block time not present in context") + } + conf, err := loadConf(db) + if err != nil { + return nil, errors.Wrap(err, "cannot load configuration") + } + nextValidTill := now.Add(conf.DomainRenew.Duration()) + // ValidTill time is only extended. We want to avoid the situation when + // the configuration is changed, limiting the expiration time period + // and renewing a domain by shortening its expiration date. + if nextValidTill.After(domain.ValidTill.Time()) { + domain.ValidTill = weave.AsUnixTime(nextValidTill) + if _, err := h.domains.Put(db, []byte(msg.Domain), domain); err != nil { + return nil, errors.Wrap(err, "cannot store domain") + } + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *renewDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *RenewDomainMsg, error) { + var msg RenewDomainMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, nil, errors.Wrap(err, "cannot get domain") + } + return &domain, &msg, nil +} + +type deleteDomaiHandler struct { + auth x.Authenticator + domains orm.ModelBucket +} + +func (h *deleteDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *deleteDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + _, msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + if err := h.domains.Delete(db, []byte(msg.Domain)); err != nil { + return nil, errors.Wrap(err, "cannot delete domain") + } + + // This might be an expensive operation. + it, err := DomainAccounts(db, msg.Domain) + if err != nil { + return nil, errors.Wrap(err, "cannot get domain account iterator") + } + defer it.Release() + +deleteAccounts: + for { + switch key, _, err := it.Next(); { + case errors.ErrIteratorDone.Is(err): + break deleteAccounts + case err == nil: + if err := db.Delete(key); err != nil { + return nil, errors.Wrap(err, "cannot delete account") + } + default: + return nil, errors.Wrap(err, "account interator failed") + } + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *deleteDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *DeleteDomainMsg, error) { + var msg DeleteDomainMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, nil, errors.Wrap(err, "cannot get domain") + } + if !h.auth.HasAddress(ctx, domain.Owner) { + return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only owner can delete a domain") + } + return &domain, &msg, nil +} + +type registerAccounHandler struct { + auth x.Authenticator + domains orm.ModelBucket + accounts orm.ModelBucket +} + +func (h *registerAccounHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *registerAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + _, msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + + account := Account{ + Metadata: &weave.Metadata{}, + Owner: msg.Owner, + Domain: msg.Domain, + Name: msg.Name, + Targets: msg.Targets, + } + if _, err := h.accounts.Put(db, accountKey(msg.Name, msg.Domain), &account); err != nil { + return nil, errors.Wrap(err, "cannot store account") + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *registerAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *RegisterAccountMsg, error) { + var msg RegisterAccountMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, nil, errors.Wrap(err, "cannot get domain") + } + if !h.auth.HasAddress(ctx, domain.Owner) { + return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only domain owner can register an account") + } + if weave.IsExpired(ctx, domain.ValidTill) { + return nil, nil, errors.Wrap(errors.ErrExpired, "domain is expired") + } + switch err := h.accounts.Has(db, accountKey(msg.Name, msg.Domain)); { + case errors.ErrNotFound.Is(err): + // All good. + case err == nil: + return nil, nil, errors.Wrap(errors.ErrDuplicate, "account already exists") + default: + return nil, nil, errors.Wrap(err, "cannot check is account exists") + } + conf, err := loadConf(db) + if err != nil { + return nil, nil, errors.Wrap(err, "cannot load configuration") + } + if ok, err := regexp.MatchString(conf.ValidName, msg.Name); err != nil || !ok { + return nil, nil, errors.Wrap(errors.ErrInput, "name is not allowed") + } + return &domain, &msg, nil +} + +type transferAccounHandler struct { + auth x.Authenticator + accounts orm.ModelBucket + domains orm.ModelBucket +} + +func (h *transferAccounHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, _, _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *transferAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + account, domain, msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + if msg.NewOwner.Equals(domain.Owner) { + // If the new owner is the same as the domain owner, we can + // unset it and rely on domain ownership only. + account.Owner = nil + } else { + account.Owner = msg.NewOwner + } + if _, err := h.accounts.Put(db, accountKey(msg.Name, msg.Domain), account); err != nil { + return nil, errors.Wrap(err, "cannot store account") + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *transferAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Account, *Domain, *TransferAccountMsg, error) { + var msg TransferAccountMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, nil, nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, nil, nil, errors.Wrap(err, "cannot get domain") + } + if weave.IsExpired(ctx, domain.ValidTill) { + return nil, nil, nil, errors.Wrap(errors.ErrExpired, "cannot transfer account in an expired domain") + } + var account Account + if err := h.accounts.One(db, accountKey(msg.Name, msg.Domain), &account); err != nil { + return nil, nil, nil, errors.Wrap(err, "cannot get account") + } + // Authenticated by either Account owner (if set) or by the Domain owner. + authenticated := (len(account.Owner) != 0 && h.auth.HasAddress(ctx, account.Owner)) || h.auth.HasAddress(ctx, domain.Owner) + if !authenticated { + return nil, nil, nil, errors.Wrap(errors.ErrUnauthorized, "only owner can transfer an account") + } + if msg.Name == "" { + return nil, nil, nil, errors.Wrap(errors.ErrInput, "empty name account cannot be trasfered separately from domain") + } + return &account, &domain, &msg, nil +} + +type replaceAccountTargetHandler struct { + auth x.Authenticator + domains orm.ModelBucket + accounts orm.ModelBucket +} + +func (h *replaceAccountTargetHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *replaceAccountTargetHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + account, msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + account.Targets = msg.NewTargets + if _, err := h.accounts.Put(db, accountKey(msg.Name, msg.Domain), account); err != nil { + return nil, errors.Wrap(err, "cannot store account") + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *replaceAccountTargetHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Account, *ReplaceAccountTargetsMsg, error) { + var msg ReplaceAccountTargetsMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, nil, errors.Wrap(err, "cannot get domain") + } + if weave.IsExpired(ctx, domain.ValidTill) { + return nil, nil, errors.Wrap(errors.ErrExpired, "cannot update account in an expired domain") + } + var account Account + if err := h.accounts.One(db, accountKey(msg.Name, msg.Domain), &account); err != nil { + return nil, nil, errors.Wrap(err, "cannot get account") + } + // Authenticated by either Account owner (if set) or by the Domain owner. + authenticated := (len(account.Owner) != 0 && h.auth.HasAddress(ctx, account.Owner)) || h.auth.HasAddress(ctx, domain.Owner) + if !authenticated { + return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only owner can update an account") + } + return &account, &msg, nil +} + +type deleteAccounHandler struct { + auth x.Authenticator + domains orm.ModelBucket + accounts orm.ModelBucket +} + +func (h *deleteAccounHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { + if _, err := h.validate(ctx, db, tx); err != nil { + return nil, err + } + return &weave.CheckResult{GasAllocated: 0}, nil +} + +func (h *deleteAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { + msg, err := h.validate(ctx, db, tx) + if err != nil { + return nil, err + } + if err := h.accounts.Delete(db, accountKey(msg.Name, msg.Domain)); err != nil { + return nil, errors.Wrap(err, "cannot delete account") + } + return &weave.DeliverResult{Data: nil}, nil +} + +func (h *deleteAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*DeleteAccountMsg, error) { + var msg DeleteAccountMsg + if err := weave.LoadMsg(tx, &msg); err != nil { + return nil, errors.Wrap(err, "load msg") + } + var domain Domain + if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { + return nil, errors.Wrap(err, "cannot get domain") + } + if msg.Name == "" { + return nil, errors.Wrap(errors.ErrState, "cannot delete top level account") + } + var account Account + if err := h.accounts.One(db, accountKey(msg.Name, msg.Domain), &account); err != nil { + return nil, errors.Wrap(err, "cannot get account") + } + // Authenticated by either Account owner (if set) or by the Domain owner. + authenticated := (len(account.Owner) != 0 && h.auth.HasAddress(ctx, account.Owner)) || h.auth.HasAddress(ctx, domain.Owner) + if !authenticated { + return nil, errors.Wrap(errors.ErrUnauthorized, "only owner can delete an account") + } + return &msg, nil +} diff --git a/cmd/bnsd/x/blueaccount/handler_test.go b/cmd/bnsd/x/blueaccount/handler_test.go new file mode 100644 index 00000000..dad18337 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/handler_test.go @@ -0,0 +1,1018 @@ +package blueaccount + +import ( + "context" + "reflect" + "sort" + "testing" + + weave "github.com/iov-one/weave" + "github.com/iov-one/weave/app" + "github.com/iov-one/weave/errors" + "github.com/iov-one/weave/gconf" + "github.com/iov-one/weave/migration" + "github.com/iov-one/weave/store" + "github.com/iov-one/weave/weavetest" + "github.com/iov-one/weave/weavetest/assert" +) + +func TestUseCases(t *testing.T) { + type Request struct { + Now weave.UnixTime + Conditions []weave.Condition + Tx weave.Tx + BlockHeight int64 + WantErr *errors.Error + } + + var ( + aliceCond = weavetest.NewCondition() + bobCond = weavetest.NewCondition() + charlieCond = weavetest.NewCondition() + + now = weave.UnixTime(1572247483) + ) + + cases := map[string]struct { + Requests []Request + AfterTest func(t *testing.T, db weave.KVStore) + }{ + "configuration can be updated": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &UpdateConfigurationMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Patch: &Configuration{ + Metadata: &weave.Metadata{Schema: 1}, + Owner: aliceCond.Address(), + ValidName: "^name$", + ValidDomain: "^domain$", + DomainRenew: 1, + }, + }, + }, + BlockHeight: 3, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 4, + WantErr: errors.ErrInput, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + conf, err := loadConf(db) + if err != nil { + t.Fatalf("cannot load configuration: %s", err) + } + assert.Equal(t, conf.ValidName, "^name$") + assert.Equal(t, conf.ValidDomain, "^domain$") + assert.Equal(t, conf.DomainRenew, weave.UnixDuration(1)) + }, + }, + "anyone can register a domain, main signer will be the owner": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + b := NewDomainBucket() + var d Domain + if err := b.One(db, []byte("wunderland"), &d); err != nil { + t.Fatalf("cannot get wunderland domain: %s", err) + } + if d.Domain != "wunderland" { + t.Fatalf("unexpected wunderland domain: want wunderland, got %q", d.Domain) + } + if !d.Owner.Equals(aliceCond.Address()) { + t.Fatalf("unexpected wunderland owner: want %q, got %q", aliceCond.Address(), d.Owner) + } + if got, want := d.ValidTill, weave.UnixTime(now+1000); got != want { + t.Fatalf("unexpected valid till: want %d, got %d", want, got) + } + }, + }, + "anyone can register a domain, main signer may delegate the ownership": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Owner: bobCond.Address(), + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + b := NewDomainBucket() + var d Domain + if err := b.One(db, []byte("wunderland"), &d); err != nil { + t.Fatalf("cannot get wunderland domain: %s", err) + } + if d.Domain != "wunderland" { + t.Fatalf("unexpected wunderland domain: want wunderland, got %q", d.Domain) + } + if !d.Owner.Equals(bobCond.Address()) { + t.Fatalf("unexpected wunderland owner: want %q, got %q", bobCond.Address(), d.Owner) + } + if got, want := d.ValidTill, weave.UnixTime(now+1000); got != want { + t.Fatalf("unexpected valid till: want %d, got %d", want, got) + } + }, + }, + "registering a domain creates a username with an empty name": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + accounts := NewAccountBucket() + var a Account + if err := accounts.One(db, accountKey("", "wunderland"), &a); err != nil { + t.Fatalf("cannot get wunderland username: %s", err) + } + if a.Name != "" { + t.Fatalf("want an empty name, got %q", a.Name) + } + if a.Domain != "wunderland" { + t.Fatalf("want wunderland domain, got %q", a.Domain) + } + if a.Owner != nil { + t.Fatalf("want nil owner, got %q", a.Owner) + } + }, + }, + "deletion of the empty name username is not possible": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &DeleteAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "", + }, + }, + BlockHeight: 101, + WantErr: errors.ErrState, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + assertAccounts(t, db, "wunderland", []string{"*wunderland"}) + }, + }, + "only owner can register username under a domain": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{bobCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + }, + }, + BlockHeight: 101, + WantErr: errors.ErrUnauthorized, + }, + { + Now: now + 2, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "alice", + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + assertAccounts(t, db, "wunderland", []string{"*wunderland", "alice*wunderland"}) + }, + }, + "deletion of a domain deletes all username that domain contains": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 2, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "alice", + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + { + Now: now + 3, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &DeleteDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 103, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + assertAccounts(t, db, "wunderland", nil) + }, + }, + "deletion of a non existing domain fails": { + Requests: []Request{ + { + Now: now + 4, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &DeleteDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 104, + WantErr: errors.ErrNotFound, + }, + }, + }, + "iov domain cannot be registered": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "iov", + }, + }, + BlockHeight: 100, + WantErr: errors.ErrInput, + }, + }, + }, + "anyone can renew a domain": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 2, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RenewDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + b := NewDomainBucket() + var d Domain + if err := b.One(db, []byte("wunderland"), &d); err != nil { + t.Fatalf("cannot get wunderland domain: %s", err) + } + // Expiration time should be execution time + // (block time) which is now + 2, plus + // expiration offset. + if got, want := d.ValidTill, weave.UnixTime(now+2+1000); want != got { + t.Fatalf("want valid till %s, got %s", want, got) + } + }, + }, + "renewing a domain does not shorten its expiration time": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &UpdateConfigurationMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Patch: &Configuration{ + Metadata: &weave.Metadata{Schema: 1}, + Owner: aliceCond.Address(), + DomainRenew: 1, + }, + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + { + Now: now + 2, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RenewDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + b := NewDomainBucket() + var d Domain + if err := b.One(db, []byte("wunderland"), &d); err != nil { + t.Fatalf("cannot get wunderland domain: %s", err) + } + // Expiration time should not be updated + // because it would be shortened. + if got, want := d.ValidTill, weave.UnixTime(now+1000); want != got { + t.Logf("want %d %s", want, want) + t.Logf(" got %d %s", got, got) + t.Fatal("unexpected valid till") + } + }, + }, + "a domain can be deleted by the owner": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &DeleteDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + }, + }, + "a new account cannot be registered under an expired domain": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 10002, // Domain is expired by now. + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "alice", + }, + }, + BlockHeight: 102, + WantErr: errors.ErrExpired, + }, + }, + }, + "domain ownership can be transferred": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &TransferDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + NewOwner: bobCond.Address(), + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + b := NewDomainBucket() + var d Domain + if err := b.One(db, []byte("wunderland"), &d); err != nil { + t.Fatalf("cannot get wunderland domain: %s", err) + } + if !d.Owner.Equals(bobCond.Address()) { + t.Fatalf("unexpected owner: %q", d.Owner) + } + }, + }, + "expired domain ownership canot be transferred": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1000000000, // Domain is expired. + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &TransferDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + NewOwner: bobCond.Address(), + }, + }, + BlockHeight: 101, + WantErr: errors.ErrExpired, + }, + }, + }, + "a domain owner can change any account targets": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + Owner: bobCond.Address(), + Targets: []BlockchainAddress{ + {BlockchainID: "unicoin", Address: "abc123"}, + }, + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + { + Now: now + 2, + Conditions: []weave.Condition{aliceCond}, // Signed by the domain owner, NOT by the account owner. + Tx: &weavetest.Tx{ + Msg: &ReplaceAccountTargetsMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + NewTargets: []BlockchainAddress{ + {BlockchainID: "doge", Address: "987xyz"}, + }, + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + accounts := NewAccountBucket() + var a Account + if err := accounts.One(db, accountKey("bob", "wunderland"), &a); err != nil { + t.Fatalf("cannot get wunderland username: %s", err) + } + assert.Equal(t, a.Targets, []BlockchainAddress{ + {BlockchainID: "doge", Address: "987xyz"}, + }) + }, + }, + "an account owner can change the list of targets": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + Owner: bobCond.Address(), + Targets: []BlockchainAddress{ + {BlockchainID: "unicoin", Address: "abc123"}, + }, + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + { + Now: now + 2, + Conditions: []weave.Condition{bobCond}, // Signed by the account owner (not domain owner). + Tx: &weavetest.Tx{ + Msg: &ReplaceAccountTargetsMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + NewTargets: []BlockchainAddress{ + {BlockchainID: "doge", Address: "987xyz"}, + }, + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + accounts := NewAccountBucket() + var a Account + if err := accounts.One(db, accountKey("bob", "wunderland"), &a); err != nil { + t.Fatalf("cannot get wunderland username: %s", err) + } + assert.Equal(t, a.Targets, []BlockchainAddress{ + {BlockchainID: "doge", Address: "987xyz"}, + }) + }, + }, + "expired account target cannot be changed": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1000000, // Long after the expiration period. + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &ReplaceAccountTargetsMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "", + NewTargets: []BlockchainAddress{ + {BlockchainID: "doge", Address: "987xyz"}, + }, + }, + }, + BlockHeight: 102, + WantErr: errors.ErrExpired, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + accounts := NewAccountBucket() + var a Account + if err := accounts.One(db, accountKey("", "wunderland"), &a); err != nil { + t.Fatalf("cannot get wunderland username: %s", err) + } + if len(a.Targets) != 0 { + t.Fatalf("expected no targets, got %+v", a.Targets) + } + }, + }, + "expired account can be deleted": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + Owner: bobCond.Address(), + Targets: []BlockchainAddress{ + {BlockchainID: "unicoin", Address: "abc123"}, + }, + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + { + Now: now + 1000000000, // Domain is expired. + Conditions: []weave.Condition{bobCond}, + Tx: &weavetest.Tx{ + Msg: &DeleteAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + }, + }, + BlockHeight: 103, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + assertAccounts(t, db, "wunderland", []string{"*wunderland"}) + }, + }, + "empty name account cannot be transferred": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &TransferAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "", + NewOwner: bobCond.Address(), + }, + }, + BlockHeight: 101, + WantErr: errors.ErrInput, + }, + }, + }, + "expired account cannot be transferred": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 100000000, // Domain is expired. + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + Owner: bobCond.Address(), + }, + }, + BlockHeight: 101, + WantErr: errors.ErrExpired, + }, + }, + }, + "owner can transfer ownership of an account": { + Requests: []Request{ + { + Now: now, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + }, + }, + BlockHeight: 100, + WantErr: nil, + }, + { + Now: now + 1, + Conditions: []weave.Condition{aliceCond}, + Tx: &weavetest.Tx{ + Msg: &RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + Owner: bobCond.Address(), + }, + }, + BlockHeight: 101, + WantErr: nil, + }, + { + Now: now + 2, + Conditions: []weave.Condition{bobCond}, + Tx: &weavetest.Tx{ + Msg: &TransferAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: "wunderland", + Name: "bob", + NewOwner: charlieCond.Address(), + }, + }, + BlockHeight: 102, + WantErr: nil, + }, + }, + AfterTest: func(t *testing.T, db weave.KVStore) { + accounts := NewAccountBucket() + var a Account + if err := accounts.One(db, accountKey("bob", "wunderland"), &a); err != nil { + t.Fatalf("cannot get wunderland username: %s", err) + } + if !a.Owner.Equals(charlieCond.Address()) { + t.Fatalf("want the owner to be %q, got %q", charlieCond.Address(), a.Owner) + } + }, + }, + } + + for testName, tc := range cases { + t.Run(testName, func(t *testing.T) { + db := store.MemStore() + migration.MustInitPkg(db, "blueaccount") + + rt := app.NewRouter() + auth := &weavetest.CtxAuth{Key: "auth"} + RegisterRoutes(rt, auth) + + config := Configuration{ + Metadata: &weave.Metadata{Schema: 1}, + Owner: aliceCond.Address(), + ValidName: `^[a-z0-9\-_.]{0,64}$`, + ValidDomain: `^[a-z0-9]{3,16}$`, + DomainRenew: 1000, + } + if err := gconf.Save(db, "blueaccount", &config); err != nil { + t.Fatalf("cannot save configuration: %s", err) + } + + for _, req := range tc.Requests { + ctx := weave.WithHeight(context.Background(), req.BlockHeight) + ctx = weave.WithChainID(ctx, "testchain-123") + ctx = auth.SetConditions(ctx, req.Conditions...) + ctx = weave.WithBlockTime(ctx, req.Now.Time()) + + cache := db.CacheWrap() + if _, err := rt.Check(ctx, cache, req.Tx); !req.WantErr.Is(err) { + t.Fatalf("unexpected check error: want %q, got %+v", req.WantErr, err) + } + cache.Discard() + if _, err := rt.Deliver(ctx, db, req.Tx); !req.WantErr.Is(err) { + t.Fatalf("unexpected deliver error: want %q, got %+v", req.WantErr, err) + } + } + + if tc.AfterTest != nil { + tc.AfterTest(t, db) + } + }) + } +} + +func TestDomainAccounts(t *testing.T) { + db := store.MemStore() + migration.MustInitPkg(db, "blueaccount") + + // Two domains 'a' and 'ab' are similar to ensure that domain/name + // separation works correctly. If it does not, 'a' + 'bbb' should + // produce the same account as 'ab' + 'bb'. + + domains := NewDomainBucket() + accounts := NewAccountBucket() + + domains.Put(db, []byte("a"), &Domain{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "a", + }) + accounts.Put(db, accountKey("", "a"), &Account{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "a", + Name: "", + }) + accounts.Put(db, accountKey("bbb", "a"), &Account{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "a", + Name: "bbb", + }) + + domains.Put(db, []byte("ab"), &Domain{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "ab", + }) + accounts.Put(db, accountKey("", "ab"), &Account{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "ab", + Name: "", + }) + accounts.Put(db, accountKey("bb", "ab"), &Account{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "ab", + Name: "bb", + }) + accounts.Put(db, accountKey("xyz", "ab"), &Account{ + Metadata: &weave.Metadata{}, + Owner: weavetest.NewCondition().Address(), + Domain: "ab", + Name: "xyz", + }) + + assertAccounts(t, db, "a", []string{"*a", "bbb*a"}) + assertAccounts(t, db, "ab", []string{"*ab", "bb*ab", "xyz*ab"}) +} + +func assertAccounts(t testing.TB, db weave.ReadOnlyKVStore, domain string, wantAccounts []string) { + t.Helper() + + iter, err := DomainAccounts(db, domain) + if err != nil { + t.Fatalf("cannot list %q domain accounts", domain) + } + defer iter.Release() + + var accounts []string + +iterAccounts: + for { + switch key, raw, err := iter.Next(); { + case err == nil: + var a Account + if err := a.Unmarshal(raw); err != nil { + t.Fatalf("cannot unmarshal %q account: %s", key, err) + } + accounts = append(accounts, a.Name+"*"+a.Domain) + case errors.ErrIteratorDone.Is(err): + break iterAccounts + default: + t.Fatalf("cannot get next account name: %s", err) + } + } + + // Order does not matter. This is only membership test. + sort.Strings(wantAccounts) + sort.Strings(accounts) + + if !reflect.DeepEqual(accounts, wantAccounts) { + t.Logf("want accounts %d: %q", len(wantAccounts), wantAccounts) + t.Logf(" got accounts %d: %q", len(accounts), accounts) + t.Fatal("unexpected accounts") + } +} diff --git a/cmd/bnsd/x/blueaccount/model.go b/cmd/bnsd/x/blueaccount/model.go new file mode 100644 index 00000000..47a68f67 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/model.go @@ -0,0 +1,130 @@ +package blueaccount + +import ( + "regexp" + "strings" + + weave "github.com/iov-one/weave" + "github.com/iov-one/weave/errors" + "github.com/iov-one/weave/migration" + "github.com/iov-one/weave/orm" +) + +func init() { + migration.MustRegister(1, &Account{}, migration.NoModification) + migration.MustRegister(1, &Domain{}, migration.NoModification) +} + +var _ orm.Model = (*Account)(nil) + +func (a *Account) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", a.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(a.Domain)) + if len(a.Owner) != 0 { + errs = errors.AppendField(errs, "Owner", a.Owner.Validate()) + } + errs = errors.AppendField(errs, "Targets", validateTargets(a.Targets)) + return errs +} + +func NewAccountBucket() orm.ModelBucket { + b := orm.NewModelBucket("account", &Account{}) + return migration.NewModelBucket("blueaccount", b) +} + +// accountKey returns a bucket wide unique account key. +// +// Key starts with the domain name which allows for iteration over accounts by +// the domain they belong to. +func accountKey(name, domain string) []byte { + key := make([]byte, 0, len(name)+len(domain)+1) + key = append(key, domain...) + key = append(key, '*') + key = append(key, name...) + return key +} + +var _ orm.Model = (*Domain)(nil) + +func (d *Domain) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", d.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(d.Domain)) + errs = errors.AppendField(errs, "Owner", d.Owner.Validate()) + errs = errors.AppendField(errs, "ValidTill", d.ValidTill.Validate()) + return errs +} + +func NewDomainBucket() orm.ModelBucket { + b := orm.NewModelBucket("domain", &Domain{}) + return migration.NewModelBucket("blueaccount", b) +} + +// DomainAccounts returns an iterator through all account that belong to a +// given domain. +// It is the client responsibility to releast the iterator. +func DomainAccounts(db weave.ReadOnlyKVStore, domain string) (weave.Iterator, error) { + // This implementation relies on account keys being constructed by + // including the domain first (see accountKey function). This allows to + // iterate over keys using database native iteration mechanism instead + // of secondary index. + const bucketPrefix = "account:" + start := append([]byte(bucketPrefix + domain)) //, '*'-1) + end := append([]byte(bucketPrefix+domain), '*'+1) + return db.Iterator(start, end) +} + +func (ba *BlockchainAddress) Validate() error { + if !validBlockchainID(ba.BlockchainID) { + return errors.Wrap(errors.ErrInput, "invalid blockchain ID") + } + switch n := len(ba.Address); { + case n == 0: + return errors.Wrap(errors.ErrInput, "address is required") + case n > addressMaxLen: + return errors.Wrap(errors.ErrInput, "address too long") + } + return nil +} + +var validBlockchainID = regexp.MustCompile(`^[a-zA-Z0-9_.-]{4,32}$`).MatchString + +const addressMaxLen = 128 + +// validateTargets returns an error if given list of blockchain addresses is +// not a valid target state. This function ensures the business logic is +// respected. +func validateTargets(targets []BlockchainAddress) error { + for i, t := range targets { + if err := t.Validate(); err != nil { + return errors.Wrapf(err, "target #%d", i) + } + } + if dups := duplicatedBlockchains(targets); len(dups) != 0 { + return errors.Wrapf(errors.ErrDuplicate, "blokchain ID used more than once: %s", + strings.Join(dups, ", ")) + } + return nil +} + +// duplicatedBlockchains returns the list of blockchain IDs that were used more +// than once in given list. +func duplicatedBlockchains(bas []BlockchainAddress) []string { + if len(bas) < 2 { + return nil + } + + cnt := make(map[string]uint8) + for _, ba := range bas { + cnt[ba.BlockchainID]++ + } + + var dups []string + for bid, n := range cnt { + if n > 1 { + dups = append(dups, bid) + } + } + return dups +} diff --git a/cmd/bnsd/x/blueaccount/msg.go b/cmd/bnsd/x/blueaccount/msg.go new file mode 100644 index 00000000..d811fb92 --- /dev/null +++ b/cmd/bnsd/x/blueaccount/msg.go @@ -0,0 +1,180 @@ +package blueaccount + +import ( + weave "github.com/iov-one/weave" + "github.com/iov-one/weave/errors" + "github.com/iov-one/weave/migration" +) + +func init() { + migration.MustRegister(1, &UpdateConfigurationMsg{}, migration.NoModification) + + migration.MustRegister(1, &RegisterDomainMsg{}, migration.NoModification) + migration.MustRegister(1, &TransferDomainMsg{}, migration.NoModification) + migration.MustRegister(1, &RenewDomainMsg{}, migration.NoModification) + migration.MustRegister(1, &DeleteDomainMsg{}, migration.NoModification) + + migration.MustRegister(1, &RegisterAccountMsg{}, migration.NoModification) + migration.MustRegister(1, &TransferAccountMsg{}, migration.NoModification) + migration.MustRegister(1, &ReplaceAccountTargetsMsg{}, migration.NoModification) + migration.MustRegister(1, &DeleteAccountMsg{}, migration.NoModification) +} + +var _ weave.Msg = (*UpdateConfigurationMsg)(nil) + +func (UpdateConfigurationMsg) Path() string { + return "blueaccount/updateconfigurationmsg" +} + +func (msg *UpdateConfigurationMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Patch", msg.Patch.Validate()) + return errs +} + +var _ weave.Msg = (*RegisterDomainMsg)(nil) + +func (RegisterDomainMsg) Path() string { + return "blueaccount/registerdomainmsg" +} + +func (msg *RegisterDomainMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + if len(msg.Owner) > 0 { + errs = errors.AppendField(errs, "Owner", msg.Owner.Validate()) + } + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + errs = errors.AppendField(errs, "ClientToken", validateClientToken(msg.ClientToken)) + return errs +} + +var _ weave.Msg = (*TransferDomainMsg)(nil) + +func (TransferDomainMsg) Path() string { + return "blueaccount/transferdomainmsg" +} + +func (msg *TransferDomainMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + errs = errors.AppendField(errs, "NewOwner", msg.NewOwner.Validate()) + return errs +} + +var _ weave.Msg = (*RenewDomainMsg)(nil) + +func (RenewDomainMsg) Path() string { + return "blueaccount/renewdomainmsg" +} + +func (msg *RenewDomainMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + errs = errors.AppendField(errs, "ClientToken", validateClientToken(msg.ClientToken)) + return errs +} + +var _ weave.Msg = (*DeleteDomainMsg)(nil) + +func (DeleteDomainMsg) Path() string { + return "blueaccount/deletedomainmsg" +} + +func (msg *DeleteDomainMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + return errs +} + +var _ weave.Msg = (*RegisterAccountMsg)(nil) + +func (RegisterAccountMsg) Path() string { + return "blueaccount/registeraccountmsg" +} + +func (msg *RegisterAccountMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + if len(msg.Owner) != 0 { + errs = errors.AppendField(errs, "Owner", msg.Owner.Validate()) + } + errs = errors.AppendField(errs, "Targets", validateTargets(msg.Targets)) + errs = errors.AppendField(errs, "ClientToken", validateClientToken(msg.ClientToken)) + return errs +} + +var _ weave.Msg = (*TransferAccountMsg)(nil) + +func (TransferAccountMsg) Path() string { + return "blueaccount/transferaccountmsg" +} + +func (msg *TransferAccountMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + errs = errors.AppendField(errs, "NewOwner", msg.NewOwner.Validate()) + return errs +} + +var _ weave.Msg = (*ReplaceAccountTargetsMsg)(nil) + +func (ReplaceAccountTargetsMsg) Path() string { + return "blueaccount/replaceaccounttargetsmsg" +} + +func (msg *ReplaceAccountTargetsMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) + errs = errors.AppendField(errs, "NewTargets", validateTargets(msg.NewTargets)) + return errs +} + +var _ weave.Msg = (*DeleteAccountMsg)(nil) + +func (DeleteAccountMsg) Path() string { + return "blueaccount/deleteaccountmsg" +} + +func (msg *DeleteAccountMsg) Validate() error { + var errs error + errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) + // Domain validation rules are dynamically set via configuration and + // cannot be enforced here. + if len(msg.Domain) == 0 { + errs = errors.AppendField(errs, "Domain", errors.ErrEmpty) + } + return errs +} + +// validateDomain returns an error if provided domain string is not acceptable. +// Domain validation rules are dynamically set via configuration and cannot be +// fully enforced by a function that does not have an access to the database. +func validateDomain(domain string) error { + if len(domain) == 0 { + return errors.ErrEmpty + } + // iov is not an acceptable domain because it is reserved by the Red + // Account functionality. + if domain == "iov" { + return errors.Wrap(errors.ErrInput, `"iov" is not an acceptable domain`) + } + return nil +} + +// validateClientToken returns an error if provided client token is not valid. +func validateClientToken(token []byte) error { + const maxLen = 64 + if len(token) > maxLen { + return errors.Wrapf(errors.ErrInput, "must not be longer than %d characters", maxLen) + } + return nil +} diff --git a/docs/proto/index.html b/docs/proto/index.html index 8c272a4c..b89b0874 100644 --- a/docs/proto/index.html +++ b/docs/proto/index.html @@ -224,6 +224,69 @@

Table of Contents

+ + + + +
  • + cmd/bnsd/x/blueaccount/codec.proto +
  • @@ -1034,6 +1097,69 @@

    ExecuteBatchMsg.Union

    aswap and gov don't make much sense as part of a batch (no vote buying)

    + + blueaccount_register_domain_msg + blueaccount.RegisterDomainMsg + +

    + + + + blueaccount_transfer_domain_msg + blueaccount.TransferDomainMsg + +

    + + + + blueaccount_renew_domain_msg + blueaccount.RenewDomainMsg + +

    + + + + blueaccount_delete_domain_msg + blueaccount.DeleteDomainMsg + +

    + + + + blueaccount_register_account_msg + blueaccount.RegisterAccountMsg + +

    + + + + blueaccount_transfer_account_msg + blueaccount.TransferAccountMsg + +

    + + + + blueaccount_replace_account_target_msg + blueaccount.ReplaceAccountTargetsMsg + +

    + + + + blueaccount_delete_account_msg + blueaccount.DeleteAccountMsg + +

    + + + + blueaccount_update_configuration_msg + blueaccount.UpdateConfigurationMsg + +

    + + @@ -1178,6 +1304,69 @@

    ExecuteProposalBatchMsg.Union

    + + blueaccount_register_domain_msg + blueaccount.RegisterDomainMsg + +

    + + + + blueaccount_transfer_domain_msg + blueaccount.TransferDomainMsg + +

    + + + + blueaccount_renew_domain_msg + blueaccount.RenewDomainMsg + +

    + + + + blueaccount_delete_domain_msg + blueaccount.DeleteDomainMsg + +

    + + + + blueaccount_register_account_msg + blueaccount.RegisterAccountMsg + +

    + + + + blueaccount_transfer_account_msg + blueaccount.TransferAccountMsg + +

    + + + + blueaccount_replace_account_target_msg + blueaccount.ReplaceAccountTargetsMsg + +

    + + + + blueaccount_delete_account_msg + blueaccount.DeleteAccountMsg + +

    + + + + blueaccount_update_configuration_msg + blueaccount.UpdateConfigurationMsg + +

    + + @@ -1320,6 +1509,69 @@

    ProposalOptions

    + + blueaccount_register_domain_msg + blueaccount.RegisterDomainMsg + +

    + + + + blueaccount_transfer_domain_msg + blueaccount.TransferDomainMsg + +

    + + + + blueaccount_renew_domain_msg + blueaccount.RenewDomainMsg + +

    + + + + blueaccount_delete_domain_msg + blueaccount.DeleteDomainMsg + +

    + + + + blueaccount_register_account_msg + blueaccount.RegisterAccountMsg + +

    + + + + blueaccount_transfer_account_msg + blueaccount.TransferAccountMsg + +

    + + + + blueaccount_replace_account_target_msg + blueaccount.ReplaceAccountTargetsMsg + +

    + + + + blueaccount_delete_account_msg + blueaccount.DeleteAccountMsg + +

    + + + + blueaccount_update_configuration_msg + blueaccount.UpdateConfigurationMsg + +

    + + @@ -1542,6 +1794,654 @@

    Tx

    79 is reserved (see ProposalOptions: TextResolutionMsg)

    + + blueaccount_register_domain_msg + blueaccount.RegisterDomainMsg + +

    + + + + blueaccount_transfer_domain_msg + blueaccount.TransferDomainMsg + +

    + + + + blueaccount_renew_domain_msg + blueaccount.RenewDomainMsg + +

    + + + + blueaccount_delete_domain_msg + blueaccount.DeleteDomainMsg + +

    + + + + blueaccount_register_account_msg + blueaccount.RegisterAccountMsg + +

    + + + + blueaccount_transfer_account_msg + blueaccount.TransferAccountMsg + +

    + + + + blueaccount_replace_account_target_msg + blueaccount.ReplaceAccountTargetsMsg + +

    + + + + blueaccount_delete_account_msg + blueaccount.DeleteAccountMsg + +

    + + + + blueaccount_update_configuration_msg + blueaccount.UpdateConfigurationMsg + +

    + + + + + + + + + + + + + + + + +
    +

    cmd/bnsd/x/blueaccount/codec.proto

    Top +
    +

    + + +

    Account

    +

    Account represents a blue account name.

    String representation of an account is `*`. Empty name is an

    acceptable account string. Complete validation rules for name and domain are

    declared by configuration entity.

    An account must always belong to an existing domain.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    Domain references a domain that this account belongs to.

    namestring

    ownerbytes

    Owner is a weave.Address that controls this account. Can be empty. + +An account is always owned by the domain owner and as such, regardless +the owner field value, can be edited by the domain owner that this account +belongs to. +Setting the owner attribute to an address different than the domain owner +extends the domain owner permission and allows to manage a single account +to someone else than the domain owner.

    targetsBlockchainAddressrepeated

    + + + + +

    BlockchainAddress

    +

    BlockchainAddress represents a blochain address. This structure clubs together

    blokchain ID together with an address on that network. It is used to point

    to an address on any blockchain network.

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    blockchain_idstring

    An arbitrary blockchain ID.

    addressstring

    An address on the specified blockchain network. Address is not a +weave.Address as we cannot know what is the format of an address on the +chain that this token instance links to. Because we do not know the rules +to validate an address for any blockchain ID, this is an arbitrary bulk of +data. +It is more convinient to always use encoded representation of each address +and store it as a string. Using bytes while compact is not as comfortable +to use.

    + + + + +

    Configuration

    +

    Configuration is a dynamic configuration used by this extension, managed by

    the functionality provided by gconf package.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    ownerbytes

    Owner is present to implement gconf.OwnedConfig interface +This defines the Address that is allowed to update the Configuration object and is +needed to make use of gconf.NewUpdateConfigurationHandler

    valid_domainstring

    Valid domain defines a regular expression that every valid domain of an +account must match. Rule must not include the asterisk (*) character.

    valid_namestring

    Valid name defines a regular expression that every valid name of an +account must match. Rule must not include the asterisk (*) character.

    domain_renewint64

    Domain review defines the duration of the domain renewal period.

    + + + + +

    DeleteAccountMsg

    +

    DeleteAccountMsg issues deletion of a name that belongs to given domain.

    Message must be signed by the domain owner.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    namestring

    + + + + +

    DeleteDomainMsg

    +

    DeleteDomainMsg issues deletion of a domain and all accounts that belong to

    that domain.

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    Name of the domain that is deleted.

    + + + + +

    Domain

    +

    Domain represents a blue account domain.

    Domain is a container for accounts. Account representation is

    `*`.

    Each domain owner controls all accounts that belong to that domain.

    Each domain controls expiration of all accounts that belong to that domain.

    Because of the functionality that the Red Account provides, Blue Account

    domain must not be `iov` as this is a domain used by Red Account

    functionality.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    ownerbytes

    Owner is a weave.Address that controls this domain and all accounts that +belong to this domain.

    valid_tillint64

    Valid till defines the expiration date for the domain. Expired domain +cannot be used or modified. None of the accounts that belong to an expired +domain can be used of modified as well.

    + + + + +

    RegisterAccountMsg

    +

    RegisterAccountMsg issues registration of an account. Requested domain must

    exist and belong to the same user that signs this message.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    Domain that a new account is the be registered under.

    namestring

    Name that a new account is the be registered with.

    ownerbytes

    Owner holds the address of the newly registered account. Can be empty to +leave the administration to the domain owner only.

    targetsBlockchainAddressrepeated

    Client token is an arbitrary data that can be provided by a middleman +(i.e. retailer) that although does not participate directly in the +transaction, helped a user to renew a domain. Storing a client token helps +identify contribution of such party later.

    client_tokenbytes

    + + + + +

    RegisterDomainMsg

    +

    RegisterDomainMsg is issuing registration of a new domain. Requested

    domain name must be available (not yet registed) in order for the request to

    succeed.

    Registering a domain creates an account with no name that belongs to this

    domain.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    ownerbytes

    Owner holds the address of the newly registered domain. If not provided, +main signer is used.

    domainstring

    Domain part of the account that should be registered.

    client_tokenbytes

    Client token is an arbitrary data that can be provided by a middleman +(i.e. retailer) that although does not participate directly in the +transaction, helped a user to register a domain. Storing a client token +helps identify contribution of such party later.

    + + + + +

    RenewDomainMsg

    +

    RenewDomainMsg is issuing a domain expiration time extension. Extension

    period is defined by the configuration entity.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    Name of the domain that is transferred.

    client_tokenbytes

    Client token is an arbitrary data that can be provided by a middleman +(i.e. retailer) that although does not participate directly in the +transaction, helped a user to renew a domain. Storing a client token helps +identify contribution of such party later.

    + + + + +

    ReplaceAccountTargetsMsg

    +

    ReplaceAccountTargetsMsg is issuing rewrite of all targets that given

    account points to.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    namestring

    new_targetsBlockchainAddressrepeated

    + + + + +

    TransferAccountMsg

    +

    TransferAccountMsg is issuing an ownership transfer over specified account.

    Transfering an account ownership does not affect related domain owner

    permissions to administrate that account.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    namestring

    new_ownerbytes

    New owner holds the address that the ownership of the domain is +transferred to.

    + + + + +

    TransferDomainMsg

    +

    TransferDomainMsg is issuing an ownership transfer over specified domain.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    domainstring

    Name of the domain that is transferred.

    new_ownerbytes

    New owner holds the address that the ownership of the domain is +transferred to.

    + + + + +

    UpdateConfigurationMsg

    +

    UpdateConfigurationMsg is used by the gconf extension to update the

    configuration.

    + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    metadataweave.Metadata

    patchConfiguration

    diff --git a/gconf/doc.go b/gconf/doc.go index a426fe76..d1fd07cf 100644 --- a/gconf/doc.go +++ b/gconf/doc.go @@ -13,7 +13,8 @@ To use gconf you must follow a few simple principles. 1. Define your configuration as a protobuf message. 2. Define your configuration update message as a protobuf message. It must have -a `patch` field that holds the new configuration state. +a `patch` field that holds the new configuration state. Add created message to +the Tx declaration. Register handler in your extension routing. 3. Zero field values are ignored during the update message processing, diff --git a/go.mod b/go.mod index 4aa79320..c5aecf32 100644 --- a/go.mod +++ b/go.mod @@ -27,3 +27,5 @@ require ( golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f google.golang.org/grpc v1.21.0 // indirect ) + +go 1.13 diff --git a/spec/gogo/cmd/bnsd/app/codec.proto b/spec/gogo/cmd/bnsd/app/codec.proto index 4b0dd61d..fc421d22 100644 --- a/spec/gogo/cmd/bnsd/app/codec.proto +++ b/spec/gogo/cmd/bnsd/app/codec.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package bnsd; +import "cmd/bnsd/x/blueaccount/codec.proto"; import "cmd/bnsd/x/username/codec.proto"; import "gogoproto/gogo.proto"; import "migration/codec.proto"; @@ -65,6 +66,15 @@ message Tx { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; // 79 is reserved (see ProposalOptions: TextResolutionMsg) msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } @@ -91,6 +101,15 @@ message ExecuteBatchMsg { // upgrade schema is important enough, it should be a solo action // aswap and gov don't make much sense as part of a batch (no vote buying) msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } repeated Union messages = 1 [(gogoproto.nullable) = false]; @@ -118,6 +137,15 @@ message ProposalOptions { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79; msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } @@ -141,6 +169,15 @@ message ExecuteProposalBatchMsg { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79; msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } repeated Union messages = 1 [(gogoproto.nullable) = false]; diff --git a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto new file mode 100644 index 00000000..ad9f2d52 --- /dev/null +++ b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto @@ -0,0 +1,192 @@ +syntax = "proto3"; + +package blueaccount; + +import "codec.proto"; +import "gogoproto/gogo.proto"; + +// Domain represents a blue account domain. +// +// Domain is a container for accounts. Account representation is +// `*`. +// Each domain owner controls all accounts that belong to that domain. +// Each domain controls expiration of all accounts that belong to that domain. +// +// Because of the functionality that the Red Account provides, Blue Account +// domain must not be `iov` as this is a domain used by Red Account +// functionality. +message Domain { + weave.Metadata metadata = 1; + string domain = 2; + // Owner is a weave.Address that controls this domain and all accounts that + // belong to this domain. + bytes owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Valid till defines the expiration date for the domain. Expired domain + // cannot be used or modified. None of the accounts that belong to an expired + // domain can be used of modified as well. + int64 valid_till = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; +} + +// Account represents a blue account name. +// +// String representation of an account is `*`. Empty name is an +// acceptable account string. Complete validation rules for name and domain are +// declared by configuration entity. +// +// An account must always belong to an existing domain. +message Account { + weave.Metadata metadata = 1; + // Domain references a domain that this account belongs to. + string domain = 2; + string name = 3; + // Owner is a weave.Address that controls this account. Can be empty. + // + // An account is always owned by the domain owner and as such, regardless + // the owner field value, can be edited by the domain owner that this account + // belongs to. + // Setting the owner attribute to an address different than the domain owner + // extends the domain owner permission and allows to manage a single account + // to someone else than the domain owner. + bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; +} + +// BlockchainAddress represents a blochain address. This structure clubs together +// blokchain ID together with an address on that network. It is used to point +// to an address on any blockchain network. +message BlockchainAddress { + // An arbitrary blockchain ID. + string blockchain_id = 1 [(gogoproto.customname) = "BlockchainID"]; + // An address on the specified blockchain network. Address is not a + // weave.Address as we cannot know what is the format of an address on the + // chain that this token instance links to. Because we do not know the rules + // to validate an address for any blockchain ID, this is an arbitrary bulk of + // data. + // It is more convinient to always use encoded representation of each address + // and store it as a string. Using bytes while compact is not as comfortable + // to use. + string address = 2; +} + +// Configuration is a dynamic configuration used by this extension, managed by +// the functionality provided by gconf package. +message Configuration { + weave.Metadata metadata = 1; + // Owner is present to implement gconf.OwnedConfig interface + // This defines the Address that is allowed to update the Configuration object and is + // needed to make use of gconf.NewUpdateConfigurationHandler + bytes owner = 2 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Valid domain defines a regular expression that every valid domain of an + // account must match. Rule must not include the asterisk (*) character. + string valid_domain = 3; + // Valid name defines a regular expression that every valid name of an + // account must match. Rule must not include the asterisk (*) character. + string valid_name = 4; + // Domain review defines the duration of the domain renewal period. + int64 domain_renew = 6 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixDuration"]; +} + +// UpdateConfigurationMsg is used by the gconf extension to update the +// configuration. +message UpdateConfigurationMsg { + weave.Metadata metadata = 1; + Configuration patch = 2; +} + +// RegisterDomainMsg is issuing registration of a new domain. Requested +// domain name must be available (not yet registed) in order for the request to +// succeed. +// Registering a domain creates an account with no name that belongs to this +// domain. +message RegisterDomainMsg { + weave.Metadata metadata = 1; + // Owner holds the address of the newly registered domain. If not provided, + // main signer is used. + bytes owner = 2 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Domain part of the account that should be registered. + string domain = 3; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to register a domain. Storing a client token + // helps identify contribution of such party later. + bytes client_token = 4; +} + +// TransferDomainMsg is issuing an ownership transfer over specified domain. +message TransferDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is transferred. + string domain = 2; + // New owner holds the address that the ownership of the domain is + // transferred to. + bytes new_owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; +} + +// RenewDomainMsg is issuing a domain expiration time extension. Extension +// period is defined by the configuration entity. +message RenewDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is transferred. + string domain = 2; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + bytes client_token = 3; +} + +// DeleteDomainMsg issues deletion of a domain and all accounts that belong to +// that domain. +message DeleteDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is deleted. + string domain = 2; +} + +// RegisterAccountMsg issues registration of an account. Requested domain must +// exist and belong to the same user that signs this message. +message RegisterAccountMsg { + weave.Metadata metadata = 1; + // Domain that a new account is the be registered under. + string domain = 2; + // Name that a new account is the be registered with. + string name = 3; + // Owner holds the address of the newly registered account. Can be empty to + // leave the administration to the domain owner only. + bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; + bytes client_token = 6; +} + +// TransferAccountMsg is issuing an ownership transfer over specified account. +// Transfering an account ownership does not affect related domain owner +// permissions to administrate that account. +message TransferAccountMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 3; + // New owner holds the address that the ownership of the domain is + // transferred to. + bytes new_owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; +} + +// ReplaceAccountTargetsMsg is issuing rewrite of all targets that given +// account points to. +message ReplaceAccountTargetsMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 4; + repeated BlockchainAddress new_targets = 5 [(gogoproto.nullable) = false]; +} + +// DeleteAccountMsg issues deletion of a name that belongs to given domain. +// Message must be signed by the domain owner. +message DeleteAccountMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 3; +} diff --git a/spec/proto/cmd/bnsd/app/codec.proto b/spec/proto/cmd/bnsd/app/codec.proto index 2b7cb38d..5963119e 100644 --- a/spec/proto/cmd/bnsd/app/codec.proto +++ b/spec/proto/cmd/bnsd/app/codec.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package bnsd; +import "cmd/bnsd/x/blueaccount/codec.proto"; import "cmd/bnsd/x/username/codec.proto"; import "migration/codec.proto"; import "x/aswap/codec.proto"; @@ -64,6 +65,15 @@ message Tx { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; // 79 is reserved (see ProposalOptions: TextResolutionMsg) msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } @@ -90,6 +100,15 @@ message ExecuteBatchMsg { // upgrade schema is important enough, it should be a solo action // aswap and gov don't make much sense as part of a batch (no vote buying) msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } repeated Union messages = 1 ; @@ -117,6 +136,15 @@ message ProposalOptions { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79; msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } @@ -140,6 +168,15 @@ message ExecuteProposalBatchMsg { gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78; gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79; msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80; + blueaccount.RegisterDomainMsg blueaccount_register_domain_msg = 81; + blueaccount.TransferDomainMsg blueaccount_transfer_domain_msg = 82; + blueaccount.RenewDomainMsg blueaccount_renew_domain_msg = 83; + blueaccount.DeleteDomainMsg blueaccount_delete_domain_msg = 84; + blueaccount.RegisterAccountMsg blueaccount_register_account_msg = 85; + blueaccount.TransferAccountMsg blueaccount_transfer_account_msg = 86; + blueaccount.ReplaceAccountTargetsMsg blueaccount_replace_account_target_msg = 87; + blueaccount.DeleteAccountMsg blueaccount_delete_account_msg = 88; + blueaccount.UpdateConfigurationMsg blueaccount_update_configuration_msg = 89; } } repeated Union messages = 1 ; diff --git a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto new file mode 100644 index 00000000..af450923 --- /dev/null +++ b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto @@ -0,0 +1,191 @@ +syntax = "proto3"; + +package blueaccount; + +import "codec.proto"; + +// Domain represents a blue account domain. +// +// Domain is a container for accounts. Account representation is +// `*`. +// Each domain owner controls all accounts that belong to that domain. +// Each domain controls expiration of all accounts that belong to that domain. +// +// Because of the functionality that the Red Account provides, Blue Account +// domain must not be `iov` as this is a domain used by Red Account +// functionality. +message Domain { + weave.Metadata metadata = 1; + string domain = 2; + // Owner is a weave.Address that controls this domain and all accounts that + // belong to this domain. + bytes owner = 3 ; + // Valid till defines the expiration date for the domain. Expired domain + // cannot be used or modified. None of the accounts that belong to an expired + // domain can be used of modified as well. + int64 valid_till = 4 ; +} + +// Account represents a blue account name. +// +// String representation of an account is `*`. Empty name is an +// acceptable account string. Complete validation rules for name and domain are +// declared by configuration entity. +// +// An account must always belong to an existing domain. +message Account { + weave.Metadata metadata = 1; + // Domain references a domain that this account belongs to. + string domain = 2; + string name = 3; + // Owner is a weave.Address that controls this account. Can be empty. + // + // An account is always owned by the domain owner and as such, regardless + // the owner field value, can be edited by the domain owner that this account + // belongs to. + // Setting the owner attribute to an address different than the domain owner + // extends the domain owner permission and allows to manage a single account + // to someone else than the domain owner. + bytes owner = 4 ; + repeated BlockchainAddress targets = 5 ; +} + +// BlockchainAddress represents a blochain address. This structure clubs together +// blokchain ID together with an address on that network. It is used to point +// to an address on any blockchain network. +message BlockchainAddress { + // An arbitrary blockchain ID. + string blockchain_id = 1 ; + // An address on the specified blockchain network. Address is not a + // weave.Address as we cannot know what is the format of an address on the + // chain that this token instance links to. Because we do not know the rules + // to validate an address for any blockchain ID, this is an arbitrary bulk of + // data. + // It is more convinient to always use encoded representation of each address + // and store it as a string. Using bytes while compact is not as comfortable + // to use. + string address = 2; +} + +// Configuration is a dynamic configuration used by this extension, managed by +// the functionality provided by gconf package. +message Configuration { + weave.Metadata metadata = 1; + // Owner is present to implement gconf.OwnedConfig interface + // This defines the Address that is allowed to update the Configuration object and is + // needed to make use of gconf.NewUpdateConfigurationHandler + bytes owner = 2 ; + // Valid domain defines a regular expression that every valid domain of an + // account must match. Rule must not include the asterisk (*) character. + string valid_domain = 3; + // Valid name defines a regular expression that every valid name of an + // account must match. Rule must not include the asterisk (*) character. + string valid_name = 4; + // Domain review defines the duration of the domain renewal period. + int64 domain_renew = 6 ; +} + +// UpdateConfigurationMsg is used by the gconf extension to update the +// configuration. +message UpdateConfigurationMsg { + weave.Metadata metadata = 1; + Configuration patch = 2; +} + +// RegisterDomainMsg is issuing registration of a new domain. Requested +// domain name must be available (not yet registed) in order for the request to +// succeed. +// Registering a domain creates an account with no name that belongs to this +// domain. +message RegisterDomainMsg { + weave.Metadata metadata = 1; + // Owner holds the address of the newly registered domain. If not provided, + // main signer is used. + bytes owner = 2 ; + // Domain part of the account that should be registered. + string domain = 3; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to register a domain. Storing a client token + // helps identify contribution of such party later. + bytes client_token = 4; +} + +// TransferDomainMsg is issuing an ownership transfer over specified domain. +message TransferDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is transferred. + string domain = 2; + // New owner holds the address that the ownership of the domain is + // transferred to. + bytes new_owner = 3 ; +} + +// RenewDomainMsg is issuing a domain expiration time extension. Extension +// period is defined by the configuration entity. +message RenewDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is transferred. + string domain = 2; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + bytes client_token = 3; +} + +// DeleteDomainMsg issues deletion of a domain and all accounts that belong to +// that domain. +message DeleteDomainMsg { + weave.Metadata metadata = 1; + // Name of the domain that is deleted. + string domain = 2; +} + +// RegisterAccountMsg issues registration of an account. Requested domain must +// exist and belong to the same user that signs this message. +message RegisterAccountMsg { + weave.Metadata metadata = 1; + // Domain that a new account is the be registered under. + string domain = 2; + // Name that a new account is the be registered with. + string name = 3; + // Owner holds the address of the newly registered account. Can be empty to + // leave the administration to the domain owner only. + bytes owner = 4 ; + // Client token is an arbitrary data that can be provided by a middleman + // (i.e. retailer) that although does not participate directly in the + // transaction, helped a user to renew a domain. Storing a client token helps + // identify contribution of such party later. + repeated BlockchainAddress targets = 5 ; + bytes client_token = 6; +} + +// TransferAccountMsg is issuing an ownership transfer over specified account. +// Transfering an account ownership does not affect related domain owner +// permissions to administrate that account. +message TransferAccountMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 3; + // New owner holds the address that the ownership of the domain is + // transferred to. + bytes new_owner = 4 ; +} + +// ReplaceAccountTargetsMsg is issuing rewrite of all targets that given +// account points to. +message ReplaceAccountTargetsMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 4; + repeated BlockchainAddress new_targets = 5 ; +} + +// DeleteAccountMsg issues deletion of a name that belongs to given domain. +// Message must be signed by the domain owner. +message DeleteAccountMsg { + weave.Metadata metadata = 1; + string domain = 2; + string name = 3; +} From 63da1367788b7284cbac0fd4568be302037d96b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Mon, 28 Oct 2019 16:25:12 +0100 Subject: [PATCH 02/16] blue account bnscli --- cmd/bnscli/clitests/blue_delete_account.test | 8 + .../clitests/blue_delete_account.test.gold | 11 + cmd/bnscli/clitests/blue_delete_domain.test | 7 + .../clitests/blue_delete_domain.test.gold | 10 + .../clitests/blue_register_account.test | 26 ++ .../clitests/blue_register_account.test.gold | 47 +++ cmd/bnscli/clitests/blue_register_domain.test | 14 + .../clitests/blue_register_domain.test.gold | 21 ++ .../blue_replace_account_targets.test | 19 ++ .../blue_replace_account_targets.test.gold | 33 +++ .../clitests/blue_transfer_account.test | 9 + .../clitests/blue_transfer_account.test.gold | 12 + cmd/bnscli/clitests/blue_transfer_domain.test | 8 + .../clitests/blue_transfer_domain.test.gold | 11 + cmd/bnscli/cmd_blueaccount.go | 275 ++++++++++++++++++ cmd/bnscli/main.go | 68 +++-- 16 files changed, 549 insertions(+), 30 deletions(-) create mode 100644 cmd/bnscli/clitests/blue_delete_account.test create mode 100644 cmd/bnscli/clitests/blue_delete_account.test.gold create mode 100644 cmd/bnscli/clitests/blue_delete_domain.test create mode 100644 cmd/bnscli/clitests/blue_delete_domain.test.gold create mode 100644 cmd/bnscli/clitests/blue_register_account.test create mode 100644 cmd/bnscli/clitests/blue_register_account.test.gold create mode 100644 cmd/bnscli/clitests/blue_register_domain.test create mode 100644 cmd/bnscli/clitests/blue_register_domain.test.gold create mode 100644 cmd/bnscli/clitests/blue_replace_account_targets.test create mode 100644 cmd/bnscli/clitests/blue_replace_account_targets.test.gold create mode 100644 cmd/bnscli/clitests/blue_transfer_account.test create mode 100644 cmd/bnscli/clitests/blue_transfer_account.test.gold create mode 100644 cmd/bnscli/clitests/blue_transfer_domain.test create mode 100644 cmd/bnscli/clitests/blue_transfer_domain.test.gold create mode 100644 cmd/bnscli/cmd_blueaccount.go diff --git a/cmd/bnscli/clitests/blue_delete_account.test b/cmd/bnscli/clitests/blue_delete_account.test new file mode 100644 index 00000000..56a73073 --- /dev/null +++ b/cmd/bnscli/clitests/blue_delete_account.test @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +bnscli blue-delete-account \ + -domain wunderland \ + -name alice \ + | bnscli view diff --git a/cmd/bnscli/clitests/blue_delete_account.test.gold b/cmd/bnscli/clitests/blue_delete_account.test.gold new file mode 100644 index 00000000..b300a279 --- /dev/null +++ b/cmd/bnscli/clitests/blue_delete_account.test.gold @@ -0,0 +1,11 @@ +{ + "Sum": { + "BlueaccountDeleteAccountMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice" + } + } +} \ No newline at end of file diff --git a/cmd/bnscli/clitests/blue_delete_domain.test b/cmd/bnscli/clitests/blue_delete_domain.test new file mode 100644 index 00000000..f46987d5 --- /dev/null +++ b/cmd/bnscli/clitests/blue_delete_domain.test @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +bnscli blue-delete-domain \ + -domain wunderland \ + | bnscli view diff --git a/cmd/bnscli/clitests/blue_delete_domain.test.gold b/cmd/bnscli/clitests/blue_delete_domain.test.gold new file mode 100644 index 00000000..a5da4af1 --- /dev/null +++ b/cmd/bnscli/clitests/blue_delete_domain.test.gold @@ -0,0 +1,10 @@ +{ + "Sum": { + "BlueaccountDeleteDomainMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland" + } + } +} \ No newline at end of file diff --git a/cmd/bnscli/clitests/blue_register_account.test b/cmd/bnscli/clitests/blue_register_account.test new file mode 100644 index 00000000..a97205ac --- /dev/null +++ b/cmd/bnscli/clitests/blue_register_account.test @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +bnscli blue-register-account \ + -domain wunderland \ + -name alice \ + | bnscli view + +echo '' + +bnscli blue-register-account \ + -domain wunderland \ + -name alice \ + -client-token "68656c6c6f20776f726c640a" \ + | bnscli view + +echo '' + +bnscli blue-register-account \ + -domain wunderland \ + -name alice \ + -client-token "68656c6c6f20776f726c640a" \ + | bnscli blue-with-bc-address -addr 111 -bc first \ + | bnscli blue-with-bc-address -addr 222 -bc second \ + | bnscli view diff --git a/cmd/bnscli/clitests/blue_register_account.test.gold b/cmd/bnscli/clitests/blue_register_account.test.gold new file mode 100644 index 00000000..06dfcd0e --- /dev/null +++ b/cmd/bnscli/clitests/blue_register_account.test.gold @@ -0,0 +1,47 @@ +{ + "Sum": { + "BlueaccountRegisterAccountMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice", + "targets": null + } + } +} +{ + "Sum": { + "BlueaccountRegisterAccountMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice", + "targets": null, + "client_token": "aGVsbG8gd29ybGQK" + } + } +} +{ + "Sum": { + "BlueaccountRegisterAccountMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice", + "targets": [ + { + "blockchain_id": "first", + "address": "111" + }, + { + "blockchain_id": "second", + "address": "222" + } + ], + "client_token": "aGVsbG8gd29ybGQK" + } + } +} \ No newline at end of file diff --git a/cmd/bnscli/clitests/blue_register_domain.test b/cmd/bnscli/clitests/blue_register_domain.test new file mode 100644 index 00000000..499baedf --- /dev/null +++ b/cmd/bnscli/clitests/blue_register_domain.test @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +bnscli blue-register-domain \ + -domain wunderland \ + | bnscli view + +echo '' + +bnscli blue-register-domain \ + -domain wunderland \ + -client-token "68656c6c6f20776f726c640a" \ + | bnscli view diff --git a/cmd/bnscli/clitests/blue_register_domain.test.gold b/cmd/bnscli/clitests/blue_register_domain.test.gold new file mode 100644 index 00000000..5d131e64 --- /dev/null +++ b/cmd/bnscli/clitests/blue_register_domain.test.gold @@ -0,0 +1,21 @@ +{ + "Sum": { + "BlueaccountRegisterDomainMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland" + } + } +} +{ + "Sum": { + "BlueaccountRegisterDomainMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "client_token": "aGVsbG8gd29ybGQK" + } + } +} \ No newline at end of file diff --git a/cmd/bnscli/clitests/blue_replace_account_targets.test b/cmd/bnscli/clitests/blue_replace_account_targets.test new file mode 100644 index 00000000..9768ae98 --- /dev/null +++ b/cmd/bnscli/clitests/blue_replace_account_targets.test @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +bnscli blue-replace-account-targets \ + -domain wunderland \ + -name alice \ + | bnscli view + +echo + +bnscli blue-replace-account-targets \ + -domain wunderland \ + -name alice \ + | bnscli blue-with-bc-address -addr 111 -bc first \ + | bnscli blue-with-bc-address -addr 222 -bc second \ + | bnscli view + +echo diff --git a/cmd/bnscli/clitests/blue_replace_account_targets.test.gold b/cmd/bnscli/clitests/blue_replace_account_targets.test.gold new file mode 100644 index 00000000..22a719f4 --- /dev/null +++ b/cmd/bnscli/clitests/blue_replace_account_targets.test.gold @@ -0,0 +1,33 @@ +{ + "Sum": { + "BlueaccountReplaceAccountTargetMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice", + "new_targets": null + } + } +} +{ + "Sum": { + "BlueaccountReplaceAccountTargetMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice", + "new_targets": [ + { + "blockchain_id": "first", + "address": "111" + }, + { + "blockchain_id": "second", + "address": "222" + } + ] + } + } +} diff --git a/cmd/bnscli/clitests/blue_transfer_account.test b/cmd/bnscli/clitests/blue_transfer_account.test new file mode 100644 index 00000000..2106b7cc --- /dev/null +++ b/cmd/bnscli/clitests/blue_transfer_account.test @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +bnscli blue-transfer-account \ + -domain wunderland \ + -name alice \ + -owner 'seq:foo/bar/1' \ + | bnscli view diff --git a/cmd/bnscli/clitests/blue_transfer_account.test.gold b/cmd/bnscli/clitests/blue_transfer_account.test.gold new file mode 100644 index 00000000..a2c7c7de --- /dev/null +++ b/cmd/bnscli/clitests/blue_transfer_account.test.gold @@ -0,0 +1,12 @@ +{ + "Sum": { + "BlueaccountTransferAccountMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "name": "alice", + "new_owner": "60AAA3D972FDA7AF6B7E6A9D5369BA40E5AD8071" + } + } +} \ No newline at end of file diff --git a/cmd/bnscli/clitests/blue_transfer_domain.test b/cmd/bnscli/clitests/blue_transfer_domain.test new file mode 100644 index 00000000..d63c4306 --- /dev/null +++ b/cmd/bnscli/clitests/blue_transfer_domain.test @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +bnscli blue-transfer-domain \ + -domain wunderland \ + -owner 'seq:foo/bar/1' \ + | bnscli view diff --git a/cmd/bnscli/clitests/blue_transfer_domain.test.gold b/cmd/bnscli/clitests/blue_transfer_domain.test.gold new file mode 100644 index 00000000..cb18ce0e --- /dev/null +++ b/cmd/bnscli/clitests/blue_transfer_domain.test.gold @@ -0,0 +1,11 @@ +{ + "Sum": { + "BlueaccountTransferDomainMsg": { + "metadata": { + "schema": 1 + }, + "domain": "wunderland", + "new_owner": "60AAA3D972FDA7AF6B7E6A9D5369BA40E5AD8071" + } + } +} \ No newline at end of file diff --git a/cmd/bnscli/cmd_blueaccount.go b/cmd/bnscli/cmd_blueaccount.go new file mode 100644 index 00000000..8b1f0211 --- /dev/null +++ b/cmd/bnscli/cmd_blueaccount.go @@ -0,0 +1,275 @@ +package main + +import ( + "flag" + "fmt" + "io" + + "github.com/iov-one/weave" + bnsd "github.com/iov-one/weave/cmd/bnsd/app" + "github.com/iov-one/weave/cmd/bnsd/x/blueaccount" +) + +func cmdRegisterBlueDomain(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction for registering a domain. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + clientTokenFl = flHex(fl, "client-token", "", "Optional, hex encoded client token.") + ) + fl.Parse(args) + + msg := blueaccount.RegisterDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + ClientToken: *clientTokenFl, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountRegisterDomainMsg{ + BlueaccountRegisterDomainMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} + +func cmdDeleteBlueDomain(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction to delete a domain. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + ) + fl.Parse(args) + + msg := blueaccount.DeleteDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountDeleteDomainMsg{ + BlueaccountDeleteDomainMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} + +func cmdRegisterBlueAccount(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction for registering an account. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + nameFl = fl.String("name", "", "Name part of the username. For example alice in 'alice*wunderland'") + clientTokenFl = flHex(fl, "client-token", "", "Optional, hex encoded client token.") + ) + fl.Parse(args) + + msg := blueaccount.RegisterAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + Name: *nameFl, + ClientToken: *clientTokenFl, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountRegisterAccountMsg{ + BlueaccountRegisterAccountMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} + +func cmdDeleteBlueAccount(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction to delete an account. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + nameFl = fl.String("name", "", "Name part of the username. For example alice in 'alice*wunderland'") + ) + fl.Parse(args) + + msg := blueaccount.DeleteAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + Name: *nameFl, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountDeleteAccountMsg{ + BlueaccountDeleteAccountMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} + +func cmdWithBlueBlockchainAddress(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Attach a blockchain address target to given transaction. + `) + fl.PrintDefaults() + } + var ( + blockchainFl = fl.String("bc", "", "Blockchain network ID.") + addressFl = fl.String("addr", "", "String representation of the blochain address on this network.") + ) + fl.Parse(args) + + tx, _, err := readTx(input) + if err != nil { + return fmt.Errorf("cannot read input transaction: %s", err) + } + + msg, err := tx.GetMsg() + if err != nil { + return fmt.Errorf("cannot extract message from the transaction: %s", err) + } + + switch msg := msg.(type) { + case *blueaccount.RegisterAccountMsg: + msg.Targets = append(msg.Targets, blueaccount.BlockchainAddress{ + BlockchainID: *blockchainFl, + Address: *addressFl, + }) + case *blueaccount.ReplaceAccountTargetsMsg: + msg.NewTargets = append(msg.NewTargets, blueaccount.BlockchainAddress{ + BlockchainID: *blockchainFl, + Address: *addressFl, + }) + default: + return fmt.Errorf("unsupported transaction message: %T", msg) + } + + // Serialize back the transaction from the input. It was modified. + _, err = writeTx(output, tx) + return err +} + +func cmdTransferBlueDomain(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction to delete an account. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + newOwnerFl = flAddress(fl, "owner", "", "Address of the new owner.") + ) + fl.Parse(args) + + msg := blueaccount.TransferDomainMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + NewOwner: *newOwnerFl, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountTransferDomainMsg{ + BlueaccountTransferDomainMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} + +func cmdTransferBlueAccount(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction to delete an account. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + nameFl = fl.String("name", "", "Name part of the username. For example alice in 'alice*wunderland'") + newOwnerFl = flAddress(fl, "owner", "", "Address of the new owner.") + ) + fl.Parse(args) + + msg := blueaccount.TransferAccountMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + Name: *nameFl, + NewOwner: *newOwnerFl, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountTransferAccountMsg{ + BlueaccountTransferAccountMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} + +func cmdReplaceBlueAccountTargets(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction to delete an account. + `) + fl.PrintDefaults() + } + var ( + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + nameFl = fl.String("name", "", "Name part of the username. For example alice in 'alice*wunderland'") + ) + fl.Parse(args) + + msg := blueaccount.ReplaceAccountTargetsMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + Name: *nameFl, + NewTargets: nil, // Use cmdWithBlueBlockchainAddress to set. + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountReplaceAccountTargetMsg{ + BlueaccountReplaceAccountTargetMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} diff --git a/cmd/bnscli/main.go b/cmd/bnscli/main.go index af88a23f..04cf7ad9 100644 --- a/cmd/bnscli/main.go +++ b/cmd/bnscli/main.go @@ -35,36 +35,44 @@ import ( // | bnscli submit // var commands = map[string]func(input io.Reader, output io.Writer, args []string) error{ - "as-batch": cmdAsBatch, - "as-proposal": cmdAsProposal, - "as-sequence": cmdAsSequence, - "del-proposal": cmdDelProposal, - "from-sequence": cmdFromSequence, - "keyaddr": cmdKeyaddr, - "keygen": cmdKeygen, - "mnemonic": cmdMnemonic, - "multisig": cmdMultisig, - "query": cmdQuery, - "register-username": cmdRegisterUsername, - "release-escrow": cmdReleaseEscrow, - "reset-revenue": cmdResetRevenue, - "resolve-username": cmdResolveUsername, - "send-tokens": cmdSendTokens, - "set-msgfee": cmdSetMsgFee, - "set-validators": cmdSetValidators, - "sign": cmdSignTransaction, - "submit": cmdSubmitTransaction, - "text-resolution": cmdTextResolution, - "update-election-rule": cmdUpdateElectionRule, - "update-electorate": cmdUpdateElectorate, - "version": cmdVersion, - "view": cmdTransactionView, - "vote": cmdVote, - "with-blockchain-address": cmdWithBlockchainAddress, - "with-elector": cmdWithElector, - "with-fee": cmdWithFee, - "with-multisig": cmdWithMultisig, - "with-multisig-participant": cmdWithMultisigParticipant, + "as-batch": cmdAsBatch, + "as-proposal": cmdAsProposal, + "as-sequence": cmdAsSequence, + "blue-delete-account": cmdDeleteBlueAccount, + "blue-delete-domain": cmdDeleteBlueDomain, + "blue-register-account": cmdRegisterBlueAccount, + "blue-register-domain": cmdRegisterBlueDomain, + "blue-replace-account-targets": cmdReplaceBlueAccountTargets, + "blue-transfer-account": cmdTransferBlueAccount, + "blue-transfer-domain": cmdTransferBlueDomain, + "blue-with-bc-address": cmdWithBlueBlockchainAddress, + "del-proposal": cmdDelProposal, + "from-sequence": cmdFromSequence, + "keyaddr": cmdKeyaddr, + "keygen": cmdKeygen, + "mnemonic": cmdMnemonic, + "multisig": cmdMultisig, + "query": cmdQuery, + "register-username": cmdRegisterUsername, + "release-escrow": cmdReleaseEscrow, + "reset-revenue": cmdResetRevenue, + "resolve-username": cmdResolveUsername, + "send-tokens": cmdSendTokens, + "set-msgfee": cmdSetMsgFee, + "set-validators": cmdSetValidators, + "sign": cmdSignTransaction, + "submit": cmdSubmitTransaction, + "text-resolution": cmdTextResolution, + "update-election-rule": cmdUpdateElectionRule, + "update-electorate": cmdUpdateElectorate, + "version": cmdVersion, + "view": cmdTransactionView, + "vote": cmdVote, + "with-blockchain-address": cmdWithBlockchainAddress, + "with-elector": cmdWithElector, + "with-fee": cmdWithFee, + "with-multisig": cmdWithMultisig, + "with-multisig-participant": cmdWithMultisigParticipant, } func main() { From be3baa22f3a12b0d6c242b51bb5d48d351e1b265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 09:14:52 +0100 Subject: [PATCH 03/16] rename till -> untill --- cmd/bnsd/x/blueaccount/codec.pb.go | 110 +++++++++--------- cmd/bnsd/x/blueaccount/codec.proto | 4 +- cmd/bnsd/x/blueaccount/handler.go | 24 ++-- cmd/bnsd/x/blueaccount/handler_test.go | 8 +- cmd/bnsd/x/blueaccount/model.go | 2 +- docs/proto/index.html | 4 +- spec/gogo/cmd/bnsd/x/blueaccount/codec.proto | 4 +- spec/proto/cmd/bnsd/x/blueaccount/codec.proto | 4 +- 8 files changed, 80 insertions(+), 80 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/codec.pb.go b/cmd/bnsd/x/blueaccount/codec.pb.go index 0d18e075..3dad3772 100644 --- a/cmd/bnsd/x/blueaccount/codec.pb.go +++ b/cmd/bnsd/x/blueaccount/codec.pb.go @@ -40,10 +40,10 @@ type Domain struct { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. Owner github_com_iov_one_weave.Address `protobuf:"bytes,3,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` - // Valid till defines the expiration date for the domain. Expired domain + // Valid untill defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - ValidTill github_com_iov_one_weave.UnixTime `protobuf:"varint,4,opt,name=valid_till,json=validTill,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"valid_till,omitempty"` + ValidUntill github_com_iov_one_weave.UnixTime `protobuf:"varint,4,opt,name=valid_untill,json=validUntill,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"valid_untill,omitempty"` } func (m *Domain) Reset() { *m = Domain{} } @@ -100,9 +100,9 @@ func (m *Domain) GetOwner() github_com_iov_one_weave.Address { return nil } -func (m *Domain) GetValidTill() github_com_iov_one_weave.UnixTime { +func (m *Domain) GetValidUntill() github_com_iov_one_weave.UnixTime { if m != nil { - return m.ValidTill + return m.ValidUntill } return 0 } @@ -987,50 +987,50 @@ func init() { func init() { proto.RegisterFile("cmd/bnsd/x/blueaccount/codec.proto", fileDescriptor_df2ac0ab2dae2b1e) } var fileDescriptor_df2ac0ab2dae2b1e = []byte{ - // 677 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x6a, 0xdb, 0x4a, - 0x14, 0xf6, 0xd8, 0x8a, 0x13, 0x1f, 0x39, 0x37, 0x89, 0xb8, 0x04, 0x11, 0xb8, 0xb2, 0x23, 0x6e, - 0xc0, 0x97, 0x4b, 0xad, 0x92, 0xd2, 0x4d, 0x17, 0x85, 0xb8, 0xee, 0x22, 0xd0, 0xb4, 0x20, 0x9c, - 0x6e, 0xcd, 0x58, 0x3a, 0x51, 0x86, 0xc8, 0x33, 0x46, 0x1a, 0x47, 0x79, 0x84, 0x2e, 0xba, 0xe8, - 0xbe, 0x2f, 0xd1, 0x5d, 0xa1, 0x4f, 0x90, 0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f, 0x09, 0xfa, 0x68, 0xf0, 0xfb, 0xf8, 0x01, 0x1c, - 0x93, 0x6c, 0x44, 0xfb, 0x0c, 0x36, 0x55, 0xac, 0x1f, 0x40, 0xec, 0x86, 0x79, 0x39, 0xb4, 0xc8, - 0xd5, 0xd0, 0x22, 0xdf, 0x87, 0x16, 0xf9, 0x70, 0x6d, 0xe5, 0xae, 0xae, 0xad, 0xdc, 0xb7, 0x6b, - 0x2b, 0xd7, 0x29, 0xa6, 0xff, 0x34, 0x4f, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x41, 0xf5, 0x92, - 0x94, 0x29, 0x09, 0x00, 0x00, + // 676 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6b, 0x13, 0x41, + 0x14, 0xcf, 0x24, 0x69, 0xda, 0xbc, 0x4d, 0x6d, 0xbb, 0x48, 0x59, 0x0a, 0x6e, 0xd2, 0xc5, 0x42, + 0x44, 0xcc, 0x4a, 0xc5, 0x8b, 0x07, 0xa1, 0x31, 0x82, 0x05, 0xab, 0xb0, 0xa4, 0x5e, 0xc3, 0x64, + 0xf7, 0x75, 0xbb, 0x74, 0x33, 0x13, 0x76, 0x27, 0xdd, 0x7e, 0x04, 0x0f, 0x1e, 0xbc, 0xfb, 0x25, + 0xbc, 0x09, 0x7e, 0x82, 0x1e, 0x0b, 0x5e, 0x3c, 0x05, 0x49, 0xbf, 0x45, 0x4f, 0x92, 0x99, 0x4d, + 0x93, 0x18, 0x2a, 0xa4, 0x86, 0xe2, 0x6d, 0xf6, 0xed, 0xfb, 0xcd, 0xbe, 0xdf, 0x9f, 0x19, 0x16, + 0x2c, 0xb7, 0xe3, 0xd9, 0x6d, 0x16, 0x7b, 0xf6, 0x99, 0xdd, 0x0e, 0x7b, 0x48, 0x5d, 0x97, 0xf7, + 0x98, 0xb0, 0x5d, 0xee, 0xa1, 0x5b,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7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xae, 0x80, 0x0a, 0xab, + 0x2d, 0x09, 0x00, 0x00, } func (m *Domain) Marshal() (dAtA []byte, err error) { @@ -1070,10 +1070,10 @@ func (m *Domain) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) i += copy(dAtA[i:], m.Owner) } - if m.ValidTill != 0 { + if m.ValidUntill != 0 { dAtA[i] = 0x20 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.ValidTill)) + i = encodeVarintCodec(dAtA, i, uint64(m.ValidUntill)) } return i, nil } @@ -1644,8 +1644,8 @@ func (m *Domain) Size() (n int) { if l > 0 { n += 1 + l + sovCodec(uint64(l)) } - if m.ValidTill != 0 { - n += 1 + sovCodec(uint64(m.ValidTill)) + if m.ValidUntill != 0 { + n += 1 + sovCodec(uint64(m.ValidUntill)) } return n } @@ -2081,9 +2081,9 @@ func (m *Domain) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidTill", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidUntill", wireType) } - m.ValidTill = 0 + m.ValidUntill = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCodec @@ -2093,7 +2093,7 @@ func (m *Domain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidTill |= github_com_iov_one_weave.UnixTime(b&0x7F) << shift + m.ValidUntill |= github_com_iov_one_weave.UnixTime(b&0x7F) << shift if b < 0x80 { break } diff --git a/cmd/bnsd/x/blueaccount/codec.proto b/cmd/bnsd/x/blueaccount/codec.proto index ad9f2d52..a41d7b42 100644 --- a/cmd/bnsd/x/blueaccount/codec.proto +++ b/cmd/bnsd/x/blueaccount/codec.proto @@ -21,10 +21,10 @@ message Domain { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. bytes owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; - // Valid till defines the expiration date for the domain. Expired domain + // Valid untill defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - int64 valid_till = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; + int64 valid_untill = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; } // Account represents a blue account name. diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index 36d76695..8e2301fc 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -97,10 +97,10 @@ func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w return nil, errors.Wrap(err, "cannot load configuration") } domain := Domain{ - Metadata: &weave.Metadata{}, - Owner: owner, - Domain: msg.Domain, - ValidTill: weave.AsUnixTime(now.Add(conf.DomainRenew.Duration())), + Metadata: &weave.Metadata{}, + Owner: owner, + Domain: msg.Domain, + ValidUntill: weave.AsUnixTime(now.Add(conf.DomainRenew.Duration())), } if _, err := h.domains.Put(db, []byte(msg.Domain), &domain); err != nil { return nil, errors.Wrap(err, "cannot store domain entity") @@ -182,7 +182,7 @@ func (h *transferDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx if !h.auth.HasAddress(ctx, domain.Owner) { return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only owner can transfer a domain") } - if weave.IsExpired(ctx, domain.ValidTill) { + if weave.IsExpired(ctx, domain.ValidUntill) { return nil, nil, errors.Wrap(errors.ErrExpired, "expired domain cannot be transferred") } return &domain, &msg, nil @@ -214,12 +214,12 @@ func (h *renewDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weav if err != nil { return nil, errors.Wrap(err, "cannot load configuration") } - nextValidTill := now.Add(conf.DomainRenew.Duration()) - // ValidTill time is only extended. We want to avoid the situation when + nextValidUntill := now.Add(conf.DomainRenew.Duration()) + // ValidUntill time is only extended. We want to avoid the situation when // the configuration is changed, limiting the expiration time period // and renewing a domain by shortening its expiration date. - if nextValidTill.After(domain.ValidTill.Time()) { - domain.ValidTill = weave.AsUnixTime(nextValidTill) + if nextValidUntill.After(domain.ValidUntill.Time()) { + domain.ValidUntill = weave.AsUnixTime(nextValidUntill) if _, err := h.domains.Put(db, []byte(msg.Domain), domain); err != nil { return nil, errors.Wrap(err, "cannot store domain") } @@ -342,7 +342,7 @@ func (h *registerAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx if !h.auth.HasAddress(ctx, domain.Owner) { return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only domain owner can register an account") } - if weave.IsExpired(ctx, domain.ValidTill) { + if weave.IsExpired(ctx, domain.ValidUntill) { return nil, nil, errors.Wrap(errors.ErrExpired, "domain is expired") } switch err := h.accounts.Has(db, accountKey(msg.Name, msg.Domain)); { @@ -403,7 +403,7 @@ func (h *transferAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { return nil, nil, nil, errors.Wrap(err, "cannot get domain") } - if weave.IsExpired(ctx, domain.ValidTill) { + if weave.IsExpired(ctx, domain.ValidUntill) { return nil, nil, nil, errors.Wrap(errors.ErrExpired, "cannot transfer account in an expired domain") } var account Account @@ -455,7 +455,7 @@ func (h *replaceAccountTargetHandler) validate(ctx weave.Context, db weave.KVSto if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { return nil, nil, errors.Wrap(err, "cannot get domain") } - if weave.IsExpired(ctx, domain.ValidTill) { + if weave.IsExpired(ctx, domain.ValidUntill) { return nil, nil, errors.Wrap(errors.ErrExpired, "cannot update account in an expired domain") } var account Account diff --git a/cmd/bnsd/x/blueaccount/handler_test.go b/cmd/bnsd/x/blueaccount/handler_test.go index dad18337..bcf0d36c 100644 --- a/cmd/bnsd/x/blueaccount/handler_test.go +++ b/cmd/bnsd/x/blueaccount/handler_test.go @@ -107,7 +107,7 @@ func TestUseCases(t *testing.T) { if !d.Owner.Equals(aliceCond.Address()) { t.Fatalf("unexpected wunderland owner: want %q, got %q", aliceCond.Address(), d.Owner) } - if got, want := d.ValidTill, weave.UnixTime(now+1000); got != want { + if got, want := d.ValidUntill, weave.UnixTime(now+1000); got != want { t.Fatalf("unexpected valid till: want %d, got %d", want, got) } }, @@ -140,7 +140,7 @@ func TestUseCases(t *testing.T) { if !d.Owner.Equals(bobCond.Address()) { t.Fatalf("unexpected wunderland owner: want %q, got %q", bobCond.Address(), d.Owner) } - if got, want := d.ValidTill, weave.UnixTime(now+1000); got != want { + if got, want := d.ValidUntill, weave.UnixTime(now+1000); got != want { t.Fatalf("unexpected valid till: want %d, got %d", want, got) } }, @@ -366,7 +366,7 @@ func TestUseCases(t *testing.T) { // Expiration time should be execution time // (block time) which is now + 2, plus // expiration offset. - if got, want := d.ValidTill, weave.UnixTime(now+2+1000); want != got { + if got, want := d.ValidUntill, weave.UnixTime(now+2+1000); want != got { t.Fatalf("want valid till %s, got %s", want, got) } }, @@ -422,7 +422,7 @@ func TestUseCases(t *testing.T) { } // Expiration time should not be updated // because it would be shortened. - if got, want := d.ValidTill, weave.UnixTime(now+1000); want != got { + if got, want := d.ValidUntill, weave.UnixTime(now+1000); want != got { t.Logf("want %d %s", want, want) t.Logf(" got %d %s", got, got) t.Fatal("unexpected valid till") diff --git a/cmd/bnsd/x/blueaccount/model.go b/cmd/bnsd/x/blueaccount/model.go index 47a68f67..b4f92c2c 100644 --- a/cmd/bnsd/x/blueaccount/model.go +++ b/cmd/bnsd/x/blueaccount/model.go @@ -52,7 +52,7 @@ func (d *Domain) Validate() error { errs = errors.AppendField(errs, "Metadata", d.Metadata.Validate()) errs = errors.AppendField(errs, "Domain", validateDomain(d.Domain)) errs = errors.AppendField(errs, "Owner", d.Owner.Validate()) - errs = errors.AppendField(errs, "ValidTill", d.ValidTill.Validate()) + errs = errors.AppendField(errs, "ValidUntill", d.ValidUntill.Validate()) return errs } diff --git a/docs/proto/index.html b/docs/proto/index.html index b89b0874..fdc1092a 100644 --- a/docs/proto/index.html +++ b/docs/proto/index.html @@ -2127,10 +2127,10 @@

    Domain

    - valid_till + valid_untill int64 -

    Valid till defines the expiration date for the domain. Expired domain +

    Valid untill defines the expiration date for the domain. Expired domain cannot be used or modified. None of the accounts that belong to an expired domain can be used of modified as well.

    diff --git a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto index ad9f2d52..a41d7b42 100644 --- a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto @@ -21,10 +21,10 @@ message Domain { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. bytes owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; - // Valid till defines the expiration date for the domain. Expired domain + // Valid untill defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - int64 valid_till = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; + int64 valid_untill = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; } // Account represents a blue account name. diff --git a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto index af450923..c60dd763 100644 --- a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto @@ -20,10 +20,10 @@ message Domain { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. bytes owner = 3 ; - // Valid till defines the expiration date for the domain. Expired domain + // Valid untill defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - int64 valid_till = 4 ; + int64 valid_untill = 4 ; } // Account represents a blue account name. From ca9d1ac38e91868c53446077ef64cf34d69f29f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 09:15:24 +0100 Subject: [PATCH 04/16] typo --- cmd/bnsd/x/blueaccount/codec.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bnsd/x/blueaccount/codec.proto b/cmd/bnsd/x/blueaccount/codec.proto index a41d7b42..18fd697b 100644 --- a/cmd/bnsd/x/blueaccount/codec.proto +++ b/cmd/bnsd/x/blueaccount/codec.proto @@ -62,7 +62,7 @@ message BlockchainAddress { // chain that this token instance links to. Because we do not know the rules // to validate an address for any blockchain ID, this is an arbitrary bulk of // data. - // It is more convinient to always use encoded representation of each address + // It is more convenient to always use encoded representation of each address // and store it as a string. Using bytes while compact is not as comfortable // to use. string address = 2; From 430d6d80f75a8d817a1b8ae14ec448af00dd706f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 09:19:36 +0100 Subject: [PATCH 05/16] fix message paths --- cmd/bnsd/x/blueaccount/msg.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/msg.go b/cmd/bnsd/x/blueaccount/msg.go index d811fb92..80189a26 100644 --- a/cmd/bnsd/x/blueaccount/msg.go +++ b/cmd/bnsd/x/blueaccount/msg.go @@ -23,7 +23,7 @@ func init() { var _ weave.Msg = (*UpdateConfigurationMsg)(nil) func (UpdateConfigurationMsg) Path() string { - return "blueaccount/updateconfigurationmsg" + return "blueaccount/update_configuration_msg" } func (msg *UpdateConfigurationMsg) Validate() error { @@ -36,7 +36,7 @@ func (msg *UpdateConfigurationMsg) Validate() error { var _ weave.Msg = (*RegisterDomainMsg)(nil) func (RegisterDomainMsg) Path() string { - return "blueaccount/registerdomainmsg" + return "blueaccount/register_domain_msg" } func (msg *RegisterDomainMsg) Validate() error { @@ -53,7 +53,7 @@ func (msg *RegisterDomainMsg) Validate() error { var _ weave.Msg = (*TransferDomainMsg)(nil) func (TransferDomainMsg) Path() string { - return "blueaccount/transferdomainmsg" + return "blueaccount/transfer_domain_msg" } func (msg *TransferDomainMsg) Validate() error { @@ -67,7 +67,7 @@ func (msg *TransferDomainMsg) Validate() error { var _ weave.Msg = (*RenewDomainMsg)(nil) func (RenewDomainMsg) Path() string { - return "blueaccount/renewdomainmsg" + return "blueaccount/renew_domain_msg" } func (msg *RenewDomainMsg) Validate() error { @@ -81,7 +81,7 @@ func (msg *RenewDomainMsg) Validate() error { var _ weave.Msg = (*DeleteDomainMsg)(nil) func (DeleteDomainMsg) Path() string { - return "blueaccount/deletedomainmsg" + return "blueaccount/delete_domain_msg" } func (msg *DeleteDomainMsg) Validate() error { @@ -94,7 +94,7 @@ func (msg *DeleteDomainMsg) Validate() error { var _ weave.Msg = (*RegisterAccountMsg)(nil) func (RegisterAccountMsg) Path() string { - return "blueaccount/registeraccountmsg" + return "blueaccount/register_account_msg" } func (msg *RegisterAccountMsg) Validate() error { @@ -112,7 +112,7 @@ func (msg *RegisterAccountMsg) Validate() error { var _ weave.Msg = (*TransferAccountMsg)(nil) func (TransferAccountMsg) Path() string { - return "blueaccount/transferaccountmsg" + return "blueaccount/transfer_account_msg" } func (msg *TransferAccountMsg) Validate() error { @@ -126,7 +126,7 @@ func (msg *TransferAccountMsg) Validate() error { var _ weave.Msg = (*ReplaceAccountTargetsMsg)(nil) func (ReplaceAccountTargetsMsg) Path() string { - return "blueaccount/replaceaccounttargetsmsg" + return "blueaccount/replace_account_targets_msg" } func (msg *ReplaceAccountTargetsMsg) Validate() error { @@ -141,7 +141,7 @@ func (msg *ReplaceAccountTargetsMsg) Validate() error { var _ weave.Msg = (*DeleteAccountMsg)(nil) func (DeleteAccountMsg) Path() string { - return "blueaccount/deleteaccountmsg" + return "blueaccount/delete_account_msg" } func (msg *DeleteAccountMsg) Validate() error { From e4b813b327f7440c84021b5d86c64668c31d74fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 09:35:00 +0100 Subject: [PATCH 06/16] improve protobuf comments --- cmd/bnsd/x/blueaccount/codec.pb.go | 11 ++++------- cmd/bnsd/x/blueaccount/codec.proto | 9 +++------ docs/proto/index.html | 11 ++++------- spec/gogo/cmd/bnsd/x/blueaccount/codec.proto | 11 ++++------- spec/proto/cmd/bnsd/x/blueaccount/codec.proto | 11 ++++------- 5 files changed, 19 insertions(+), 34 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/codec.pb.go b/cmd/bnsd/x/blueaccount/codec.pb.go index 3dad3772..16c48f6c 100644 --- a/cmd/bnsd/x/blueaccount/codec.pb.go +++ b/cmd/bnsd/x/blueaccount/codec.pb.go @@ -121,12 +121,9 @@ type Account struct { Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // Owner is a weave.Address that controls this account. Can be empty. // - // An account is always owned by the domain owner and as such, regardless - // the owner field value, can be edited by the domain owner that this account - // belongs to. - // Setting the owner attribute to an address different than the domain owner - // extends the domain owner permission and allows to manage a single account - // to someone else than the domain owner. + // An account is always owned by the domain owner. In addition, ownership can + // be assigned to one more address to share ownership and allow another party + // to manage selected account. Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` Targets []BlockchainAddress `protobuf:"bytes,5,rep,name=targets,proto3" json:"targets"` } @@ -210,7 +207,7 @@ type BlockchainAddress struct { // chain that this token instance links to. Because we do not know the rules // to validate an address for any blockchain ID, this is an arbitrary bulk of // data. - // It is more convinient to always use encoded representation of each address + // It is more convenient to always use encoded representation of each address // and store it as a string. Using bytes while compact is not as comfortable // to use. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` diff --git a/cmd/bnsd/x/blueaccount/codec.proto b/cmd/bnsd/x/blueaccount/codec.proto index 18fd697b..5c4d5c9b 100644 --- a/cmd/bnsd/x/blueaccount/codec.proto +++ b/cmd/bnsd/x/blueaccount/codec.proto @@ -41,12 +41,9 @@ message Account { string name = 3; // Owner is a weave.Address that controls this account. Can be empty. // - // An account is always owned by the domain owner and as such, regardless - // the owner field value, can be edited by the domain owner that this account - // belongs to. - // Setting the owner attribute to an address different than the domain owner - // extends the domain owner permission and allows to manage a single account - // to someone else than the domain owner. + // An account is always owned by the domain owner. In addition, ownership can + // be assigned to one more address to share ownership and allow another party + // to manage selected account. bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; } diff --git a/docs/proto/index.html b/docs/proto/index.html index fdc1092a..42dbcd7b 100644 --- a/docs/proto/index.html +++ b/docs/proto/index.html @@ -1914,12 +1914,9 @@

    Account

    Owner is a weave.Address that controls this account. Can be empty. -An account is always owned by the domain owner and as such, regardless -the owner field value, can be edited by the domain owner that this account -belongs to. -Setting the owner attribute to an address different than the domain owner -extends the domain owner permission and allows to manage a single account -to someone else than the domain owner.

    +An account is always owned by the domain owner. In addition, ownership can +be assigned to one more address to share ownership and allow another party +to manage selected account.

    @@ -1961,7 +1958,7 @@

    BlockchainAddress

    chain that this token instance links to. Because we do not know the rules to validate an address for any blockchain ID, this is an arbitrary bulk of data. -It is more convinient to always use encoded representation of each address +It is more convenient to always use encoded representation of each address and store it as a string. Using bytes while compact is not as comfortable to use.

    diff --git a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto index a41d7b42..5c4d5c9b 100644 --- a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto @@ -41,12 +41,9 @@ message Account { string name = 3; // Owner is a weave.Address that controls this account. Can be empty. // - // An account is always owned by the domain owner and as such, regardless - // the owner field value, can be edited by the domain owner that this account - // belongs to. - // Setting the owner attribute to an address different than the domain owner - // extends the domain owner permission and allows to manage a single account - // to someone else than the domain owner. + // An account is always owned by the domain owner. In addition, ownership can + // be assigned to one more address to share ownership and allow another party + // to manage selected account. bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; } @@ -62,7 +59,7 @@ message BlockchainAddress { // chain that this token instance links to. Because we do not know the rules // to validate an address for any blockchain ID, this is an arbitrary bulk of // data. - // It is more convinient to always use encoded representation of each address + // It is more convenient to always use encoded representation of each address // and store it as a string. Using bytes while compact is not as comfortable // to use. string address = 2; diff --git a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto index c60dd763..06a501ab 100644 --- a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto @@ -40,12 +40,9 @@ message Account { string name = 3; // Owner is a weave.Address that controls this account. Can be empty. // - // An account is always owned by the domain owner and as such, regardless - // the owner field value, can be edited by the domain owner that this account - // belongs to. - // Setting the owner attribute to an address different than the domain owner - // extends the domain owner permission and allows to manage a single account - // to someone else than the domain owner. + // An account is always owned by the domain owner. In addition, ownership can + // be assigned to one more address to share ownership and allow another party + // to manage selected account. bytes owner = 4 ; repeated BlockchainAddress targets = 5 ; } @@ -61,7 +58,7 @@ message BlockchainAddress { // chain that this token instance links to. Because we do not know the rules // to validate an address for any blockchain ID, this is an arbitrary bulk of // data. - // It is more convinient to always use encoded representation of each address + // It is more convenient to always use encoded representation of each address // and store it as a string. Using bytes while compact is not as comfortable // to use. string address = 2; From 8751eabd9619861f28e1e31dfdfd7f4e004b5e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 11:50:23 +0100 Subject: [PATCH 07/16] fix race condition Database cannot be accessed while an iterator is in use. --- cmd/bnsd/x/blueaccount/handler.go | 22 ++++++---------------- cmd/bnsd/x/blueaccount/model.go | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index 8e2301fc..7f4e2bfd 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -261,23 +261,13 @@ func (h *deleteDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx wea } // This might be an expensive operation. - it, err := DomainAccounts(db, msg.Domain) + accountKeys, err := itemKeys(DomainAccounts(db, msg.Domain)) if err != nil { - return nil, errors.Wrap(err, "cannot get domain account iterator") - } - defer it.Release() - -deleteAccounts: - for { - switch key, _, err := it.Next(); { - case errors.ErrIteratorDone.Is(err): - break deleteAccounts - case err == nil: - if err := db.Delete(key); err != nil { - return nil, errors.Wrap(err, "cannot delete account") - } - default: - return nil, errors.Wrap(err, "account interator failed") + return nil, errors.Wrap(err, "cannot list accounts") + } + for _, key := range accountKeys { + if err := db.Delete(key); err != nil { + return nil, errors.Wrap(err, "cannot delete account") } } return &weave.DeliverResult{Data: nil}, nil diff --git a/cmd/bnsd/x/blueaccount/model.go b/cmd/bnsd/x/blueaccount/model.go index b4f92c2c..edcd0cfe 100644 --- a/cmd/bnsd/x/blueaccount/model.go +++ b/cmd/bnsd/x/blueaccount/model.go @@ -75,6 +75,31 @@ func DomainAccounts(db weave.ReadOnlyKVStore, domain string) (weave.Iterator, er return db.Iterator(start, end) } +// itemKeys returns list all item keys that give iterator represents. +// +// This function consumes and releases given iterator, collecting all keys it +// returns. This functionality is helpful when the intention is to access +// database for every key. Because iterator is using gorutines to read data, +// accessing database while reading an iterator will cause a data race. +func itemKeys(it weave.Iterator, err error) ([][]byte, error) { + if err != nil { + return nil, err + } + defer it.Release() + + var keys [][]byte + for { + switch k, _, err := it.Next(); { + case err == nil: + keys = append(keys, k) + case errors.ErrIteratorDone.Is(err): + return keys, nil + default: + return keys, err + } + } +} + func (ba *BlockchainAddress) Validate() error { if !validBlockchainID(ba.BlockchainID) { return errors.Wrap(errors.ErrInput, "invalid blockchain ID") From 16d40f79d2e98cfa62a67cb5c1cfd3fc8c96719a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 12:00:59 +0100 Subject: [PATCH 08/16] lol typo --- cmd/bnsd/x/blueaccount/codec.pb.go | 110 +++++++++--------- cmd/bnsd/x/blueaccount/codec.proto | 4 +- cmd/bnsd/x/blueaccount/handler.go | 24 ++-- cmd/bnsd/x/blueaccount/handler_test.go | 8 +- cmd/bnsd/x/blueaccount/model.go | 2 +- docs/proto/index.html | 4 +- spec/gogo/cmd/bnsd/x/blueaccount/codec.proto | 4 +- spec/proto/cmd/bnsd/x/blueaccount/codec.proto | 4 +- 8 files changed, 80 insertions(+), 80 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/codec.pb.go b/cmd/bnsd/x/blueaccount/codec.pb.go index 16c48f6c..4ad7b626 100644 --- a/cmd/bnsd/x/blueaccount/codec.pb.go +++ b/cmd/bnsd/x/blueaccount/codec.pb.go @@ -40,10 +40,10 @@ type Domain struct { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. Owner github_com_iov_one_weave.Address `protobuf:"bytes,3,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` - // Valid untill defines the expiration date for the domain. Expired domain + // Valid until defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - ValidUntill github_com_iov_one_weave.UnixTime `protobuf:"varint,4,opt,name=valid_untill,json=validUntill,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"valid_untill,omitempty"` + ValidUntil github_com_iov_one_weave.UnixTime `protobuf:"varint,4,opt,name=valid_until,json=validUntil,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"valid_until,omitempty"` } func (m *Domain) Reset() { *m = Domain{} } @@ -100,9 +100,9 @@ func (m *Domain) GetOwner() github_com_iov_one_weave.Address { return nil } -func (m *Domain) GetValidUntill() github_com_iov_one_weave.UnixTime { +func (m *Domain) GetValidUntil() github_com_iov_one_weave.UnixTime { if m != nil { - return m.ValidUntill + return m.ValidUntil } return 0 } @@ -984,50 +984,50 @@ func init() { func init() { proto.RegisterFile("cmd/bnsd/x/blueaccount/codec.proto", fileDescriptor_df2ac0ab2dae2b1e) } var fileDescriptor_df2ac0ab2dae2b1e = []byte{ - // 676 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6b, 0x13, 0x41, - 0x14, 0xcf, 0x24, 0x69, 0xda, 0xbc, 0x4d, 0x6d, 0xbb, 0x48, 0x59, 0x0a, 0x6e, 0xd2, 0xc5, 0x42, - 0x44, 0xcc, 0x4a, 0xc5, 0x8b, 0x07, 0xa1, 0x31, 0x82, 0x05, 0xab, 0xb0, 0xa4, 0x5e, 0xc3, 0x64, - 0xf7, 0x75, 0xbb, 0x74, 0x33, 0x13, 0x76, 0x27, 0xdd, 0x7e, 0x04, 0x0f, 0x1e, 0xbc, 0xfb, 0x25, - 0xbc, 0x09, 0x7e, 0x82, 0x1e, 0x0b, 0x5e, 0x3c, 0x05, 0x49, 0xbf, 0x45, 0x4f, 0x92, 0x99, 0x4d, - 0x93, 0x18, 0x2a, 0xa4, 0x86, 0xe2, 0x6d, 0xf6, 0xed, 0xfb, 0xcd, 0xbe, 0xdf, 0x9f, 0x19, 0x16, - 0x2c, 0xb7, 0xe3, 0xd9, 0x6d, 0x16, 0x7b, 0xf6, 0x99, 0xdd, 0x0e, 0x7b, 0x48, 0x5d, 0x97, 0xf7, - 0x98, 0xb0, 0x5d, 0xee, 0xa1, 0x5b, 0xeb, 0x46, 0x5c, 0x70, 0x5d, 0x9b, 0x78, 0xb1, 0xa5, 0x4d, - 0xbc, 0xd9, 0xba, 0xef, 0x73, 0x9f, 0xcb, 0xa5, 0x3d, 0x5c, 0xa9, 0xaa, 0xf5, 0x83, 0x40, 0xa1, - 0xc1, 0x3b, 0x34, 0x60, 0xfa, 0x63, 0x58, 0xe9, 0xa0, 0xa0, 0x1e, 0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 0xdd, 0x7a, 0xf2, 0x9b, 0x8e, 0xe3, 0x1e, 0x14, - 0x19, 0x26, 0xad, 0xf9, 0x6f, 0x9a, 0x15, 0x86, 0xc9, 0xfb, 0x21, 0xca, 0x3a, 0x83, 0x7b, 0xd2, - 0xd9, 0x05, 0x4f, 0xf6, 0xa7, 0x2e, 0xb9, 0x59, 0x5d, 0x3e, 0xc0, 0x5a, 0x03, 0x43, 0x14, 0xb8, - 0xd8, 0x4f, 0x5b, 0x9f, 0xb2, 0xa0, 0x8f, 0x92, 0x92, 0x5e, 0x7e, 0x0b, 0xa3, 0xf5, 0x9f, 0xdd, - 0x7f, 0x33, 0x32, 0x17, 0x66, 0x65, 0xfe, 0x4a, 0x40, 0x1f, 0xc5, 0xef, 0x2e, 0xe4, 0x98, 0xca, - 0x64, 0xfe, 0x56, 0x99, 0xfc, 0x4e, 0xc0, 0x70, 0xb0, 0x1b, 0x52, 0x17, 0xd3, 0x89, 0x9b, 0x8a, - 0xef, 0xc2, 0x07, 0xcf, 0x4f, 0x0c, 0xfe, 0x1a, 0xb4, 0xe1, 0xe0, 0xb7, 0xf1, 0x03, 0x18, 0x26, - 0xe9, 0x88, 0xd6, 0x09, 0xac, 0xab, 0x58, 0xdf, 0x81, 0xd8, 0x75, 0xe3, 0x7c, 0x60, 0x92, 0x8b, - 0x81, 0x49, 0x7e, 0x0d, 0x4c, 0xf2, 0xf9, 0xd2, 0xcc, 0x5c, 0x5c, 0x9a, 0x99, 0x9f, 0x97, 0x66, - 0xa6, 0x5d, 0x90, 0xff, 0x35, 0xcf, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xae, 0x80, 0x0a, 0xab, - 0x2d, 0x09, 0x00, 0x00, + // 677 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x5f, 0x6b, 0xd3, 0x50, + 0x14, 0xef, 0x6d, 0xb3, 0x6e, 0x3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0xda, 0x86, 0xb2, 0x4c, 0x42, 0x66, 0x87, 0x14, 0x5e, 0xa6, 0x23, 0x4b, 0xeb, 0x03, 0x90, 0x96, + 0xb7, 0x53, 0x67, 0x94, 0xb4, 0xa1, 0x94, 0x56, 0xde, 0x25, 0xf6, 0xbc, 0x85, 0xb2, 0xc4, 0xb6, + 0x43, 0x64, 0x18, 0xeb, 0xc5, 0x34, 0x4c, 0x8f, 0xae, 0x06, 0x95, 0x9d, 0xbf, 0x86, 0xa9, 0x99, + 0x71, 0xb5, 0x55, 0x09, 0xb7, 0x13, 0xb4, 0x19, 0xc3, 0xe6, 0x61, 0xcf, 0xa5, 0x02, 0xa7, 0xf4, + 0x38, 0x88, 0xbc, 0xf9, 0x24, 0x79, 0x0a, 0x4b, 0x3d, 0x2a, 0x9c, 0xe3, 0x54, 0x12, 0x75, 0x77, + 0x6b, 0xca, 0xf5, 0xa9, 0xad, 0x6d, 0xd9, 0x68, 0x7e, 0x23, 0xb0, 0x61, 0xa3, 0xe7, 0x47, 0x02, + 0x43, 0x49, 0x7c, 0xee, 0x8f, 0xfe, 0x8b, 0x0f, 0xe3, 0x03, 0x51, 0x98, 0x3a, 0x10, 0xdb, 0x50, + 0x76, 0x02, 0x1f, 0x99, 0x68, 0x0b, 0x7e, 0x82, 0x4c, 0x9e, 0x01, 0x5b, 0x95, 0xb5, 0x56, 0x52, + 0x32, 0xbf, 0x10, 0xd8, 0x68, 0x85, 0x94, 0x45, 0x47, 0xb7, 0x9e, 0xfc, 0xa6, 0xe3, 0xb8, 0x07, + 0x25, 0x86, 0x71, 0x7b, 0xfe, 0x7b, 0x66, 0x85, 0x61, 0xfc, 0x3e, 0x41, 0x99, 0x67, 0x70, 0x2f, + 0x75, 0x76, 0xc1, 0x93, 0xfd, 0xa9, 0x4b, 0x61, 0x56, 0x97, 0x0f, 0xb0, 0xd6, 0xc4, 0x00, 0x05, + 0x2e, 0xf6, 0xd3, 0xe6, 0xa7, 0x3c, 0x68, 0xa3, 0xa4, 0x64, 0x97, 0xdf, 0xc2, 0x68, 0xfd, 0x67, + 0xf7, 0xdf, 0x8c, 0xcc, 0xc5, 0x59, 0x99, 0xbf, 0x12, 0xd0, 0x46, 0xf1, 0xbb, 0x0b, 0x39, 0xa6, + 0x32, 0xa9, 0xdc, 0x2a, 0x93, 0xdf, 0x09, 0xe8, 0x36, 0xf6, 0x02, 0xea, 0x60, 0x36, 0x71, 0x4b, + 0xf2, 0x5d, 0xf8, 0xe0, 0xca, 0xc4, 0xe0, 0xaf, 0x41, 0x4d, 0x06, 0xbf, 0x8d, 0x1f, 0xc0, 0x30, + 0xce, 0x46, 0x34, 0x4f, 0x60, 0x5d, 0xc6, 0xfa, 0x0e, 0xc4, 0x6e, 0xe8, 0xe7, 0x43, 0x83, 0x5c, + 0x0c, 0x0d, 0xf2, 0x6b, 0x68, 0x90, 0xcf, 0x97, 0x46, 0xee, 0xe2, 0xd2, 0xc8, 0xfd, 0xbc, 0x34, + 0x72, 0x9d, 0x62, 0xfa, 0x57, 0xf3, 0xec, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0x4b, 0xc0, + 0x21, 0x2b, 0x09, 0x00, 0x00, } func (m *Domain) Marshal() (dAtA []byte, err error) { @@ -1067,10 +1067,10 @@ func (m *Domain) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintCodec(dAtA, i, uint64(len(m.Owner))) i += copy(dAtA[i:], m.Owner) } - if m.ValidUntill != 0 { + if m.ValidUntil != 0 { dAtA[i] = 0x20 i++ - i = encodeVarintCodec(dAtA, i, uint64(m.ValidUntill)) + i = encodeVarintCodec(dAtA, i, uint64(m.ValidUntil)) } return i, nil } @@ -1641,8 +1641,8 @@ func (m *Domain) Size() (n int) { if l > 0 { n += 1 + l + sovCodec(uint64(l)) } - if m.ValidUntill != 0 { - n += 1 + sovCodec(uint64(m.ValidUntill)) + if m.ValidUntil != 0 { + n += 1 + sovCodec(uint64(m.ValidUntil)) } return n } @@ -2078,9 +2078,9 @@ func (m *Domain) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidUntill", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidUntil", wireType) } - m.ValidUntill = 0 + m.ValidUntil = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCodec @@ -2090,7 +2090,7 @@ func (m *Domain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidUntill |= github_com_iov_one_weave.UnixTime(b&0x7F) << shift + m.ValidUntil |= github_com_iov_one_weave.UnixTime(b&0x7F) << shift if b < 0x80 { break } diff --git a/cmd/bnsd/x/blueaccount/codec.proto b/cmd/bnsd/x/blueaccount/codec.proto index 5c4d5c9b..91b743b3 100644 --- a/cmd/bnsd/x/blueaccount/codec.proto +++ b/cmd/bnsd/x/blueaccount/codec.proto @@ -21,10 +21,10 @@ message Domain { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. bytes owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; - // Valid untill defines the expiration date for the domain. Expired domain + // Valid until defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - int64 valid_untill = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; + int64 valid_until = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; } // Account represents a blue account name. diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index 7f4e2bfd..d54af038 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -97,10 +97,10 @@ func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w return nil, errors.Wrap(err, "cannot load configuration") } domain := Domain{ - Metadata: &weave.Metadata{}, - Owner: owner, - Domain: msg.Domain, - ValidUntill: weave.AsUnixTime(now.Add(conf.DomainRenew.Duration())), + Metadata: &weave.Metadata{}, + Owner: owner, + Domain: msg.Domain, + ValidUntil: weave.AsUnixTime(now.Add(conf.DomainRenew.Duration())), } if _, err := h.domains.Put(db, []byte(msg.Domain), &domain); err != nil { return nil, errors.Wrap(err, "cannot store domain entity") @@ -182,7 +182,7 @@ func (h *transferDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx if !h.auth.HasAddress(ctx, domain.Owner) { return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only owner can transfer a domain") } - if weave.IsExpired(ctx, domain.ValidUntill) { + if weave.IsExpired(ctx, domain.ValidUntil) { return nil, nil, errors.Wrap(errors.ErrExpired, "expired domain cannot be transferred") } return &domain, &msg, nil @@ -214,12 +214,12 @@ func (h *renewDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weav if err != nil { return nil, errors.Wrap(err, "cannot load configuration") } - nextValidUntill := now.Add(conf.DomainRenew.Duration()) - // ValidUntill time is only extended. We want to avoid the situation when + nextValidUntil := now.Add(conf.DomainRenew.Duration()) + // ValidUntil time is only extended. We want to avoid the situation when // the configuration is changed, limiting the expiration time period // and renewing a domain by shortening its expiration date. - if nextValidUntill.After(domain.ValidUntill.Time()) { - domain.ValidUntill = weave.AsUnixTime(nextValidUntill) + if nextValidUntil.After(domain.ValidUntil.Time()) { + domain.ValidUntil = weave.AsUnixTime(nextValidUntil) if _, err := h.domains.Put(db, []byte(msg.Domain), domain); err != nil { return nil, errors.Wrap(err, "cannot store domain") } @@ -332,7 +332,7 @@ func (h *registerAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx if !h.auth.HasAddress(ctx, domain.Owner) { return nil, nil, errors.Wrap(errors.ErrUnauthorized, "only domain owner can register an account") } - if weave.IsExpired(ctx, domain.ValidUntill) { + if weave.IsExpired(ctx, domain.ValidUntil) { return nil, nil, errors.Wrap(errors.ErrExpired, "domain is expired") } switch err := h.accounts.Has(db, accountKey(msg.Name, msg.Domain)); { @@ -393,7 +393,7 @@ func (h *transferAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { return nil, nil, nil, errors.Wrap(err, "cannot get domain") } - if weave.IsExpired(ctx, domain.ValidUntill) { + if weave.IsExpired(ctx, domain.ValidUntil) { return nil, nil, nil, errors.Wrap(errors.ErrExpired, "cannot transfer account in an expired domain") } var account Account @@ -445,7 +445,7 @@ func (h *replaceAccountTargetHandler) validate(ctx weave.Context, db weave.KVSto if err := h.domains.One(db, []byte(msg.Domain), &domain); err != nil { return nil, nil, errors.Wrap(err, "cannot get domain") } - if weave.IsExpired(ctx, domain.ValidUntill) { + if weave.IsExpired(ctx, domain.ValidUntil) { return nil, nil, errors.Wrap(errors.ErrExpired, "cannot update account in an expired domain") } var account Account diff --git a/cmd/bnsd/x/blueaccount/handler_test.go b/cmd/bnsd/x/blueaccount/handler_test.go index bcf0d36c..1b922ebe 100644 --- a/cmd/bnsd/x/blueaccount/handler_test.go +++ b/cmd/bnsd/x/blueaccount/handler_test.go @@ -107,7 +107,7 @@ func TestUseCases(t *testing.T) { if !d.Owner.Equals(aliceCond.Address()) { t.Fatalf("unexpected wunderland owner: want %q, got %q", aliceCond.Address(), d.Owner) } - if got, want := d.ValidUntill, weave.UnixTime(now+1000); got != want { + if got, want := d.ValidUntil, weave.UnixTime(now+1000); got != want { t.Fatalf("unexpected valid till: want %d, got %d", want, got) } }, @@ -140,7 +140,7 @@ func TestUseCases(t *testing.T) { if !d.Owner.Equals(bobCond.Address()) { t.Fatalf("unexpected wunderland owner: want %q, got %q", bobCond.Address(), d.Owner) } - if got, want := d.ValidUntill, weave.UnixTime(now+1000); got != want { + if got, want := d.ValidUntil, weave.UnixTime(now+1000); got != want { t.Fatalf("unexpected valid till: want %d, got %d", want, got) } }, @@ -366,7 +366,7 @@ func TestUseCases(t *testing.T) { // Expiration time should be execution time // (block time) which is now + 2, plus // expiration offset. - if got, want := d.ValidUntill, weave.UnixTime(now+2+1000); want != got { + if got, want := d.ValidUntil, weave.UnixTime(now+2+1000); want != got { t.Fatalf("want valid till %s, got %s", want, got) } }, @@ -422,7 +422,7 @@ func TestUseCases(t *testing.T) { } // Expiration time should not be updated // because it would be shortened. - if got, want := d.ValidUntill, weave.UnixTime(now+1000); want != got { + if got, want := d.ValidUntil, weave.UnixTime(now+1000); want != got { t.Logf("want %d %s", want, want) t.Logf(" got %d %s", got, got) t.Fatal("unexpected valid till") diff --git a/cmd/bnsd/x/blueaccount/model.go b/cmd/bnsd/x/blueaccount/model.go index edcd0cfe..6f091c97 100644 --- a/cmd/bnsd/x/blueaccount/model.go +++ b/cmd/bnsd/x/blueaccount/model.go @@ -52,7 +52,7 @@ func (d *Domain) Validate() error { errs = errors.AppendField(errs, "Metadata", d.Metadata.Validate()) errs = errors.AppendField(errs, "Domain", validateDomain(d.Domain)) errs = errors.AppendField(errs, "Owner", d.Owner.Validate()) - errs = errors.AppendField(errs, "ValidUntill", d.ValidUntill.Validate()) + errs = errors.AppendField(errs, "ValidUntil", d.ValidUntil.Validate()) return errs } diff --git a/docs/proto/index.html b/docs/proto/index.html index 42dbcd7b..9d3efae2 100644 --- a/docs/proto/index.html +++ b/docs/proto/index.html @@ -2124,10 +2124,10 @@

    Domain

    - valid_untill + valid_until int64 -

    Valid untill defines the expiration date for the domain. Expired domain +

    Valid until defines the expiration date for the domain. Expired domain cannot be used or modified. None of the accounts that belong to an expired domain can be used of modified as well.

    diff --git a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto index 5c4d5c9b..91b743b3 100644 --- a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto @@ -21,10 +21,10 @@ message Domain { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. bytes owner = 3 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; - // Valid untill defines the expiration date for the domain. Expired domain + // Valid until defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - int64 valid_untill = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; + int64 valid_until = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.UnixTime"]; } // Account represents a blue account name. diff --git a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto index 06a501ab..c97dca44 100644 --- a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto @@ -20,10 +20,10 @@ message Domain { // Owner is a weave.Address that controls this domain and all accounts that // belong to this domain. bytes owner = 3 ; - // Valid untill defines the expiration date for the domain. Expired domain + // Valid until defines the expiration date for the domain. Expired domain // cannot be used or modified. None of the accounts that belong to an expired // domain can be used of modified as well. - int64 valid_untill = 4 ; + int64 valid_until = 4 ; } // Account represents a blue account name. From 309541509d73eb5b564f55703a9d0eba54eb39b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 12:11:50 +0100 Subject: [PATCH 09/16] return configuration from the validate method --- cmd/bnsd/x/blueaccount/handler.go | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index d54af038..21f7475b 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -71,14 +71,14 @@ type registerDomaiHandler struct { } func (h *registerDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { - if _, err := h.validate(ctx, db, tx); err != nil { + if _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { - msg, err := h.validate(ctx, db, tx) + conf, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err } @@ -92,10 +92,6 @@ func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w if err != nil { return nil, errors.Wrap(errors.ErrState, "block time not present in context") } - conf, err := loadConf(db) - if err != nil { - return nil, errors.Wrap(err, "cannot load configuration") - } domain := Domain{ Metadata: &weave.Metadata{}, Owner: owner, @@ -121,29 +117,29 @@ func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w return &weave.DeliverResult{Data: nil}, nil } -func (h *registerDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*RegisterDomainMsg, error) { +func (h *registerDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Configuration, *RegisterDomainMsg, error) { var msg RegisterDomainMsg if err := weave.LoadMsg(tx, &msg); err != nil { - return nil, errors.Wrap(err, "load msg") + return nil, nil, errors.Wrap(err, "load msg") } switch err := h.domains.Has(db, []byte(msg.Domain)); { case err == nil: - return nil, errors.Wrapf(errors.ErrDuplicate, "domain %q already registered", msg.Domain) + return nil, nil, errors.Wrapf(errors.ErrDuplicate, "domain %q already registered", msg.Domain) case errors.ErrNotFound.Is(err): // All good. default: - return nil, errors.Wrap(err, "cannot check if domain already exists") + return nil, nil, errors.Wrap(err, "cannot check if domain already exists") } conf, err := loadConf(db) if err != nil { - return nil, errors.Wrap(err, "cannot load configuration") + return nil, nil, errors.Wrap(err, "cannot load configuration") } if ok, err := regexp.MatchString(conf.ValidDomain, msg.Domain); err != nil || !ok { - return nil, errors.Wrap(errors.ErrInput, "domain is not allowed") + return nil, nil, errors.Wrap(errors.ErrInput, "domain is not allowed") } - return &msg, nil + return conf, &msg, nil } type transferDomaiHandler struct { From 13fba2e8b08ef54d141760a5e0d735379984b007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 12:26:32 +0100 Subject: [PATCH 10/16] rename client token to third party token --- .../clitests/blue_register_account.test | 4 +- .../clitests/blue_register_account.test.gold | 4 +- cmd/bnscli/clitests/blue_register_domain.test | 2 +- .../clitests/blue_register_domain.test.gold | 2 +- cmd/bnscli/cmd_blueaccount.go | 24 +-- cmd/bnsd/x/blueaccount/codec.pb.go | 164 +++++++++--------- cmd/bnsd/x/blueaccount/codec.proto | 14 +- cmd/bnsd/x/blueaccount/msg.go | 10 +- docs/proto/index.html | 20 +-- spec/gogo/cmd/bnsd/x/blueaccount/codec.proto | 14 +- spec/proto/cmd/bnsd/x/blueaccount/codec.proto | 14 +- 11 files changed, 136 insertions(+), 136 deletions(-) diff --git a/cmd/bnscli/clitests/blue_register_account.test b/cmd/bnscli/clitests/blue_register_account.test index a97205ac..26f2512e 100644 --- a/cmd/bnscli/clitests/blue_register_account.test +++ b/cmd/bnscli/clitests/blue_register_account.test @@ -12,7 +12,7 @@ echo '' bnscli blue-register-account \ -domain wunderland \ -name alice \ - -client-token "68656c6c6f20776f726c640a" \ + -token "68656c6c6f20776f726c640a" \ | bnscli view echo '' @@ -20,7 +20,7 @@ echo '' bnscli blue-register-account \ -domain wunderland \ -name alice \ - -client-token "68656c6c6f20776f726c640a" \ + -token "68656c6c6f20776f726c640a" \ | bnscli blue-with-bc-address -addr 111 -bc first \ | bnscli blue-with-bc-address -addr 222 -bc second \ | bnscli view diff --git a/cmd/bnscli/clitests/blue_register_account.test.gold b/cmd/bnscli/clitests/blue_register_account.test.gold index 06dfcd0e..4eec480b 100644 --- a/cmd/bnscli/clitests/blue_register_account.test.gold +++ b/cmd/bnscli/clitests/blue_register_account.test.gold @@ -19,7 +19,7 @@ "domain": "wunderland", "name": "alice", "targets": null, - "client_token": "aGVsbG8gd29ybGQK" + "third_party_token": "aGVsbG8gd29ybGQK" } } } @@ -41,7 +41,7 @@ "address": "222" } ], - "client_token": "aGVsbG8gd29ybGQK" + "third_party_token": "aGVsbG8gd29ybGQK" } } } \ No newline at end of file diff --git a/cmd/bnscli/clitests/blue_register_domain.test b/cmd/bnscli/clitests/blue_register_domain.test index 499baedf..1d832a34 100644 --- a/cmd/bnscli/clitests/blue_register_domain.test +++ b/cmd/bnscli/clitests/blue_register_domain.test @@ -10,5 +10,5 @@ echo '' bnscli blue-register-domain \ -domain wunderland \ - -client-token "68656c6c6f20776f726c640a" \ + -token "68656c6c6f20776f726c640a" \ | bnscli view diff --git a/cmd/bnscli/clitests/blue_register_domain.test.gold b/cmd/bnscli/clitests/blue_register_domain.test.gold index 5d131e64..b8501557 100644 --- a/cmd/bnscli/clitests/blue_register_domain.test.gold +++ b/cmd/bnscli/clitests/blue_register_domain.test.gold @@ -15,7 +15,7 @@ "schema": 1 }, "domain": "wunderland", - "client_token": "aGVsbG8gd29ybGQK" + "third_party_token": "aGVsbG8gd29ybGQK" } } } \ No newline at end of file diff --git a/cmd/bnscli/cmd_blueaccount.go b/cmd/bnscli/cmd_blueaccount.go index 8b1f0211..15ced278 100644 --- a/cmd/bnscli/cmd_blueaccount.go +++ b/cmd/bnscli/cmd_blueaccount.go @@ -19,15 +19,15 @@ Create a transaction for registering a domain. fl.PrintDefaults() } var ( - domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") - clientTokenFl = flHex(fl, "client-token", "", "Optional, hex encoded client token.") + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + tokenFl = flHex(fl, "token", "", "Optional, hex encoded third party token.") ) fl.Parse(args) msg := blueaccount.RegisterDomainMsg{ - Metadata: &weave.Metadata{Schema: 1}, - Domain: *domainFl, - ClientToken: *clientTokenFl, + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + ThirdPartyToken: *tokenFl, } if err := msg.Validate(); err != nil { return fmt.Errorf("given data produce an invalid message: %s", err) @@ -79,17 +79,17 @@ Create a transaction for registering an account. fl.PrintDefaults() } var ( - domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") - nameFl = fl.String("name", "", "Name part of the username. For example alice in 'alice*wunderland'") - clientTokenFl = flHex(fl, "client-token", "", "Optional, hex encoded client token.") + domainFl = fl.String("domain", "", "Domain part of the username. For example wunderland in 'alice*wunderland'") + nameFl = fl.String("name", "", "Name part of the username. For example alice in 'alice*wunderland'") + tokenFl = flHex(fl, "token", "", "Optional, hex encoded third party token.") ) fl.Parse(args) msg := blueaccount.RegisterAccountMsg{ - Metadata: &weave.Metadata{Schema: 1}, - Domain: *domainFl, - Name: *nameFl, - ClientToken: *clientTokenFl, + Metadata: &weave.Metadata{Schema: 1}, + Domain: *domainFl, + Name: *nameFl, + ThirdPartyToken: *tokenFl, } if err := msg.Validate(); err != nil { return fmt.Errorf("given data produce an invalid message: %s", err) diff --git a/cmd/bnsd/x/blueaccount/codec.pb.go b/cmd/bnsd/x/blueaccount/codec.pb.go index 4ad7b626..b4f7bd34 100644 --- a/cmd/bnsd/x/blueaccount/codec.pb.go +++ b/cmd/bnsd/x/blueaccount/codec.pb.go @@ -412,11 +412,11 @@ type RegisterDomainMsg struct { Owner github_com_iov_one_weave.Address `protobuf:"bytes,2,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` // Domain part of the account that should be registered. Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to register a domain. Storing a client token // helps identify contribution of such party later. - ClientToken []byte `protobuf:"bytes,4,opt,name=client_token,json=clientToken,proto3" json:"client_token,omitempty"` + ThirdPartyToken []byte `protobuf:"bytes,4,opt,name=third_party_token,json=thirdPartyToken,proto3" json:"third_party_token,omitempty"` } func (m *RegisterDomainMsg) Reset() { *m = RegisterDomainMsg{} } @@ -473,9 +473,9 @@ func (m *RegisterDomainMsg) GetDomain() string { return "" } -func (m *RegisterDomainMsg) GetClientToken() []byte { +func (m *RegisterDomainMsg) GetThirdPartyToken() []byte { if m != nil { - return m.ClientToken + return m.ThirdPartyToken } return nil } @@ -550,11 +550,11 @@ type RenewDomainMsg struct { Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Name of the domain that is transferred. Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - ClientToken []byte `protobuf:"bytes,3,opt,name=client_token,json=clientToken,proto3" json:"client_token,omitempty"` + ThirdPartyToken []byte `protobuf:"bytes,3,opt,name=third_party_token,json=thirdPartyToken,proto3" json:"third_party_token,omitempty"` } func (m *RenewDomainMsg) Reset() { *m = RenewDomainMsg{} } @@ -604,9 +604,9 @@ func (m *RenewDomainMsg) GetDomain() string { return "" } -func (m *RenewDomainMsg) GetClientToken() []byte { +func (m *RenewDomainMsg) GetThirdPartyToken() []byte { if m != nil { - return m.ClientToken + return m.ThirdPartyToken } return nil } @@ -676,13 +676,13 @@ type RegisterAccountMsg struct { Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // Owner holds the address of the newly registered account. Can be empty to // leave the administration to the domain owner only. - Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` - // Client token is an arbitrary data that can be provided by a middleman + Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"` + Targets []BlockchainAddress `protobuf:"bytes,5,rep,name=targets,proto3" json:"targets"` + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - Targets []BlockchainAddress `protobuf:"bytes,5,rep,name=targets,proto3" json:"targets"` - ClientToken []byte `protobuf:"bytes,6,opt,name=client_token,json=clientToken,proto3" json:"client_token,omitempty"` + ThirdPartyToken []byte `protobuf:"bytes,6,opt,name=third_party_token,json=thirdPartyToken,proto3" json:"third_party_token,omitempty"` } func (m *RegisterAccountMsg) Reset() { *m = RegisterAccountMsg{} } @@ -753,9 +753,9 @@ func (m *RegisterAccountMsg) GetTargets() []BlockchainAddress { return nil } -func (m *RegisterAccountMsg) GetClientToken() []byte { +func (m *RegisterAccountMsg) GetThirdPartyToken() []byte { if m != nil { - return m.ClientToken + return m.ThirdPartyToken } return nil } @@ -984,50 +984,50 @@ func init() { func init() { proto.RegisterFile("cmd/bnsd/x/blueaccount/codec.proto", fileDescriptor_df2ac0ab2dae2b1e) } var fileDescriptor_df2ac0ab2dae2b1e = []byte{ - // 677 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x5f, 0x6b, 0xd3, 0x50, - 0x14, 0xef, 0x6d, 0xb3, 0x6e, 0x3d, 0xe9, 0xdc, 0x16, 0x64, 0x84, 0x81, 0x69, 0x17, 0x1c, 0x54, - 0xc4, 0x46, 0x26, 0xbe, 0xf8, 0x20, 0xac, 0x56, 0x61, 0xe0, 0x14, 0x42, 0xe7, 0x6b, 0xb9, 0x4d, - 0xce, 0xb2, 0xb0, 0xf4, 0xde, 0x92, 0xdc, 0x2e, 0xfb, 0x08, 0x3e, 0xf8, 0xe0, 0xbb, 0x5f, 0xc2, - 0x37, 0xc1, 0x4f, 0xb0, 0xc7, 0xf9, 0xe6, 0x53, 0x91, 0xee, 0x5b, 0xec, 0x49, 0x92, 0x9b, 0xae, - 0xad, 0x65, 0x42, 0x67, 0x19, 0xbe, 0xdd, 0x9c, 0x9c, 0xdf, 0xcd, 0xf9, 0xfd, 0xb9, 0x97, 0x80, - 0xe9, 0x74, 0x5d, 0xab, 0xc3, 0x22, 0xd7, 0x3a, 0xb3, 0x3a, 0x41, 0x1f, 0xa9, 0xe3, 0xf0, 0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9d, 0x62, 0xfa, 0x57, 0xf3, 0xec, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0x4b, 0xc0, - 0x21, 0x2b, 0x09, 0x00, 0x00, + // 686 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xcf, 0x25, 0x6e, 0xda, 0x3c, 0xa7, 0xb4, 0xb1, 0x50, 0x65, 0x55, 0xc2, 0x49, 0x2d, 0x2a, + 0x05, 0x10, 0x31, 0x2a, 0x62, 0x61, 0x40, 0x6a, 0x08, 0x48, 0x95, 0x28, 0x20, 0x2b, 0x65, 0xb5, + 0x2e, 0xf6, 0xd5, 0xb1, 0x9a, 0xdc, 0x45, 0xf6, 0xa5, 0x2e, 0x23, 0x1b, 0x23, 0x0b, 0x13, 0x5f, + 0x82, 0x99, 0x89, 0xb1, 0x63, 0xd9, 0x98, 0x22, 0x94, 0x7e, 0x8b, 0x4e, 0xc8, 0x77, 0x4e, 0x93, + 0x88, 0x14, 0x29, 0x25, 0xaa, 0xd8, 0xce, 0xef, 0xde, 0xef, 0xf2, 0x7e, 0x7f, 0xee, 0x14, 0x30, + 0xdd, 0xae, 0x67, 0xb5, 0x68, 0xe4, 0x59, 0x27, 0x56, 0xab, 0xd3, 0x27, 0xd8, 0x75, 0x59, 0x9f, + 0x72, 0xcb, 0x65, 0x1e, 0x71, 0x6b, 0xbd, 0x90, 0x71, 0xa6, 0xa9, 0x13, 0x1b, 0x9b, 0xea, 0xc4, + 0xce, 0xe6, 0x6d, 0x9f, 0xf9, 0x4c, 0x2c, 0xad, 0x64, 0x25, 0xab, 0xe6, 0x0f, 0x04, 0xf9, 0x06, + 0xeb, 0xe2, 0x80, 0x6a, 0x0f, 0x60, 0xa5, 0x4b, 0x38, 0xf6, 0x30, 0xc7, 0x3a, 0xaa, 0xa0, 0xaa, + 0xba, 0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+ 0xbc, 0x36, 0x85, 0xab, 0xee, 0xe5, 0x2e, 0x14, 0x28, 0x89, 0x9d, 0xf9, 0x1f, 0x9c, 0x15, 0x4a, + 0xe2, 0x37, 0x09, 0xca, 0xfc, 0x80, 0xe0, 0x96, 0xf0, 0x78, 0xc1, 0xa3, 0xcd, 0x54, 0x28, 0x37, + 0x5b, 0xa1, 0x77, 0xb0, 0xd6, 0x20, 0x1d, 0xc2, 0xc9, 0x62, 0x67, 0x30, 0x3f, 0x67, 0x41, 0x1b, + 0x85, 0x27, 0x7d, 0x0f, 0x17, 0xc6, 0xef, 0x3f, 0x7b, 0x12, 0x67, 0xeb, 0x9d, 0x9f, 0xad, 0xf7, + 0x57, 0x04, 0xda, 0x28, 0x91, 0x37, 0xa1, 0xcb, 0x54, 0x4c, 0x95, 0x6b, 0xc5, 0xf4, 0x1b, 0x02, + 0xdd, 0x26, 0xbd, 0x0e, 0x76, 0x49, 0x3a, 0x71, 0x53, 0x12, 0x5f, 0xf8, 0xe0, 0xca, 0xc4, 0xe0, + 0x2f, 0x40, 0x4d, 0x06, 0xbf, 0x8e, 0x31, 0x40, 0x49, 0x9c, 0x8e, 0x68, 0x1e, 0xc1, 0xba, 0xcc, + 0xf7, 0x0d, 0x88, 0x5d, 0xd7, 0x4f, 0x87, 0x06, 0x3a, 0x1b, 0x1a, 0xe8, 0xd7, 0xd0, 0x40, 0x9f, + 0xce, 0x8d, 0xcc, 0xd9, 0xb9, 0x91, 0xf9, 0x79, 0x6e, 0x64, 0x5a, 0x79, 0xf1, 0x8f, 0xe7, 0xf1, + 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x4a, 0x9e, 0x2a, 0x47, 0x09, 0x00, 0x00, } func (m *Domain) Marshal() (dAtA []byte, err error) { @@ -1289,11 +1289,11 @@ func (m *RegisterDomainMsg) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) i += copy(dAtA[i:], m.Domain) } - if len(m.ClientToken) > 0 { + if len(m.ThirdPartyToken) > 0 { dAtA[i] = 0x22 i++ - i = encodeVarintCodec(dAtA, i, uint64(len(m.ClientToken))) - i += copy(dAtA[i:], m.ClientToken) + i = encodeVarintCodec(dAtA, i, uint64(len(m.ThirdPartyToken))) + i += copy(dAtA[i:], m.ThirdPartyToken) } return i, nil } @@ -1369,11 +1369,11 @@ func (m *RenewDomainMsg) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintCodec(dAtA, i, uint64(len(m.Domain))) i += copy(dAtA[i:], m.Domain) } - if len(m.ClientToken) > 0 { + if len(m.ThirdPartyToken) > 0 { dAtA[i] = 0x1a i++ - i = encodeVarintCodec(dAtA, i, uint64(len(m.ClientToken))) - i += copy(dAtA[i:], m.ClientToken) + i = encodeVarintCodec(dAtA, i, uint64(len(m.ThirdPartyToken))) + i += copy(dAtA[i:], m.ThirdPartyToken) } return i, nil } @@ -1467,11 +1467,11 @@ func (m *RegisterAccountMsg) MarshalTo(dAtA []byte) (int, error) { i += n } } - if len(m.ClientToken) > 0 { + if len(m.ThirdPartyToken) > 0 { dAtA[i] = 0x32 i++ - i = encodeVarintCodec(dAtA, i, uint64(len(m.ClientToken))) - i += copy(dAtA[i:], m.ClientToken) + i = encodeVarintCodec(dAtA, i, uint64(len(m.ThirdPartyToken))) + i += copy(dAtA[i:], m.ThirdPartyToken) } return i, nil } @@ -1758,7 +1758,7 @@ func (m *RegisterDomainMsg) Size() (n int) { if l > 0 { n += 1 + l + sovCodec(uint64(l)) } - l = len(m.ClientToken) + l = len(m.ThirdPartyToken) if l > 0 { n += 1 + l + sovCodec(uint64(l)) } @@ -1800,7 +1800,7 @@ func (m *RenewDomainMsg) Size() (n int) { if l > 0 { n += 1 + l + sovCodec(uint64(l)) } - l = len(m.ClientToken) + l = len(m.ThirdPartyToken) if l > 0 { n += 1 + l + sovCodec(uint64(l)) } @@ -1852,7 +1852,7 @@ func (m *RegisterAccountMsg) Size() (n int) { n += 1 + l + sovCodec(uint64(l)) } } - l = len(m.ClientToken) + l = len(m.ThirdPartyToken) if l > 0 { n += 1 + l + sovCodec(uint64(l)) } @@ -2921,7 +2921,7 @@ func (m *RegisterDomainMsg) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ThirdPartyToken", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -2948,9 +2948,9 @@ func (m *RegisterDomainMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientToken = append(m.ClientToken[:0], dAtA[iNdEx:postIndex]...) - if m.ClientToken == nil { - m.ClientToken = []byte{} + m.ThirdPartyToken = append(m.ThirdPartyToken[:0], dAtA[iNdEx:postIndex]...) + if m.ThirdPartyToken == nil { + m.ThirdPartyToken = []byte{} } iNdEx = postIndex default: @@ -3231,7 +3231,7 @@ func (m *RenewDomainMsg) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ThirdPartyToken", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3258,9 +3258,9 @@ func (m *RenewDomainMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientToken = append(m.ClientToken[:0], dAtA[iNdEx:postIndex]...) - if m.ClientToken == nil { - m.ClientToken = []byte{} + m.ThirdPartyToken = append(m.ThirdPartyToken[:0], dAtA[iNdEx:postIndex]...) + if m.ThirdPartyToken == nil { + m.ThirdPartyToken = []byte{} } iNdEx = postIndex default: @@ -3607,7 +3607,7 @@ func (m *RegisterAccountMsg) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ThirdPartyToken", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3634,9 +3634,9 @@ func (m *RegisterAccountMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientToken = append(m.ClientToken[:0], dAtA[iNdEx:postIndex]...) - if m.ClientToken == nil { - m.ClientToken = []byte{} + m.ThirdPartyToken = append(m.ThirdPartyToken[:0], dAtA[iNdEx:postIndex]...) + if m.ThirdPartyToken == nil { + m.ThirdPartyToken = []byte{} } iNdEx = postIndex default: diff --git a/cmd/bnsd/x/blueaccount/codec.proto b/cmd/bnsd/x/blueaccount/codec.proto index 91b743b3..cf0a37e4 100644 --- a/cmd/bnsd/x/blueaccount/codec.proto +++ b/cmd/bnsd/x/blueaccount/codec.proto @@ -102,11 +102,11 @@ message RegisterDomainMsg { bytes owner = 2 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; // Domain part of the account that should be registered. string domain = 3; - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to register a domain. Storing a client token // helps identify contribution of such party later. - bytes client_token = 4; + bytes third_party_token = 4; } // TransferDomainMsg is issuing an ownership transfer over specified domain. @@ -125,11 +125,11 @@ message RenewDomainMsg { weave.Metadata metadata = 1; // Name of the domain that is transferred. string domain = 2; - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - bytes client_token = 3; + bytes third_party_token = 3; } // DeleteDomainMsg issues deletion of a domain and all accounts that belong to @@ -151,12 +151,12 @@ message RegisterAccountMsg { // Owner holds the address of the newly registered account. Can be empty to // leave the administration to the domain owner only. bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; - // Client token is an arbitrary data that can be provided by a middleman + repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; - bytes client_token = 6; + bytes third_party_token = 6; } // TransferAccountMsg is issuing an ownership transfer over specified account. diff --git a/cmd/bnsd/x/blueaccount/msg.go b/cmd/bnsd/x/blueaccount/msg.go index 80189a26..acf9bc85 100644 --- a/cmd/bnsd/x/blueaccount/msg.go +++ b/cmd/bnsd/x/blueaccount/msg.go @@ -46,7 +46,7 @@ func (msg *RegisterDomainMsg) Validate() error { errs = errors.AppendField(errs, "Owner", msg.Owner.Validate()) } errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) - errs = errors.AppendField(errs, "ClientToken", validateClientToken(msg.ClientToken)) + errs = errors.AppendField(errs, "ThirdPartyToken", validateThirdPartyToken(msg.ThirdPartyToken)) return errs } @@ -74,7 +74,7 @@ func (msg *RenewDomainMsg) Validate() error { var errs error errs = errors.AppendField(errs, "Metadata", msg.Metadata.Validate()) errs = errors.AppendField(errs, "Domain", validateDomain(msg.Domain)) - errs = errors.AppendField(errs, "ClientToken", validateClientToken(msg.ClientToken)) + errs = errors.AppendField(errs, "ThirdPartyToken", validateThirdPartyToken(msg.ThirdPartyToken)) return errs } @@ -105,7 +105,7 @@ func (msg *RegisterAccountMsg) Validate() error { errs = errors.AppendField(errs, "Owner", msg.Owner.Validate()) } errs = errors.AppendField(errs, "Targets", validateTargets(msg.Targets)) - errs = errors.AppendField(errs, "ClientToken", validateClientToken(msg.ClientToken)) + errs = errors.AppendField(errs, "ThirdPartyToken", validateThirdPartyToken(msg.ThirdPartyToken)) return errs } @@ -170,8 +170,8 @@ func validateDomain(domain string) error { return nil } -// validateClientToken returns an error if provided client token is not valid. -func validateClientToken(token []byte) error { +// validateThirdPartyToken returns an error if provided token is not valid. +func validateThirdPartyToken(token []byte) error { const maxLen = 64 if len(token) > maxLen { return errors.Wrapf(errors.ErrInput, "must not be longer than %d characters", maxLen) diff --git a/docs/proto/index.html b/docs/proto/index.html index 9d3efae2..94a9838a 100644 --- a/docs/proto/index.html +++ b/docs/proto/index.html @@ -2181,17 +2181,17 @@

    RegisterAccountMsg

    targets BlockchainAddress repeated -

    Client token is an arbitrary data that can be provided by a middleman -(i.e. retailer) that although does not participate directly in the -transaction, helped a user to renew a domain. Storing a client token helps -identify contribution of such party later.

    +

    - client_token + third_party_token bytes -

    +

    Third party token is an arbitrary data that can be provided by a middleman +(i.e. retailer) that although does not participate directly in the +transaction, helped a user to renew a domain. Storing a client token helps +identify contribution of such party later.

    @@ -2233,10 +2233,10 @@

    RegisterDomainMsg

    - client_token + third_party_token bytes -

    Client token is an arbitrary data that can be provided by a middleman +

    Third party token is an arbitrary data that can be provided by a middleman (i.e. retailer) that although does not participate directly in the transaction, helped a user to register a domain. Storing a client token helps identify contribution of such party later.

    @@ -2273,10 +2273,10 @@

    RenewDomainMsg

    - client_token + third_party_token bytes -

    Client token is an arbitrary data that can be provided by a middleman +

    Third party token is an arbitrary data that can be provided by a middleman (i.e. retailer) that although does not participate directly in the transaction, helped a user to renew a domain. Storing a client token helps identify contribution of such party later.

    diff --git a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto index 91b743b3..cf0a37e4 100644 --- a/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/gogo/cmd/bnsd/x/blueaccount/codec.proto @@ -102,11 +102,11 @@ message RegisterDomainMsg { bytes owner = 2 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; // Domain part of the account that should be registered. string domain = 3; - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to register a domain. Storing a client token // helps identify contribution of such party later. - bytes client_token = 4; + bytes third_party_token = 4; } // TransferDomainMsg is issuing an ownership transfer over specified domain. @@ -125,11 +125,11 @@ message RenewDomainMsg { weave.Metadata metadata = 1; // Name of the domain that is transferred. string domain = 2; - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - bytes client_token = 3; + bytes third_party_token = 3; } // DeleteDomainMsg issues deletion of a domain and all accounts that belong to @@ -151,12 +151,12 @@ message RegisterAccountMsg { // Owner holds the address of the newly registered account. Can be empty to // leave the administration to the domain owner only. bytes owner = 4 [(gogoproto.casttype) = "github.com/iov-one/weave.Address"]; - // Client token is an arbitrary data that can be provided by a middleman + repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - repeated BlockchainAddress targets = 5 [(gogoproto.nullable) = false]; - bytes client_token = 6; + bytes third_party_token = 6; } // TransferAccountMsg is issuing an ownership transfer over specified account. diff --git a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto index c97dca44..28c14e88 100644 --- a/spec/proto/cmd/bnsd/x/blueaccount/codec.proto +++ b/spec/proto/cmd/bnsd/x/blueaccount/codec.proto @@ -101,11 +101,11 @@ message RegisterDomainMsg { bytes owner = 2 ; // Domain part of the account that should be registered. string domain = 3; - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to register a domain. Storing a client token // helps identify contribution of such party later. - bytes client_token = 4; + bytes third_party_token = 4; } // TransferDomainMsg is issuing an ownership transfer over specified domain. @@ -124,11 +124,11 @@ message RenewDomainMsg { weave.Metadata metadata = 1; // Name of the domain that is transferred. string domain = 2; - // Client token is an arbitrary data that can be provided by a middleman + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - bytes client_token = 3; + bytes third_party_token = 3; } // DeleteDomainMsg issues deletion of a domain and all accounts that belong to @@ -150,12 +150,12 @@ message RegisterAccountMsg { // Owner holds the address of the newly registered account. Can be empty to // leave the administration to the domain owner only. bytes owner = 4 ; - // Client token is an arbitrary data that can be provided by a middleman + repeated BlockchainAddress targets = 5 ; + // Third party token is an arbitrary data that can be provided by a middleman // (i.e. retailer) that although does not participate directly in the // transaction, helped a user to renew a domain. Storing a client token helps // identify contribution of such party later. - repeated BlockchainAddress targets = 5 ; - bytes client_token = 6; + bytes third_party_token = 6; } // TransferAccountMsg is issuing an ownership transfer over specified account. From 12c493e0edc88248b948ea184edb7b85becf3833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Wed, 30 Oct 2019 12:51:48 +0100 Subject: [PATCH 11/16] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc209e5f..9cb14cad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## HEAD +- Blue Account functionality was implememented in `cmd/bnsd/x/blueaccount` and + integrated into `bnsd` application. - `x/msgfee` was extended to provide a message to set a fee for a given message path. `bnscli` and `bnsd` were extended to support this change. From 3a1c98abd934b19dec68261d0048dedf7d9413c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orkun=20K=C3=BCl=C3=A7e?= Date: Thu, 31 Oct 2019 12:05:49 +0300 Subject: [PATCH 12/16] bnsd/x/blueacc: fix typos in handlers --- cmd/bnsd/x/blueaccount/handler.go | 70 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index 21f7475b..01081365 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -22,29 +22,29 @@ func RegisterRoutes(r weave.Registry, auth x.Authenticator) { domains := NewDomainBucket() accounts := NewAccountBucket() - r.Handle(&RegisterDomainMsg{}, ®isterDomaiHandler{ + r.Handle(&RegisterDomainMsg{}, ®isterDomainHandler{ domains: domains, accounts: accounts, auth: auth, }) - r.Handle(&TransferDomainMsg{}, &transferDomaiHandler{ + r.Handle(&TransferDomainMsg{}, &transferDomainHandler{ domains: domains, auth: auth, }) - r.Handle(&RenewDomainMsg{}, &renewDomaiHandler{ + r.Handle(&RenewDomainMsg{}, &renewDomainHandler{ domains: domains, auth: auth, }) - r.Handle(&DeleteDomainMsg{}, &deleteDomaiHandler{ + r.Handle(&DeleteDomainMsg{}, &deleteDomainHandler{ domains: domains, auth: auth, }) - r.Handle(&RegisterAccountMsg{}, ®isterAccounHandler{ + r.Handle(&RegisterAccountMsg{}, ®isterAccountHandler{ auth: auth, domains: domains, accounts: accounts, }) - r.Handle(&TransferAccountMsg{}, &transferAccounHandler{ + r.Handle(&TransferAccountMsg{}, &transferAccountHandler{ auth: auth, domains: domains, accounts: accounts, @@ -54,7 +54,7 @@ func RegisterRoutes(r weave.Registry, auth x.Authenticator) { domains: domains, accounts: accounts, }) - r.Handle(&DeleteAccountMsg{}, &deleteAccounHandler{ + r.Handle(&DeleteAccountMsg{}, &deleteAccountHandler{ auth: auth, domains: domains, accounts: accounts, @@ -64,20 +64,20 @@ func RegisterRoutes(r weave.Registry, auth x.Authenticator) { "blueaccount", &Configuration{}, auth)) } -type registerDomaiHandler struct { +type registerDomainHandler struct { auth x.Authenticator domains orm.ModelBucket accounts orm.ModelBucket } -func (h *registerDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *registerDomainHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *registerDomainHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { conf, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -117,7 +117,7 @@ func (h *registerDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w return &weave.DeliverResult{Data: nil}, nil } -func (h *registerDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Configuration, *RegisterDomainMsg, error) { +func (h *registerDomainHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Configuration, *RegisterDomainMsg, error) { var msg RegisterDomainMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, nil, errors.Wrap(err, "load msg") @@ -142,19 +142,19 @@ func (h *registerDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx return conf, &msg, nil } -type transferDomaiHandler struct { +type transferDomainHandler struct { auth x.Authenticator domains orm.ModelBucket } -func (h *transferDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *transferDomainHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *transferDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *transferDomainHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { domain, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -166,7 +166,7 @@ func (h *transferDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w return &weave.DeliverResult{Data: nil}, nil } -func (h *transferDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *TransferDomainMsg, error) { +func (h *transferDomainHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *TransferDomainMsg, error) { var msg TransferDomainMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, nil, errors.Wrap(err, "load msg") @@ -184,19 +184,19 @@ func (h *transferDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx return &domain, &msg, nil } -type renewDomaiHandler struct { +type renewDomainHandler struct { auth x.Authenticator domains orm.ModelBucket } -func (h *renewDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *renewDomainHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *renewDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *renewDomainHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { domain, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -223,7 +223,7 @@ func (h *renewDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weav return &weave.DeliverResult{Data: nil}, nil } -func (h *renewDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *RenewDomainMsg, error) { +func (h *renewDomainHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *RenewDomainMsg, error) { var msg RenewDomainMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, nil, errors.Wrap(err, "load msg") @@ -235,19 +235,19 @@ func (h *renewDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx wea return &domain, &msg, nil } -type deleteDomaiHandler struct { +type deleteDomainHandler struct { auth x.Authenticator domains orm.ModelBucket } -func (h *deleteDomaiHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *deleteDomainHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *deleteDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *deleteDomainHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { _, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -269,7 +269,7 @@ func (h *deleteDomaiHandler) Deliver(ctx weave.Context, db weave.KVStore, tx wea return &weave.DeliverResult{Data: nil}, nil } -func (h *deleteDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *DeleteDomainMsg, error) { +func (h *deleteDomainHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *DeleteDomainMsg, error) { var msg DeleteDomainMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, nil, errors.Wrap(err, "load msg") @@ -284,20 +284,20 @@ func (h *deleteDomaiHandler) validate(ctx weave.Context, db weave.KVStore, tx we return &domain, &msg, nil } -type registerAccounHandler struct { +type registerAccountHandler struct { auth x.Authenticator domains orm.ModelBucket accounts orm.ModelBucket } -func (h *registerAccounHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *registerAccountHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *registerAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *registerAccountHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { _, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -316,7 +316,7 @@ func (h *registerAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx return &weave.DeliverResult{Data: nil}, nil } -func (h *registerAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *RegisterAccountMsg, error) { +func (h *registerAccountHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Domain, *RegisterAccountMsg, error) { var msg RegisterAccountMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, nil, errors.Wrap(err, "load msg") @@ -349,20 +349,20 @@ func (h *registerAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx return &domain, &msg, nil } -type transferAccounHandler struct { +type transferAccountHandler struct { auth x.Authenticator accounts orm.ModelBucket domains orm.ModelBucket } -func (h *transferAccounHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *transferAccountHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, _, _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *transferAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *transferAccountHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { account, domain, msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -380,7 +380,7 @@ func (h *transferAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx return &weave.DeliverResult{Data: nil}, nil } -func (h *transferAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Account, *Domain, *TransferAccountMsg, error) { +func (h *transferAccountHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*Account, *Domain, *TransferAccountMsg, error) { var msg TransferAccountMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, nil, nil, errors.Wrap(err, "load msg") @@ -456,20 +456,20 @@ func (h *replaceAccountTargetHandler) validate(ctx weave.Context, db weave.KVSto return &account, &msg, nil } -type deleteAccounHandler struct { +type deleteAccountHandler struct { auth x.Authenticator domains orm.ModelBucket accounts orm.ModelBucket } -func (h *deleteAccounHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { +func (h *deleteAccountHandler) Check(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.CheckResult, error) { if _, err := h.validate(ctx, db, tx); err != nil { return nil, err } return &weave.CheckResult{GasAllocated: 0}, nil } -func (h *deleteAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { +func (h *deleteAccountHandler) Deliver(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error) { msg, err := h.validate(ctx, db, tx) if err != nil { return nil, err @@ -480,7 +480,7 @@ func (h *deleteAccounHandler) Deliver(ctx weave.Context, db weave.KVStore, tx we return &weave.DeliverResult{Data: nil}, nil } -func (h *deleteAccounHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*DeleteAccountMsg, error) { +func (h *deleteAccountHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*DeleteAccountMsg, error) { var msg DeleteAccountMsg if err := weave.LoadMsg(tx, &msg); err != nil { return nil, errors.Wrap(err, "load msg") From c723a296bd3e2235aa3c81f6b6f7ddaebcdb20ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Thu, 31 Oct 2019 08:53:11 +0100 Subject: [PATCH 13/16] update migration package update `cmd/bnscli` to support more transactions temporary solution to initalizing blueaccount extension configuration. --- CHANGELOG.md | 9 ++-- cmd/bnscli/cmd_blueaccount.go | 39 ++++++++++++++++ cmd/bnscli/cmd_key.go | 1 + cmd/bnscli/cmd_migration.go | 43 +++++++++++++++++ cmd/bnscli/cmd_query.go | 19 ++++++++ cmd/bnscli/main.go | 2 + cmd/bnsd/x/blueaccount/handler.go | 4 +- docs/proto/index.html | 12 +++++ gconf/handler.go | 31 ++++++++----- migration/codec.pb.go | 77 +++++++++++++++++++++++-------- migration/codec.proto | 7 +++ migration/handler.go | 20 +++++--- migration/msg.go | 3 ++ spec/gogo/migration/codec.proto | 7 +++ spec/proto/migration/codec.proto | 7 +++ 15 files changed, 240 insertions(+), 41 deletions(-) create mode 100644 cmd/bnscli/cmd_migration.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb14cad..1b6f60e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ # Changelog ## HEAD +- `migrations`: when upgrading the schema version an explicit version must be + provided. This is required to ensure at most one delivery. +- `cmd/bnscli` can create a schema upgrade transaction. - Blue Account functionality was implememented in `cmd/bnsd/x/blueaccount` and - integrated into `bnsd` application. -- `x/msgfee` was extended to provide a message to set a fee for a given message path. -`bnscli` and `bnsd` were extended to support this change. + integrated into `cmd/bnsd` application. +- `x/msgfee` was extended to provide a message to set a fee for a given message + path. `bnscli` and `bnsd` were extended to support this change. Breaking changes diff --git a/cmd/bnscli/cmd_blueaccount.go b/cmd/bnscli/cmd_blueaccount.go index 15ced278..2c2bd537 100644 --- a/cmd/bnscli/cmd_blueaccount.go +++ b/cmd/bnscli/cmd_blueaccount.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "io" + "time" "github.com/iov-one/weave" bnsd "github.com/iov-one/weave/cmd/bnsd/app" @@ -273,3 +274,41 @@ Create a transaction to delete an account. _, err := writeTx(output, tx) return err } + +func cmdUpdateBlueConfiguration(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction to delete an account. + `) + fl.PrintDefaults() + } + var ( + ownerFl = flAddress(fl, "owner", "", "Address of the owner.") + validDomainFl = fl.String("valid-domain", "", "Regular expression defining a rule for a valid domain.") + validNameFl = fl.String("valid-name", "", "Regular expression defining a rule for a valid name.") + domainRenewFl = fl.Duration("domain-renew", 30*24*time.Hour, "Period of the domain renewal.") + ) + fl.Parse(args) + + msg := blueaccount.UpdateConfigurationMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Patch: &blueaccount.Configuration{ + Metadata: &weave.Metadata{Schema: 1}, + Owner: *ownerFl, + ValidDomain: *validDomainFl, + ValidName: *validNameFl, + DomainRenew: weave.AsUnixDuration(*domainRenewFl), + }, + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_BlueaccountUpdateConfigurationMsg{ + BlueaccountUpdateConfigurationMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} diff --git a/cmd/bnscli/cmd_key.go b/cmd/bnscli/cmd_key.go index 108cf252..6f3e5e1e 100644 --- a/cmd/bnscli/cmd_key.go +++ b/cmd/bnscli/cmd_key.go @@ -47,6 +47,7 @@ created. This command fails if the private key file already exists. if err != nil { return fmt.Errorf("cannot read mnemonic: %s", err) } + mnemonic = bytes.TrimSpace(mnemonic) priv, err := keygen(string(mnemonic), *pathFl) if err != nil { diff --git a/cmd/bnscli/cmd_migration.go b/cmd/bnscli/cmd_migration.go new file mode 100644 index 00000000..dab99b1b --- /dev/null +++ b/cmd/bnscli/cmd_migration.go @@ -0,0 +1,43 @@ +package main + +import ( + "flag" + "fmt" + "io" + + "github.com/iov-one/weave" + bnsd "github.com/iov-one/weave/cmd/bnsd/app" + "github.com/iov-one/weave/migration" +) + +func cmdUpgradeSchema(input io.Reader, output io.Writer, args []string) error { + fl := flag.NewFlagSet("", flag.ExitOnError) + fl.Usage = func() { + fmt.Fprintln(flag.CommandLine.Output(), ` +Create a transaction for upgrading or initializing schema version of a given extension. + `) + fl.PrintDefaults() + } + var ( + pkgFl = fl.String("pkg", "", "Name of the extension that schema is to be upgraded") + toVersionFl = fl.Uint("ver", 1, "Migrate to given schema version. 1 to initialize.") + ) + fl.Parse(args) + + msg := migration.UpgradeSchemaMsg{ + Metadata: &weave.Metadata{Schema: 1}, + Pkg: *pkgFl, + ToVersion: uint32(*toVersionFl), + } + if err := msg.Validate(); err != nil { + return fmt.Errorf("given data produce an invalid message: %s", err) + } + + tx := &bnsd.Tx{ + Sum: &bnsd.Tx_MigrationUpgradeSchemaMsg{ + MigrationUpgradeSchemaMsg: &msg, + }, + } + _, err := writeTx(output, tx) + return err +} diff --git a/cmd/bnscli/cmd_query.go b/cmd/bnscli/cmd_query.go index 489890af..459b1f20 100644 --- a/cmd/bnscli/cmd_query.go +++ b/cmd/bnscli/cmd_query.go @@ -15,6 +15,7 @@ import ( "github.com/iov-one/weave" bnsd "github.com/iov-one/weave/cmd/bnsd/app" "github.com/iov-one/weave/cmd/bnsd/client" + "github.com/iov-one/weave/cmd/bnsd/x/blueaccount" "github.com/iov-one/weave/cmd/bnsd/x/username" "github.com/iov-one/weave/orm" "github.com/iov-one/weave/x/cash" @@ -182,6 +183,16 @@ var queries = map[string]struct { decKey: sequenceKey, encID: numericID, }, + "/bluedomains": { + newObj: func() model { return &blueaccount.Domain{} }, + decKey: strKey, + encID: strID, + }, + "/blueaccounts": { + newObj: func() model { return &blueaccount.Account{} }, + decKey: strKey, + encID: strID, + }, } // model is an entity used by weave to store data. This interface is @@ -229,6 +240,10 @@ func addressID(s string) ([]byte, error) { return weave.ParseAddress(s) } +func strID(s string) ([]byte, error) { + return []byte(s), nil +} + func refKey(raw []byte) (string, error) { // Skip the prefix, being the characters before : (including separator) val := raw[bytes.Index(raw, []byte(":"))+1:] @@ -266,6 +281,10 @@ func rawKey(raw []byte) (string, error) { return hex.EncodeToString(raw), nil } +func strKey(raw []byte) (string, error) { + return string(raw), nil +} + // extendedProposal is the gov.Proposal with an additional field to extract // RawOption. When serialized using JSON, this structure produce the same // result as the gov.Proposal with an addition of an attribute representing diff --git a/cmd/bnscli/main.go b/cmd/bnscli/main.go index 04cf7ad9..47bcca09 100644 --- a/cmd/bnscli/main.go +++ b/cmd/bnscli/main.go @@ -45,6 +45,7 @@ var commands = map[string]func(input io.Reader, output io.Writer, args []string) "blue-replace-account-targets": cmdReplaceBlueAccountTargets, "blue-transfer-account": cmdTransferBlueAccount, "blue-transfer-domain": cmdTransferBlueDomain, + "blue-update-configuration": cmdUpdateBlueConfiguration, "blue-with-bc-address": cmdWithBlueBlockchainAddress, "del-proposal": cmdDelProposal, "from-sequence": cmdFromSequence, @@ -65,6 +66,7 @@ var commands = map[string]func(input io.Reader, output io.Writer, args []string) "text-resolution": cmdTextResolution, "update-election-rule": cmdUpdateElectionRule, "update-electorate": cmdUpdateElectorate, + "upgrade-schema": cmdUpgradeSchema, "version": cmdVersion, "view": cmdTransactionView, "vote": cmdVote, diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index 01081365..50d93376 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -12,8 +12,8 @@ import ( ) func RegisterQuery(qr weave.QueryRouter) { - NewDomainBucket().Register("domain", qr) - NewAccountBucket().Register("account", qr) + NewDomainBucket().Register("bluedomains", qr) + NewAccountBucket().Register("blueaccounts", qr) } func RegisterRoutes(r weave.Registry, auth x.Authenticator) { diff --git a/docs/proto/index.html b/docs/proto/index.html index 94a9838a..a31674e0 100644 --- a/docs/proto/index.html +++ b/docs/proto/index.html @@ -3082,6 +3082,18 @@

    UpgradeSchemaMsg

    Name of the package that schema version upgrade is made for.

    + + to_version + uint32 + +

    To version defines to which version upgrade this schema. It always must be +a value one higher than the currently registered schema or 1 if this is +the initial upgrade. +This value must be provided to avoid consecutive upgrades submitted by a +mistake. This ensures at most one delivery as upgrades to an invalid +version are rejected.

    + + diff --git a/gconf/handler.go b/gconf/handler.go index 902498be..567a9cbc 100644 --- a/gconf/handler.go +++ b/gconf/handler.go @@ -49,18 +49,25 @@ func (h UpdateConfigurationHandler) Deliver(ctx weave.Context, store weave.KVSto } func (h UpdateConfigurationHandler) applyTx(ctx weave.Context, store weave.KVStore, tx weave.Tx) error { - if err := Load(store, h.pkg, h.config); err != nil { - return errors.Wrap(err, "load message") - } - - // Configuration owner must sign the transaction in order to - // authenticate the change. - owner := h.config.GetOwner() - if owner == nil { - return errors.Wrap(errors.ErrUnauthorized, "owner signature required") - } - if !h.auth.HasAddress(ctx, owner) { - return errors.Wrap(errors.ErrUnauthorized, "owner did not sign transaction") + switch err := Load(store, h.pkg, h.config); { + case err == nil: + // Configuration owner must sign the transaction in order to + // authenticate the change. + owner := h.config.GetOwner() + if owner == nil { + return errors.Wrap(errors.ErrUnauthorized, "owner signature required") + } + if !h.auth.HasAddress(ctx, owner) { + return errors.Wrap(errors.ErrUnauthorized, "owner did not sign transaction") + } + case errors.ErrNotFound.Is(err): + // Configuration entity does not exist. It was not initialized + // during via the genesis and will be created for the first + // time now. + + // TODO - because of lack of a better idea, anyone can do this right now + default: + return errors.Wrap(err, "load current configuration") } payload, err := patchPayload(tx) diff --git a/migration/codec.pb.go b/migration/codec.pb.go index b5e7b63c..125d0706 100644 --- a/migration/codec.pb.go +++ b/migration/codec.pb.go @@ -141,6 +141,13 @@ type UpgradeSchemaMsg struct { Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Name of the package that schema version upgrade is made for. Pkg string `protobuf:"bytes,2,opt,name=pkg,proto3" json:"pkg,omitempty"` + // To version defines to which version upgrade this schema. It always must be + // a value one higher than the currently registered schema or 1 if this is + // the initial upgrade. + // This value must be provided to avoid consecutive upgrades submitted by a + // mistake. This ensures at most one delivery as upgrades to an invalid + // version are rejected. + ToVersion uint32 `protobuf:"varint,3,opt,name=to_version,json=toVersion,proto3" json:"to_version,omitempty"` } func (m *UpgradeSchemaMsg) Reset() { *m = UpgradeSchemaMsg{} } @@ -190,6 +197,13 @@ func (m *UpgradeSchemaMsg) GetPkg() string { return "" } +func (m *UpgradeSchemaMsg) GetToVersion() uint32 { + if m != nil { + return m.ToVersion + } + return 0 +} + func init() { proto.RegisterType((*Configuration)(nil), "migration.Configuration") proto.RegisterType((*Schema)(nil), "migration.Schema") @@ -199,24 +213,24 @@ func init() { func init() { proto.RegisterFile("migration/codec.proto", fileDescriptor_ecf669b5eede564b) } var fileDescriptor_ecf669b5eede564b = []byte{ - // 260 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcd, 0x4c, 0x2f, - 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, 0xce, 0x4f, 0x49, 0x4d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0xe2, 0x84, 0x0b, 0x4b, 0x71, 0x23, 0x89, 0x4b, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, - 0x99, 0xfa, 0x20, 0x16, 0x44, 0x54, 0xc9, 0x9b, 0x8b, 0xd7, 0x39, 0x3f, 0x2f, 0x2d, 0x33, 0xbd, - 0x14, 0xa2, 0x47, 0xc8, 0x8a, 0x8b, 0x35, 0x31, 0x25, 0x37, 0x33, 0x4f, 0x82, 0x49, 0x81, 0x51, - 0x83, 0xc7, 0x49, 0xe5, 0xd7, 0x3d, 0x79, 0x85, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0xfd, 0xcc, 0xfc, 0x32, 0xdd, 0xfc, 0xbc, 0x54, 0xfd, 0xf2, 0xd4, 0xc4, 0xb2, 0x54, - 0x3d, 0xc7, 0x94, 0x94, 0xa2, 0xd4, 0xe2, 0xe2, 0x20, 0x88, 0x16, 0xa5, 0x44, 0x2e, 0xb6, 0xe0, - 0xe4, 0x8c, 0xd4, 0xdc, 0x44, 0x21, 0x6d, 0x2e, 0x8e, 0xdc, 0xd4, 0x92, 0xc4, 0x94, 0xc4, 0x92, - 0x44, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x7e, 0x3d, 0x88, 0x16, 0x5f, 0xa8, 0x70, 0x10, - 0x5c, 0x81, 0x90, 0x00, 0x17, 0x73, 0x41, 0x76, 0x3a, 0xd8, 0x42, 0xce, 0x20, 0x10, 0x53, 0x48, - 0x82, 0x8b, 0xbd, 0x2c, 0xb5, 0xa8, 0x38, 0x33, 0x3f, 0x4f, 0x82, 0x59, 0x81, 0x51, 0x83, 0x37, - 0x08, 0xc6, 0x55, 0x0a, 0xe4, 0x12, 0x08, 0x2d, 0x48, 0x2f, 0x4a, 0x4c, 0x49, 0x85, 0xd8, 0xe4, - 0x5b, 0x9c, 0x4e, 0xa1, 0x65, 0x4e, 0x12, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, - 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, - 0x90, 0xc4, 0x06, 0x0e, 0x23, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0x35, 0xa8, 0x1c, - 0x6a, 0x01, 0x00, 0x00, + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x90, 0x41, 0x4b, 0xc3, 0x30, + 0x18, 0x86, 0x17, 0x87, 0xd3, 0x7e, 0x73, 0x38, 0x8a, 0x42, 0x19, 0x18, 0x4b, 0xf1, 0x50, 0x10, + 0x5b, 0xd0, 0x9b, 0x37, 0xe7, 0x51, 0x76, 0xa9, 0xe8, 0x55, 0xb2, 0x26, 0x66, 0x41, 0x9a, 0xaf, + 0xa4, 0x59, 0xfd, 0x1b, 0xfe, 0x2c, 0x8f, 0x3b, 0x7a, 0x12, 0x69, 0xff, 0x85, 0x27, 0x59, 0xa3, + 0x43, 0xcf, 0xde, 0xde, 0x3c, 0xe4, 0xe1, 0x81, 0x0f, 0x0e, 0x0b, 0x25, 0x0d, 0xb3, 0x0a, 0x75, + 0x9a, 0x23, 0x17, 0x79, 0x52, 0x1a, 0xb4, 0xe8, 0x7b, 0x1b, 0x3c, 0x19, 0xfe, 0xe2, 0x93, 0x03, + 0x89, 0x12, 0xbb, 0x99, 0xae, 0x97, 0xa3, 0xd1, 0x0d, 0x8c, 0xae, 0x51, 0x3f, 0x2a, 0xb9, 0x74, + 0x8e, 0x7f, 0x09, 0xdb, 0x8c, 0x17, 0x4a, 0x07, 0x5b, 0x21, 0x89, 0xf7, 0xa6, 0x27, 0x9f, 0xef, + 0xc7, 0xa1, 0x54, 0x76, 0xb1, 0x9c, 0x27, 0x39, 0x16, 0xa9, 0xc2, 0xfa, 0x0c, 0xb5, 0x48, 0x9f, + 0x05, 0xab, 0x45, 0x72, 0xc5, 0xb9, 0x11, 0x55, 0x95, 0x39, 0x25, 0x62, 0x30, 0xb8, 0xcd, 0x17, + 0xa2, 0x60, 0xfe, 0x29, 0xec, 0x16, 0xc2, 0x32, 0xce, 0x2c, 0x0b, 0x48, 0x48, 0xe2, 0xe1, 0xf9, + 0x7e, 0xe2, 0x94, 0xd9, 0x37, 0xce, 0x36, 0x1f, 0xfc, 0x31, 0xf4, 0xcb, 0x27, 0xd9, 0x05, 0xbd, + 0x6c, 0x3d, 0xfd, 0x00, 0x76, 0x6a, 0x61, 0x2a, 0x85, 0x3a, 0xe8, 0x87, 0x24, 0x1e, 0x65, 0x3f, + 0xcf, 0xa8, 0x84, 0xf1, 0x5d, 0x29, 0x0d, 0xe3, 0xc2, 0x95, 0x66, 0x95, 0xfc, 0x6f, 0xec, 0x08, + 0xc0, 0xe2, 0xc3, 0xdf, 0x9e, 0x67, 0xf1, 0xde, 0x81, 0x69, 0xf0, 0xda, 0x50, 0xb2, 0x6a, 0x28, + 0xf9, 0x68, 0x28, 0x79, 0x69, 0x69, 0x6f, 0xd5, 0xd2, 0xde, 0x5b, 0x4b, 0x7b, 0xf3, 0x41, 0x77, + 0xc2, 0x8b, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0x95, 0x80, 0x6f, 0x89, 0x01, 0x00, 0x00, } func (m *Configuration) Marshal() (dAtA []byte, err error) { @@ -313,6 +327,11 @@ func (m *UpgradeSchemaMsg) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintCodec(dAtA, i, uint64(len(m.Pkg))) i += copy(dAtA[i:], m.Pkg) } + if m.ToVersion != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintCodec(dAtA, i, uint64(m.ToVersion)) + } return i, nil } @@ -372,6 +391,9 @@ func (m *UpgradeSchemaMsg) Size() (n int) { if l > 0 { n += 1 + l + sovCodec(uint64(l)) } + if m.ToVersion != 0 { + n += 1 + sovCodec(uint64(m.ToVersion)) + } return n } @@ -712,6 +734,25 @@ func (m *UpgradeSchemaMsg) Unmarshal(dAtA []byte) error { } m.Pkg = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ToVersion", wireType) + } + m.ToVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ToVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipCodec(dAtA[iNdEx:]) diff --git a/migration/codec.proto b/migration/codec.proto index fe0f4f4b..68c00416 100644 --- a/migration/codec.proto +++ b/migration/codec.proto @@ -28,4 +28,11 @@ message UpgradeSchemaMsg { weave.Metadata metadata = 1; // Name of the package that schema version upgrade is made for. string pkg = 2; + // To version defines to which version upgrade this schema. It always must be + // a value one higher than the currently registered schema or 1 if this is + // the initial upgrade. + // This value must be provided to avoid consecutive upgrades submitted by a + // mistake. This ensures at most one delivery as upgrades to an invalid + // version are rejected. + uint32 to_version = 3; } diff --git a/migration/handler.go b/migration/handler.go index a63b7ca6..8dc9232a 100644 --- a/migration/handler.go +++ b/migration/handler.go @@ -114,15 +114,10 @@ func (h *upgradeSchemaHandler) Deliver(ctx weave.Context, db weave.KVStore, tx w return nil, err } - ver, err := h.bucket.CurrentSchema(db, msg.Pkg) - if err != nil && !errors.ErrNotFound.Is(err) { - return nil, errors.Wrap(err, "current schema version") - } - schema := Schema{ Metadata: &weave.Metadata{Schema: 1}, Pkg: msg.Pkg, - Version: ver + 1, + Version: msg.ToVersion, } obj, err := h.bucket.Create(db, &schema) if err != nil { @@ -143,6 +138,19 @@ func (h *upgradeSchemaHandler) validate(ctx weave.Context, db weave.KVStore, tx return nil, errors.Wrap(errors.ErrUnauthorized, "admin signature required") } + switch ver, err := h.bucket.CurrentSchema(db, msg.Pkg); { + case err == nil: + if ver+1 != msg.ToVersion { + return nil, errors.Wrapf(errors.ErrSchema, "the current schema version is %d", ver) + } + case errors.ErrNotFound.Is(err): + if msg.ToVersion != 1 { + return nil, errors.Wrap(errors.ErrSchema, "schema must be initialized with version 1") + } + default: + return nil, errors.Wrap(err, "current schema version") + } + return &msg, nil } diff --git a/migration/msg.go b/migration/msg.go index 342f9233..4faeea64 100644 --- a/migration/msg.go +++ b/migration/msg.go @@ -11,6 +11,9 @@ func (msg *UpgradeSchemaMsg) Validate() error { if msg.Pkg == "" { return errors.Wrap(errors.ErrEmpty, "pkg is required") } + if msg.ToVersion == 0 { + return errors.Wrap(errors.ErrEmpty, "to version is required") + } return nil } diff --git a/spec/gogo/migration/codec.proto b/spec/gogo/migration/codec.proto index fe0f4f4b..68c00416 100644 --- a/spec/gogo/migration/codec.proto +++ b/spec/gogo/migration/codec.proto @@ -28,4 +28,11 @@ message UpgradeSchemaMsg { weave.Metadata metadata = 1; // Name of the package that schema version upgrade is made for. string pkg = 2; + // To version defines to which version upgrade this schema. It always must be + // a value one higher than the currently registered schema or 1 if this is + // the initial upgrade. + // This value must be provided to avoid consecutive upgrades submitted by a + // mistake. This ensures at most one delivery as upgrades to an invalid + // version are rejected. + uint32 to_version = 3; } diff --git a/spec/proto/migration/codec.proto b/spec/proto/migration/codec.proto index 0a3c6bae..14e64c5b 100644 --- a/spec/proto/migration/codec.proto +++ b/spec/proto/migration/codec.proto @@ -27,4 +27,11 @@ message UpgradeSchemaMsg { weave.Metadata metadata = 1; // Name of the package that schema version upgrade is made for. string pkg = 2; + // To version defines to which version upgrade this schema. It always must be + // a value one higher than the currently registered schema or 1 if this is + // the initial upgrade. + // This value must be provided to avoid consecutive upgrades submitted by a + // mistake. This ensures at most one delivery as upgrades to an invalid + // version are rejected. + uint32 to_version = 3; } From 1d8ee29d346c21a765e090c0f5b0b72c007c3a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Thu, 31 Oct 2019 09:25:11 +0100 Subject: [PATCH 14/16] register missing schema migation for UpgradeSchemaMsg --- migration/msg.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/migration/msg.go b/migration/msg.go index 4faeea64..8ee02728 100644 --- a/migration/msg.go +++ b/migration/msg.go @@ -5,6 +5,10 @@ import ( "github.com/iov-one/weave/errors" ) +func init() { + MustRegister(1, &UpgradeSchemaMsg{}, NoModification) +} + var _ weave.Msg = (*UpgradeSchemaMsg)(nil) func (msg *UpgradeSchemaMsg) Validate() error { From 8ae200f2608f269dc98d92e3ea29a768de584136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Thu, 31 Oct 2019 10:19:42 +0100 Subject: [PATCH 15/16] gconf: allow to provide additional authentication address --- CHANGELOG.md | 3 ++ cmd/bnsd/x/blueaccount/handler.go | 2 +- cmd/bnsd/x/username/handlers.go | 2 +- gconf/handler.go | 49 ++++++++++++++++++++++++++----- migration/configuration.go | 22 +++++++++++--- migration/handler.go | 5 +++- x/cash/handler.go | 2 +- x/msgfee/handler.go | 2 +- 8 files changed, 70 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b6f60e9..5d942832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## HEAD +- `gconf`: allow to provide an optional authentication address that will be + used to authenticate a configuration creation message. This solves a + chicken-egg problem of when the confgiuration was not created via genesis. - `migrations`: when upgrading the schema version an explicit version must be provided. This is required to ensure at most one delivery. - `cmd/bnscli` can create a schema upgrade transaction. diff --git a/cmd/bnsd/x/blueaccount/handler.go b/cmd/bnsd/x/blueaccount/handler.go index 50d93376..717fa2af 100644 --- a/cmd/bnsd/x/blueaccount/handler.go +++ b/cmd/bnsd/x/blueaccount/handler.go @@ -61,7 +61,7 @@ func RegisterRoutes(r weave.Registry, auth x.Authenticator) { }) r.Handle(&UpdateConfigurationMsg{}, gconf.NewUpdateConfigurationHandler( - "blueaccount", &Configuration{}, auth)) + "blueaccount", &Configuration{}, auth, migration.CurrentAdmin)) } type registerDomainHandler struct { diff --git a/cmd/bnsd/x/username/handlers.go b/cmd/bnsd/x/username/handlers.go index 766c3195..620a01a3 100644 --- a/cmd/bnsd/x/username/handlers.go +++ b/cmd/bnsd/x/username/handlers.go @@ -180,5 +180,5 @@ func (h *changeTokenTargetsHandler) validate(ctx weave.Context, db weave.KVStore func NewConfigHandler(auth x.Authenticator) weave.Handler { var conf Configuration - return gconf.NewUpdateConfigurationHandler("username", &conf, auth) + return gconf.NewUpdateConfigurationHandler("username", &conf, auth, migration.CurrentAdmin) } diff --git a/gconf/handler.go b/gconf/handler.go index 567a9cbc..6481b5a3 100644 --- a/gconf/handler.go +++ b/gconf/handler.go @@ -20,17 +20,42 @@ type OwnedConfig interface { type UpdateConfigurationHandler struct { pkg string // We require this type to load the data. - config OwnedConfig - auth x.Authenticator + config OwnedConfig + auth x.Authenticator + initAdmin func(weave.ReadOnlyKVStore) (weave.Address, error) } var _ weave.Handler = (*UpdateConfigurationHandler)(nil) -func NewUpdateConfigurationHandler(pkg string, config OwnedConfig, auth x.Authenticator) UpdateConfigurationHandler { +// NewUpdateConfigurationHandler returns a message handler that process +// configuration patch message. +// +// To pass authentication step, each message must be signed by the current +// configuration owner. +// +// A special chicken-egg problem appears when the configuration does not exist +// (it was not created via genesis). This is an issue, because without +// configuration we cannot configure configuration owner that can update the +// configuration. This means that the configuration cannot be created as well. +// A configuration is needed to create a configuration. +// To address the above issue, an optional `initConfAdmin` argument can be +// given to provide a creation only admin address. A good deafult is to use +// `migration.CurrentAdmin` function. +// `initConfAdmin` is used to authenticate the tranaction only when no +// configuration exist. Once a configuration is created, `initConfAdmin` is not +// used anymore and the autentication relies only on configuration's owner +// declaration. +func NewUpdateConfigurationHandler( + pkg string, + config OwnedConfig, + auth x.Authenticator, + initConfAdmin func(weave.ReadOnlyKVStore) (weave.Address, error), +) UpdateConfigurationHandler { return UpdateConfigurationHandler{ - pkg: pkg, - config: config, - auth: auth, + pkg: pkg, + config: config, + auth: auth, + initAdmin: initConfAdmin, } } @@ -64,8 +89,16 @@ func (h UpdateConfigurationHandler) applyTx(ctx weave.Context, store weave.KVSto // Configuration entity does not exist. It was not initialized // during via the genesis and will be created for the first // time now. - - // TODO - because of lack of a better idea, anyone can do this right now + if h.initAdmin == nil { + return errors.Wrap(errors.ErrUnauthorized, "configuration does not exist and cannot be initialized") + } + admin, err := h.initAdmin(store) + if err != nil { + return errors.Wrap(err, "get init admin") + } + if !h.auth.HasAddress(ctx, admin) { + return errors.Wrap(errors.ErrUnauthorized, "initialization admin signature required") + } default: return errors.Wrap(err, "load current configuration") } diff --git a/migration/configuration.go b/migration/configuration.go index d7e05d43..7d797297 100644 --- a/migration/configuration.go +++ b/migration/configuration.go @@ -1,6 +1,7 @@ package migration import ( + weave "github.com/iov-one/weave" "github.com/iov-one/weave/errors" "github.com/iov-one/weave/gconf" ) @@ -12,11 +13,24 @@ func (c *Configuration) Validate() error { return nil } -func mustLoadConf(db gconf.Store) Configuration { +func loadConf(db gconf.ReadStore) (*Configuration, error) { var conf Configuration if err := gconf.Load(db, "migration", &conf); err != nil { - err = errors.Wrap(err, "load configuration") - panic(err) + return nil, errors.Wrap(err, "gconf") } - return conf + return &conf, nil +} + +// CurrentAdmin returns migration extension admin address as currently +// configured. +// +// This function is useful for the `gconf` package users to provide a one time +// authentication address during configuration initialization. See +// `gconf.NewUpdateConfigurationHandler` for more details. +func CurrentAdmin(db weave.ReadOnlyKVStore) (weave.Address, error) { + conf, err := loadConf(db) + if err != nil { + return nil, errors.Wrap(err, "load configuration") + } + return conf.Admin, nil } diff --git a/migration/handler.go b/migration/handler.go index 8dc9232a..00500f3a 100644 --- a/migration/handler.go +++ b/migration/handler.go @@ -133,7 +133,10 @@ func (h *upgradeSchemaHandler) validate(ctx weave.Context, db weave.KVStore, tx return nil, errors.Wrap(err, "load msg") } - conf := mustLoadConf(db) + conf, err := loadConf(db) + if err != nil { + return nil, errors.Wrap(err, "load configuration") + } if !h.auth.HasAddress(ctx, conf.Admin) { return nil, errors.Wrap(errors.ErrUnauthorized, "admin signature required") } diff --git a/x/cash/handler.go b/x/cash/handler.go index 45038680..78ba2064 100644 --- a/x/cash/handler.go +++ b/x/cash/handler.go @@ -78,5 +78,5 @@ func (h SendHandler) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx func NewConfigHandler(auth x.Authenticator) weave.Handler { var conf Configuration - return gconf.NewUpdateConfigurationHandler("cash", &conf, auth) + return gconf.NewUpdateConfigurationHandler("cash", &conf, auth, migration.CurrentAdmin) } diff --git a/x/msgfee/handler.go b/x/msgfee/handler.go index 01c81c48..b0a8332b 100644 --- a/x/msgfee/handler.go +++ b/x/msgfee/handler.go @@ -78,5 +78,5 @@ func (h *setMsgFeeHandler) validate(ctx weave.Context, db weave.KVStore, tx weav func NewConfigHandler(auth x.Authenticator) weave.Handler { var conf Configuration - return gconf.NewUpdateConfigurationHandler("cash", &conf, auth) + return gconf.NewUpdateConfigurationHandler("cash", &conf, auth, migration.CurrentAdmin) } From fb57ca17d4db2889128255db5c3afd93bc42ae1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Husiaty=C5=84ski?= Date: Thu, 31 Oct 2019 10:37:08 +0100 Subject: [PATCH 16/16] gconf: fix tests --- gconf/handler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gconf/handler_test.go b/gconf/handler_test.go index a5bcd9d8..cef0c336 100644 --- a/gconf/handler_test.go +++ b/gconf/handler_test.go @@ -124,7 +124,7 @@ func TestUpdateConfigurationHandler(t *testing.T) { var c myconfig auth := &weavetest.CtxAuth{Key: "auth"} - handler := NewUpdateConfigurationHandler("mypkg", &c, auth) + handler := NewUpdateConfigurationHandler("mypkg", &c, auth, nil) ctx := weave.WithHeight(context.Background(), 999) ctx = weave.WithChainID(ctx, "mychain-123")