diff --git a/golang/cosmos/x/vbank/types/vbank.pb.go b/golang/cosmos/x/vbank/types/vbank.pb.go index 1b1e8b5d947b..5145e3f9a167 100644 --- a/golang/cosmos/x/vbank/types/vbank.pb.go +++ b/golang/cosmos/x/vbank/types/vbank.pb.go @@ -39,6 +39,10 @@ type Params struct { // an epoch's rewards. If zero, use the same value as // reward_epoch_duration_blocks. RewardSmoothingBlocks int64 `protobuf:"varint,3,opt,name=reward_smoothing_blocks,json=rewardSmoothingBlocks,proto3" json:"reward_smoothing_blocks,omitempty" yaml:"reward_smoothing_blocks"` + // allowed_monitoring_accounts is an array of account addresses that can be + // monitored for sends and receives. An element of `"*"` will permit any + // address. An element of `"!"` will deny all addresses. + AllowedMonitoringAccounts []string `protobuf:"bytes,4,rep,name=allowed_monitoring_accounts,json=allowedMonitoringAccounts,proto3" json:"allowed_monitoring_accounts,omitempty" yaml:"allowed_monitoring_accounts"` } func (m *Params) Reset() { *m = Params{} } @@ -87,6 +91,13 @@ func (m *Params) GetRewardSmoothingBlocks() int64 { return 0 } +func (m *Params) GetAllowedMonitoringAccounts() []string { + if m != nil { + return m.AllowedMonitoringAccounts + } + return nil +} + // The current state of the module. type State struct { // rewardPool is the current balance of rewards in the module account. @@ -170,42 +181,45 @@ func init() { func init() { proto.RegisterFile("agoric/vbank/vbank.proto", fileDescriptor_5e89b3b9e5e671b4) } var fileDescriptor_5e89b3b9e5e671b4 = []byte{ - // 550 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x73, 0x49, 0xa8, 0xe0, 0x5a, 0x06, 0x4c, 0x01, 0x27, 0x20, 0x3b, 0x32, 0x02, 0xc2, - 0x80, 0xad, 0xc2, 0x82, 0x22, 0x31, 0xd4, 0x84, 0x8e, 0xa8, 0x72, 0x06, 0xa4, 0x2e, 0xd1, 0xd9, - 0x39, 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ae, 0xcc, - 0x37, 0x9e, 0xe0, 0xcb, 0x29, 0xe1, 0x62, 0xc8, 0xe9, 0xab, 0x29, 0xcd, 0x23, 0x2a, 0xc7, 0xd0, - 0xf4, 0xcd, 0x45, 0x69, 0x6f, 0xab, 0xaf, 0xae, 0x61, 0x27, 0xd8, 0xaa, 0xce, 0x03, 0x7d, 0x34, - 0x72, 0x6c, 0x49, 0xae, 0xa5, 0x8d, 0x12, 0x2e, 0x58, 0x12, 0x4e, 0xcf, 0xee, 0xa8, 0xd9, 0x94, - 0x63, 0xbd, 0x7f, 0x76, 0x75, 0xce, 0x8f, 0x77, 0x82, 0x9b, 0x55, 0x80, 0xba, 0x36, 0xfd, 0x15, - 0x2c, 0x45, 0xf7, 0x9a, 0xd5, 0x7c, 0xfd, 0xe0, 0x64, 0x66, 0xa1, 0xd3, 0x99, 0x85, 0xbe, 0xcf, - 0x2c, 0xf4, 0x6e, 0x6e, 0xd5, 0x4e, 0xe7, 0x56, 0xed, 0xf3, 0xdc, 0xaa, 0x1d, 0x3c, 0x5e, 0xf1, - 0x62, 0x57, 0xad, 0xb4, 0xda, 0x5f, 0xe9, 0x45, 0x0c, 0x29, 0xc9, 0xe3, 0xa5, 0x49, 0x6f, 0xf4, - 0xb6, 0x4b, 0x87, 0xc2, 0x0d, 0xb9, 0xaa, 0x8f, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x95, - 0x56, 0xb1, 0x0a, 0x04, 0x00, 0x00, + // 597 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xd3, 0x4e, + 0x18, 0xc7, 0xe3, 0x26, 0xbf, 0xea, 0xd7, 0x6b, 0x19, 0x30, 0x05, 0x9c, 0x16, 0xd9, 0xd1, 0x21, + 0x4a, 0x18, 0xb0, 0x55, 0x58, 0x50, 0x25, 0x86, 0x9a, 0xd2, 0x0d, 0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0x8f, 0x72, 0x04, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -236,6 +250,14 @@ func (this *Params) Equal(that interface{}) bool { if this.RewardSmoothingBlocks != that1.RewardSmoothingBlocks { return false } + if len(this.AllowedMonitoringAccounts) != len(that1.AllowedMonitoringAccounts) { + return false + } + for i := range this.AllowedMonitoringAccounts { + if this.AllowedMonitoringAccounts[i] != that1.AllowedMonitoringAccounts[i] { + return false + } + } return true } func (this *State) Equal(that interface{}) bool { @@ -301,6 +323,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AllowedMonitoringAccounts) > 0 { + for iNdEx := len(m.AllowedMonitoringAccounts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedMonitoringAccounts[iNdEx]) + copy(dAtA[i:], m.AllowedMonitoringAccounts[iNdEx]) + i = encodeVarintVbank(dAtA, i, uint64(len(m.AllowedMonitoringAccounts[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } if m.RewardSmoothingBlocks != 0 { i = encodeVarintVbank(dAtA, i, uint64(m.RewardSmoothingBlocks)) i-- @@ -410,6 +441,12 @@ func (m *Params) Size() (n int) { if m.RewardSmoothingBlocks != 0 { n += 1 + sovVbank(uint64(m.RewardSmoothingBlocks)) } + if len(m.AllowedMonitoringAccounts) > 0 { + for _, s := range m.AllowedMonitoringAccounts { + l = len(s) + n += 1 + l + sovVbank(uint64(l)) + } + } return n } @@ -547,6 +584,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedMonitoringAccounts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVbank + } + 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 ErrInvalidLengthVbank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVbank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedMonitoringAccounts = append(m.AllowedMonitoringAccounts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVbank(dAtA[iNdEx:]) diff --git a/packages/cosmic-proto/proto/agoric/vbank/vbank.proto b/packages/cosmic-proto/proto/agoric/vbank/vbank.proto index 7884abecc9ac..6af352da81e5 100644 --- a/packages/cosmic-proto/proto/agoric/vbank/vbank.proto +++ b/packages/cosmic-proto/proto/agoric/vbank/vbank.proto @@ -33,6 +33,13 @@ message Params { int64 reward_smoothing_blocks = 3 [ (gogoproto.moretags) = "yaml:\"reward_smoothing_blocks\"" ]; + + // allowed_monitoring_accounts is an array of account addresses that can be + // monitored for sends and receives. An element of `"*"` will permit any + // address. An element of `"!"` will deny all addresses. + repeated string allowed_monitoring_accounts = 4 [ + (gogoproto.moretags) = "yaml:\"allowed_monitoring_accounts\"" + ]; } // The current state of the module. diff --git a/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts b/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts index 96d8b2bcd459..4fa1d354a767 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts @@ -23,6 +23,12 @@ export interface Params { * reward_epoch_duration_blocks. */ rewardSmoothingBlocks: bigint; + /** + * allowed_monitoring_accounts is an array of account addresses that can be + * monitored for sends and receives. An element of `"*"` will permit any + * address. An element of `"!"` will deny all addresses. + */ + allowedMonitoringAccounts: string[]; } export interface ParamsProtoMsg { typeUrl: '/agoric.vbank.Params'; @@ -33,6 +39,7 @@ export interface ParamsSDKType { reward_epoch_duration_blocks: bigint; per_epoch_reward_fraction: string; reward_smoothing_blocks: bigint; + allowed_monitoring_accounts: string[]; } /** The current state of the module. */ export interface State { @@ -67,6 +74,7 @@ function createBaseParams(): Params { rewardEpochDurationBlocks: BigInt(0), perEpochRewardFraction: '', rewardSmoothingBlocks: BigInt(0), + allowedMonitoringAccounts: [], }; } export const Params = { @@ -88,6 +96,9 @@ export const Params = { if (message.rewardSmoothingBlocks !== BigInt(0)) { writer.uint32(24).int64(message.rewardSmoothingBlocks); } + for (const v of message.allowedMonitoringAccounts) { + writer.uint32(34).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -110,6 +121,9 @@ export const Params = { case 3: message.rewardSmoothingBlocks = reader.int64(); break; + case 4: + message.allowedMonitoringAccounts.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -128,6 +142,11 @@ export const Params = { rewardSmoothingBlocks: isSet(object.rewardSmoothingBlocks) ? BigInt(object.rewardSmoothingBlocks.toString()) : BigInt(0), + allowedMonitoringAccounts: Array.isArray( + object?.allowedMonitoringAccounts, + ) + ? object.allowedMonitoringAccounts.map((e: any) => String(e)) + : [], }; }, toJSON(message: Params): JsonSafe { @@ -142,6 +161,13 @@ export const Params = { (obj.rewardSmoothingBlocks = ( message.rewardSmoothingBlocks || BigInt(0) ).toString()); + if (message.allowedMonitoringAccounts) { + obj.allowedMonitoringAccounts = message.allowedMonitoringAccounts.map( + e => e, + ); + } else { + obj.allowedMonitoringAccounts = []; + } return obj; }, fromPartial(object: Partial): Params { @@ -157,6 +183,8 @@ export const Params = { object.rewardSmoothingBlocks !== null ? BigInt(object.rewardSmoothingBlocks.toString()) : BigInt(0); + message.allowedMonitoringAccounts = + object.allowedMonitoringAccounts?.map(e => e) || []; return message; }, fromProtoMsg(message: ParamsProtoMsg): Params {