github.com/InjectiveLabs/sdk-go@v1.53.0/chain/wasmx/types/wasmx.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: injective/wasmx/v1/wasmx.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 types "github.com/CosmWasm/wasmd/x/wasm/types" 9 _ "github.com/cosmos/cosmos-sdk/types/tx/amino" 10 _ "github.com/cosmos/gogoproto/gogoproto" 11 proto "github.com/cosmos/gogoproto/proto" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 type Params struct { 29 // Set the status to active to indicate that contracts can be executed in 30 // begin blocker. 31 IsExecutionEnabled bool `protobuf:"varint,1,opt,name=is_execution_enabled,json=isExecutionEnabled,proto3" json:"is_execution_enabled,omitempty"` 32 // Maximum aggregate total gas to be used for the contract executions in the 33 // BeginBlocker. 34 MaxBeginBlockTotalGas uint64 `protobuf:"varint,2,opt,name=max_begin_block_total_gas,json=maxBeginBlockTotalGas,proto3" json:"max_begin_block_total_gas,omitempty"` 35 // the maximum gas limit each individual contract can consume in the 36 // BeginBlocker. 37 MaxContractGasLimit uint64 `protobuf:"varint,3,opt,name=max_contract_gas_limit,json=maxContractGasLimit,proto3" json:"max_contract_gas_limit,omitempty"` 38 // min_gas_price defines the minimum gas price the contracts must pay to be 39 // executed in the BeginBlocker. 40 MinGasPrice uint64 `protobuf:"varint,4,opt,name=min_gas_price,json=minGasPrice,proto3" json:"min_gas_price,omitempty"` 41 RegisterContractAccess types.AccessConfig `protobuf:"bytes,5,opt,name=register_contract_access,json=registerContractAccess,proto3" json:"register_contract_access" yaml:"register_contract_access"` 42 } 43 44 func (m *Params) Reset() { *m = Params{} } 45 func (m *Params) String() string { return proto.CompactTextString(m) } 46 func (*Params) ProtoMessage() {} 47 func (*Params) Descriptor() ([]byte, []int) { 48 return fileDescriptor_6818ff331f2cddc4, []int{0} 49 } 50 func (m *Params) XXX_Unmarshal(b []byte) error { 51 return m.Unmarshal(b) 52 } 53 func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 54 if deterministic { 55 return xxx_messageInfo_Params.Marshal(b, m, deterministic) 56 } else { 57 b = b[:cap(b)] 58 n, err := m.MarshalToSizedBuffer(b) 59 if err != nil { 60 return nil, err 61 } 62 return b[:n], nil 63 } 64 } 65 func (m *Params) XXX_Merge(src proto.Message) { 66 xxx_messageInfo_Params.Merge(m, src) 67 } 68 func (m *Params) XXX_Size() int { 69 return m.Size() 70 } 71 func (m *Params) XXX_DiscardUnknown() { 72 xxx_messageInfo_Params.DiscardUnknown(m) 73 } 74 75 var xxx_messageInfo_Params proto.InternalMessageInfo 76 77 func (m *Params) GetIsExecutionEnabled() bool { 78 if m != nil { 79 return m.IsExecutionEnabled 80 } 81 return false 82 } 83 84 func (m *Params) GetMaxBeginBlockTotalGas() uint64 { 85 if m != nil { 86 return m.MaxBeginBlockTotalGas 87 } 88 return 0 89 } 90 91 func (m *Params) GetMaxContractGasLimit() uint64 { 92 if m != nil { 93 return m.MaxContractGasLimit 94 } 95 return 0 96 } 97 98 func (m *Params) GetMinGasPrice() uint64 { 99 if m != nil { 100 return m.MinGasPrice 101 } 102 return 0 103 } 104 105 func (m *Params) GetRegisterContractAccess() types.AccessConfig { 106 if m != nil { 107 return m.RegisterContractAccess 108 } 109 return types.AccessConfig{} 110 } 111 112 type RegisteredContract struct { 113 // limit of gas per BB execution 114 GasLimit uint64 `protobuf:"varint,1,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` 115 // gas price that contract is willing to pay for execution in BeginBlocker 116 GasPrice uint64 `protobuf:"varint,2,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` 117 // is contract currently active 118 IsExecutable bool `protobuf:"varint,3,opt,name=is_executable,json=isExecutable,proto3" json:"is_executable,omitempty"` 119 // code_id that is allowed to be executed (to prevent malicious updates) - if 120 // nil/0 any code_id can be executed 121 CodeId uint64 `protobuf:"varint,4,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` 122 // optional - admin addr that is allowed to update contract data 123 AdminAddress string `protobuf:"bytes,5,opt,name=admin_address,json=adminAddress,proto3" json:"admin_address,omitempty"` 124 // Optional: address of the contract granting fee 125 // Must be set if fund_mode is GrantOnly 126 GranterAddress string `protobuf:"bytes,6,opt,name=granter_address,json=granterAddress,proto3" json:"granter_address,omitempty"` 127 // funding mode 128 FundMode FundingMode `protobuf:"varint,7,opt,name=fund_mode,json=fundMode,proto3,enum=injective.wasmx.v1.FundingMode" json:"fund_mode,omitempty"` 129 } 130 131 func (m *RegisteredContract) Reset() { *m = RegisteredContract{} } 132 func (m *RegisteredContract) String() string { return proto.CompactTextString(m) } 133 func (*RegisteredContract) ProtoMessage() {} 134 func (*RegisteredContract) Descriptor() ([]byte, []int) { 135 return fileDescriptor_6818ff331f2cddc4, []int{1} 136 } 137 func (m *RegisteredContract) XXX_Unmarshal(b []byte) error { 138 return m.Unmarshal(b) 139 } 140 func (m *RegisteredContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 141 if deterministic { 142 return xxx_messageInfo_RegisteredContract.Marshal(b, m, deterministic) 143 } else { 144 b = b[:cap(b)] 145 n, err := m.MarshalToSizedBuffer(b) 146 if err != nil { 147 return nil, err 148 } 149 return b[:n], nil 150 } 151 } 152 func (m *RegisteredContract) XXX_Merge(src proto.Message) { 153 xxx_messageInfo_RegisteredContract.Merge(m, src) 154 } 155 func (m *RegisteredContract) XXX_Size() int { 156 return m.Size() 157 } 158 func (m *RegisteredContract) XXX_DiscardUnknown() { 159 xxx_messageInfo_RegisteredContract.DiscardUnknown(m) 160 } 161 162 var xxx_messageInfo_RegisteredContract proto.InternalMessageInfo 163 164 func (m *RegisteredContract) GetGasLimit() uint64 { 165 if m != nil { 166 return m.GasLimit 167 } 168 return 0 169 } 170 171 func (m *RegisteredContract) GetGasPrice() uint64 { 172 if m != nil { 173 return m.GasPrice 174 } 175 return 0 176 } 177 178 func (m *RegisteredContract) GetIsExecutable() bool { 179 if m != nil { 180 return m.IsExecutable 181 } 182 return false 183 } 184 185 func (m *RegisteredContract) GetCodeId() uint64 { 186 if m != nil { 187 return m.CodeId 188 } 189 return 0 190 } 191 192 func (m *RegisteredContract) GetAdminAddress() string { 193 if m != nil { 194 return m.AdminAddress 195 } 196 return "" 197 } 198 199 func (m *RegisteredContract) GetGranterAddress() string { 200 if m != nil { 201 return m.GranterAddress 202 } 203 return "" 204 } 205 206 func (m *RegisteredContract) GetFundMode() FundingMode { 207 if m != nil { 208 return m.FundMode 209 } 210 return FundingMode_Unspecified 211 } 212 213 func init() { 214 proto.RegisterType((*Params)(nil), "injective.wasmx.v1.Params") 215 proto.RegisterType((*RegisteredContract)(nil), "injective.wasmx.v1.RegisteredContract") 216 } 217 218 func init() { proto.RegisterFile("injective/wasmx/v1/wasmx.proto", fileDescriptor_6818ff331f2cddc4) } 219 220 var fileDescriptor_6818ff331f2cddc4 = []byte{ 221 // 588 bytes of a gzipped FileDescriptorProto 222 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x3f, 0x6f, 0xd4, 0x30, 223 0x18, 0xc6, 0xcf, 0xc7, 0x71, 0xbd, 0xba, 0x7f, 0x10, 0xa6, 0xad, 0x42, 0x81, 0xdc, 0x71, 0x2c, 224 0x47, 0x45, 0x13, 0xda, 0x2e, 0xa8, 0x62, 0xe9, 0x55, 0xa5, 0xaa, 0x28, 0x52, 0x15, 0x31, 0xb1, 225 0x44, 0x8e, 0xed, 0xa6, 0x86, 0xd8, 0x3e, 0xc5, 0xb9, 0xe3, 0xfa, 0x05, 0x18, 0x98, 0xf8, 0x08, 226 0x8c, 0x8c, 0xfd, 0x18, 0x1d, 0x3b, 0x32, 0x55, 0xa8, 0x1d, 0xca, 0xc2, 0xc2, 0x27, 0x40, 0xb6, 227 0x93, 0x6b, 0x25, 0x60, 0x89, 0x9c, 0xf7, 0xf7, 0x3c, 0xaf, 0xf3, 0x3e, 0x8e, 0xa1, 0xcf, 0xe5, 228 0x7b, 0x46, 0x0a, 0x3e, 0x62, 0xe1, 0x47, 0xac, 0xc5, 0x38, 0x1c, 0xad, 0xb9, 0x45, 0x30, 0xc8, 229 0x55, 0xa1, 0x10, 0x9a, 0xf0, 0xc0, 0x95, 0x47, 0x6b, 0xcb, 0x0b, 0xa9, 0x4a, 0x95, 0xc5, 0xa1, 230 0x59, 0x39, 0xe5, 0xf2, 0x43, 0xa2, 0xb4, 0x30, 0x1a, 0xeb, 0x37, 0x7d, 0x8a, 0xe3, 0x01, 0xd3, 231 0x25, 0xbd, 0x8b, 0x05, 0x97, 0x2a, 0xb4, 0xcf, 0xb2, 0xf4, 0xf8, 0x1f, 0x5b, 0x0f, 0x72, 0x35, 232 0x50, 0x1a, 0x67, 0x4e, 0xd2, 0xfd, 0x55, 0x87, 0xcd, 0x03, 0x9c, 0x63, 0xa1, 0xd1, 0x73, 0xb8, 233 0xc0, 0x75, 0xcc, 0xc6, 0x8c, 0x0c, 0x0b, 0xae, 0x64, 0xcc, 0x24, 0x4e, 0x32, 0x46, 0x3d, 0xd0, 234 0x01, 0xbd, 0x56, 0x84, 0xb8, 0xde, 0xa9, 0xd0, 0x8e, 0x23, 0xe8, 0x05, 0xbc, 0x2f, 0xf0, 0x38, 235 0x4e, 0x58, 0xca, 0x65, 0x9c, 0x64, 0x8a, 0x7c, 0x88, 0x0b, 0x55, 0xe0, 0x2c, 0x4e, 0xb1, 0xf6, 236 0xea, 0x1d, 0xd0, 0x6b, 0x44, 0x8b, 0x02, 0x8f, 0xfb, 0x86, 0xf7, 0x0d, 0x7e, 0x6b, 0xe8, 0x2e, 237 0xd6, 0x68, 0x03, 0x2e, 0x19, 0x27, 0x51, 0xb2, 0xc8, 0x31, 0x29, 0x8c, 0x21, 0xce, 0xb8, 0xe0, 238 0x85, 0x77, 0xcb, 0xda, 0xee, 0x09, 0x3c, 0xde, 0x2e, 0xe1, 0x2e, 0xd6, 0xfb, 0x06, 0xa1, 0x2e, 239 0x9c, 0x13, 0x5c, 0x5a, 0xed, 0x20, 0xe7, 0x84, 0x79, 0x0d, 0xab, 0x9d, 0x11, 0x5c, 0xee, 0x62, 240 0x7d, 0x60, 0x4a, 0xe8, 0x13, 0x80, 0x5e, 0xce, 0x52, 0xae, 0x0b, 0x96, 0x5f, 0xb7, 0xc7, 0x84, 241 0x30, 0xad, 0xbd, 0xdb, 0x1d, 0xd0, 0x9b, 0x59, 0xf7, 0x83, 0x2a, 0x47, 0x1b, 0x78, 0x30, 0x5a, 242 0x0b, 0xb6, 0x2c, 0xdf, 0x56, 0xf2, 0x90, 0xa7, 0xfd, 0x67, 0xa7, 0xe7, 0xed, 0xda, 0xef, 0xf3, 243 0x76, 0xfb, 0x18, 0x8b, 0x6c, 0xb3, 0xfb, 0xbf, 0x6e, 0xdd, 0x6f, 0x57, 0x27, 0x2b, 0x20, 0x5a, 244 0xaa, 0x78, 0xf5, 0xb9, 0xae, 0xd7, 0xe6, 0xe2, 0xcf, 0xaf, 0x6d, 0xf0, 0xf9, 0xea, 0x64, 0x65, 245 0xd6, 0x45, 0xef, 0x42, 0xee, 0x9e, 0xd4, 0x21, 0x8a, 0x4a, 0x07, 0xa3, 0x95, 0x07, 0x3d, 0x80, 246 0xd3, 0xd7, 0x11, 0x00, 0x3b, 0x56, 0x2b, 0xad, 0xe6, 0x2e, 0xa1, 0x9b, 0xb9, 0x3e, 0x81, 0x6e, 247 0xe0, 0x27, 0x70, 0x6e, 0x72, 0x6a, 0xe6, 0x54, 0x6c, 0x80, 0xad, 0x68, 0xb6, 0x3a, 0x2e, 0x53, 248 0x43, 0x8f, 0xe0, 0x14, 0x51, 0x94, 0xc5, 0x9c, 0xba, 0xcc, 0xfa, 0x8d, 0xd3, 0xf3, 0x36, 0x88, 249 0x9a, 0xa6, 0xb8, 0x47, 0xd1, 0x53, 0x38, 0x87, 0xa9, 0x89, 0x16, 0x53, 0x9a, 0x57, 0x41, 0x4d, 250 0x97, 0xa2, 0x59, 0x8b, 0xb6, 0x1c, 0x41, 0xab, 0xf0, 0x4e, 0x9a, 0x63, 0x69, 0xf2, 0xa8, 0xc4, 251 0xcd, 0x1b, 0xe2, 0xf9, 0x12, 0x56, 0xf2, 0x97, 0x70, 0xfa, 0x70, 0x28, 0x69, 0x2c, 0x14, 0x65, 252 0xde, 0x54, 0x07, 0xf4, 0xe6, 0xd7, 0xdb, 0xc1, 0xdf, 0x3f, 0x7c, 0xf0, 0x6a, 0x28, 0x29, 0x97, 253 0xe9, 0x1b, 0x45, 0x59, 0xd4, 0x32, 0x0e, 0xb3, 0xda, 0x6c, 0x98, 0x0c, 0xfb, 0xec, 0xf4, 0xc2, 254 0x07, 0x67, 0x17, 0x3e, 0xf8, 0x71, 0xe1, 0x83, 0x2f, 0x97, 0x7e, 0xed, 0xec, 0xd2, 0xaf, 0x7d, 255 0xbf, 0xf4, 0x6b, 0xef, 0x5e, 0xa7, 0xbc, 0x38, 0x1a, 0x26, 0x01, 0x51, 0x22, 0xdc, 0xab, 0x9a, 256 0xee, 0xe3, 0x44, 0x87, 0x93, 0x2d, 0x56, 0x89, 0xca, 0xd9, 0xcd, 0xd7, 0x23, 0xcc, 0x65, 0x28, 257 0x14, 0x1d, 0x66, 0x4c, 0x97, 0xb7, 0xc2, 0xde, 0xa2, 0xa4, 0x69, 0x2f, 0xc4, 0xc6, 0x9f, 0x00, 258 0x00, 0x00, 0xff, 0xff, 0x2d, 0xc0, 0xef, 0x9c, 0xb0, 0x03, 0x00, 0x00, 259 } 260 261 func (this *Params) Equal(that interface{}) bool { 262 if that == nil { 263 return this == nil 264 } 265 266 that1, ok := that.(*Params) 267 if !ok { 268 that2, ok := that.(Params) 269 if ok { 270 that1 = &that2 271 } else { 272 return false 273 } 274 } 275 if that1 == nil { 276 return this == nil 277 } else if this == nil { 278 return false 279 } 280 if this.IsExecutionEnabled != that1.IsExecutionEnabled { 281 return false 282 } 283 if this.MaxBeginBlockTotalGas != that1.MaxBeginBlockTotalGas { 284 return false 285 } 286 if this.MaxContractGasLimit != that1.MaxContractGasLimit { 287 return false 288 } 289 if this.MinGasPrice != that1.MinGasPrice { 290 return false 291 } 292 if !this.RegisterContractAccess.Equal(&that1.RegisterContractAccess) { 293 return false 294 } 295 return true 296 } 297 func (this *RegisteredContract) Equal(that interface{}) bool { 298 if that == nil { 299 return this == nil 300 } 301 302 that1, ok := that.(*RegisteredContract) 303 if !ok { 304 that2, ok := that.(RegisteredContract) 305 if ok { 306 that1 = &that2 307 } else { 308 return false 309 } 310 } 311 if that1 == nil { 312 return this == nil 313 } else if this == nil { 314 return false 315 } 316 if this.GasLimit != that1.GasLimit { 317 return false 318 } 319 if this.GasPrice != that1.GasPrice { 320 return false 321 } 322 if this.IsExecutable != that1.IsExecutable { 323 return false 324 } 325 if this.CodeId != that1.CodeId { 326 return false 327 } 328 if this.AdminAddress != that1.AdminAddress { 329 return false 330 } 331 if this.GranterAddress != that1.GranterAddress { 332 return false 333 } 334 if this.FundMode != that1.FundMode { 335 return false 336 } 337 return true 338 } 339 func (m *Params) Marshal() (dAtA []byte, err error) { 340 size := m.Size() 341 dAtA = make([]byte, size) 342 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 343 if err != nil { 344 return nil, err 345 } 346 return dAtA[:n], nil 347 } 348 349 func (m *Params) MarshalTo(dAtA []byte) (int, error) { 350 size := m.Size() 351 return m.MarshalToSizedBuffer(dAtA[:size]) 352 } 353 354 func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { 355 i := len(dAtA) 356 _ = i 357 var l int 358 _ = l 359 { 360 size, err := m.RegisterContractAccess.MarshalToSizedBuffer(dAtA[:i]) 361 if err != nil { 362 return 0, err 363 } 364 i -= size 365 i = encodeVarintWasmx(dAtA, i, uint64(size)) 366 } 367 i-- 368 dAtA[i] = 0x2a 369 if m.MinGasPrice != 0 { 370 i = encodeVarintWasmx(dAtA, i, uint64(m.MinGasPrice)) 371 i-- 372 dAtA[i] = 0x20 373 } 374 if m.MaxContractGasLimit != 0 { 375 i = encodeVarintWasmx(dAtA, i, uint64(m.MaxContractGasLimit)) 376 i-- 377 dAtA[i] = 0x18 378 } 379 if m.MaxBeginBlockTotalGas != 0 { 380 i = encodeVarintWasmx(dAtA, i, uint64(m.MaxBeginBlockTotalGas)) 381 i-- 382 dAtA[i] = 0x10 383 } 384 if m.IsExecutionEnabled { 385 i-- 386 if m.IsExecutionEnabled { 387 dAtA[i] = 1 388 } else { 389 dAtA[i] = 0 390 } 391 i-- 392 dAtA[i] = 0x8 393 } 394 return len(dAtA) - i, nil 395 } 396 397 func (m *RegisteredContract) Marshal() (dAtA []byte, err error) { 398 size := m.Size() 399 dAtA = make([]byte, size) 400 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 401 if err != nil { 402 return nil, err 403 } 404 return dAtA[:n], nil 405 } 406 407 func (m *RegisteredContract) MarshalTo(dAtA []byte) (int, error) { 408 size := m.Size() 409 return m.MarshalToSizedBuffer(dAtA[:size]) 410 } 411 412 func (m *RegisteredContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { 413 i := len(dAtA) 414 _ = i 415 var l int 416 _ = l 417 if m.FundMode != 0 { 418 i = encodeVarintWasmx(dAtA, i, uint64(m.FundMode)) 419 i-- 420 dAtA[i] = 0x38 421 } 422 if len(m.GranterAddress) > 0 { 423 i -= len(m.GranterAddress) 424 copy(dAtA[i:], m.GranterAddress) 425 i = encodeVarintWasmx(dAtA, i, uint64(len(m.GranterAddress))) 426 i-- 427 dAtA[i] = 0x32 428 } 429 if len(m.AdminAddress) > 0 { 430 i -= len(m.AdminAddress) 431 copy(dAtA[i:], m.AdminAddress) 432 i = encodeVarintWasmx(dAtA, i, uint64(len(m.AdminAddress))) 433 i-- 434 dAtA[i] = 0x2a 435 } 436 if m.CodeId != 0 { 437 i = encodeVarintWasmx(dAtA, i, uint64(m.CodeId)) 438 i-- 439 dAtA[i] = 0x20 440 } 441 if m.IsExecutable { 442 i-- 443 if m.IsExecutable { 444 dAtA[i] = 1 445 } else { 446 dAtA[i] = 0 447 } 448 i-- 449 dAtA[i] = 0x18 450 } 451 if m.GasPrice != 0 { 452 i = encodeVarintWasmx(dAtA, i, uint64(m.GasPrice)) 453 i-- 454 dAtA[i] = 0x10 455 } 456 if m.GasLimit != 0 { 457 i = encodeVarintWasmx(dAtA, i, uint64(m.GasLimit)) 458 i-- 459 dAtA[i] = 0x8 460 } 461 return len(dAtA) - i, nil 462 } 463 464 func encodeVarintWasmx(dAtA []byte, offset int, v uint64) int { 465 offset -= sovWasmx(v) 466 base := offset 467 for v >= 1<<7 { 468 dAtA[offset] = uint8(v&0x7f | 0x80) 469 v >>= 7 470 offset++ 471 } 472 dAtA[offset] = uint8(v) 473 return base 474 } 475 func (m *Params) Size() (n int) { 476 if m == nil { 477 return 0 478 } 479 var l int 480 _ = l 481 if m.IsExecutionEnabled { 482 n += 2 483 } 484 if m.MaxBeginBlockTotalGas != 0 { 485 n += 1 + sovWasmx(uint64(m.MaxBeginBlockTotalGas)) 486 } 487 if m.MaxContractGasLimit != 0 { 488 n += 1 + sovWasmx(uint64(m.MaxContractGasLimit)) 489 } 490 if m.MinGasPrice != 0 { 491 n += 1 + sovWasmx(uint64(m.MinGasPrice)) 492 } 493 l = m.RegisterContractAccess.Size() 494 n += 1 + l + sovWasmx(uint64(l)) 495 return n 496 } 497 498 func (m *RegisteredContract) Size() (n int) { 499 if m == nil { 500 return 0 501 } 502 var l int 503 _ = l 504 if m.GasLimit != 0 { 505 n += 1 + sovWasmx(uint64(m.GasLimit)) 506 } 507 if m.GasPrice != 0 { 508 n += 1 + sovWasmx(uint64(m.GasPrice)) 509 } 510 if m.IsExecutable { 511 n += 2 512 } 513 if m.CodeId != 0 { 514 n += 1 + sovWasmx(uint64(m.CodeId)) 515 } 516 l = len(m.AdminAddress) 517 if l > 0 { 518 n += 1 + l + sovWasmx(uint64(l)) 519 } 520 l = len(m.GranterAddress) 521 if l > 0 { 522 n += 1 + l + sovWasmx(uint64(l)) 523 } 524 if m.FundMode != 0 { 525 n += 1 + sovWasmx(uint64(m.FundMode)) 526 } 527 return n 528 } 529 530 func sovWasmx(x uint64) (n int) { 531 return (math_bits.Len64(x|1) + 6) / 7 532 } 533 func sozWasmx(x uint64) (n int) { 534 return sovWasmx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 535 } 536 func (m *Params) Unmarshal(dAtA []byte) error { 537 l := len(dAtA) 538 iNdEx := 0 539 for iNdEx < l { 540 preIndex := iNdEx 541 var wire uint64 542 for shift := uint(0); ; shift += 7 { 543 if shift >= 64 { 544 return ErrIntOverflowWasmx 545 } 546 if iNdEx >= l { 547 return io.ErrUnexpectedEOF 548 } 549 b := dAtA[iNdEx] 550 iNdEx++ 551 wire |= uint64(b&0x7F) << shift 552 if b < 0x80 { 553 break 554 } 555 } 556 fieldNum := int32(wire >> 3) 557 wireType := int(wire & 0x7) 558 if wireType == 4 { 559 return fmt.Errorf("proto: Params: wiretype end group for non-group") 560 } 561 if fieldNum <= 0 { 562 return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) 563 } 564 switch fieldNum { 565 case 1: 566 if wireType != 0 { 567 return fmt.Errorf("proto: wrong wireType = %d for field IsExecutionEnabled", wireType) 568 } 569 var v int 570 for shift := uint(0); ; shift += 7 { 571 if shift >= 64 { 572 return ErrIntOverflowWasmx 573 } 574 if iNdEx >= l { 575 return io.ErrUnexpectedEOF 576 } 577 b := dAtA[iNdEx] 578 iNdEx++ 579 v |= int(b&0x7F) << shift 580 if b < 0x80 { 581 break 582 } 583 } 584 m.IsExecutionEnabled = bool(v != 0) 585 case 2: 586 if wireType != 0 { 587 return fmt.Errorf("proto: wrong wireType = %d for field MaxBeginBlockTotalGas", wireType) 588 } 589 m.MaxBeginBlockTotalGas = 0 590 for shift := uint(0); ; shift += 7 { 591 if shift >= 64 { 592 return ErrIntOverflowWasmx 593 } 594 if iNdEx >= l { 595 return io.ErrUnexpectedEOF 596 } 597 b := dAtA[iNdEx] 598 iNdEx++ 599 m.MaxBeginBlockTotalGas |= uint64(b&0x7F) << shift 600 if b < 0x80 { 601 break 602 } 603 } 604 case 3: 605 if wireType != 0 { 606 return fmt.Errorf("proto: wrong wireType = %d for field MaxContractGasLimit", wireType) 607 } 608 m.MaxContractGasLimit = 0 609 for shift := uint(0); ; shift += 7 { 610 if shift >= 64 { 611 return ErrIntOverflowWasmx 612 } 613 if iNdEx >= l { 614 return io.ErrUnexpectedEOF 615 } 616 b := dAtA[iNdEx] 617 iNdEx++ 618 m.MaxContractGasLimit |= uint64(b&0x7F) << shift 619 if b < 0x80 { 620 break 621 } 622 } 623 case 4: 624 if wireType != 0 { 625 return fmt.Errorf("proto: wrong wireType = %d for field MinGasPrice", wireType) 626 } 627 m.MinGasPrice = 0 628 for shift := uint(0); ; shift += 7 { 629 if shift >= 64 { 630 return ErrIntOverflowWasmx 631 } 632 if iNdEx >= l { 633 return io.ErrUnexpectedEOF 634 } 635 b := dAtA[iNdEx] 636 iNdEx++ 637 m.MinGasPrice |= uint64(b&0x7F) << shift 638 if b < 0x80 { 639 break 640 } 641 } 642 case 5: 643 if wireType != 2 { 644 return fmt.Errorf("proto: wrong wireType = %d for field RegisterContractAccess", wireType) 645 } 646 var msglen int 647 for shift := uint(0); ; shift += 7 { 648 if shift >= 64 { 649 return ErrIntOverflowWasmx 650 } 651 if iNdEx >= l { 652 return io.ErrUnexpectedEOF 653 } 654 b := dAtA[iNdEx] 655 iNdEx++ 656 msglen |= int(b&0x7F) << shift 657 if b < 0x80 { 658 break 659 } 660 } 661 if msglen < 0 { 662 return ErrInvalidLengthWasmx 663 } 664 postIndex := iNdEx + msglen 665 if postIndex < 0 { 666 return ErrInvalidLengthWasmx 667 } 668 if postIndex > l { 669 return io.ErrUnexpectedEOF 670 } 671 if err := m.RegisterContractAccess.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 672 return err 673 } 674 iNdEx = postIndex 675 default: 676 iNdEx = preIndex 677 skippy, err := skipWasmx(dAtA[iNdEx:]) 678 if err != nil { 679 return err 680 } 681 if (skippy < 0) || (iNdEx+skippy) < 0 { 682 return ErrInvalidLengthWasmx 683 } 684 if (iNdEx + skippy) > l { 685 return io.ErrUnexpectedEOF 686 } 687 iNdEx += skippy 688 } 689 } 690 691 if iNdEx > l { 692 return io.ErrUnexpectedEOF 693 } 694 return nil 695 } 696 func (m *RegisteredContract) Unmarshal(dAtA []byte) error { 697 l := len(dAtA) 698 iNdEx := 0 699 for iNdEx < l { 700 preIndex := iNdEx 701 var wire uint64 702 for shift := uint(0); ; shift += 7 { 703 if shift >= 64 { 704 return ErrIntOverflowWasmx 705 } 706 if iNdEx >= l { 707 return io.ErrUnexpectedEOF 708 } 709 b := dAtA[iNdEx] 710 iNdEx++ 711 wire |= uint64(b&0x7F) << shift 712 if b < 0x80 { 713 break 714 } 715 } 716 fieldNum := int32(wire >> 3) 717 wireType := int(wire & 0x7) 718 if wireType == 4 { 719 return fmt.Errorf("proto: RegisteredContract: wiretype end group for non-group") 720 } 721 if fieldNum <= 0 { 722 return fmt.Errorf("proto: RegisteredContract: illegal tag %d (wire type %d)", fieldNum, wire) 723 } 724 switch fieldNum { 725 case 1: 726 if wireType != 0 { 727 return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) 728 } 729 m.GasLimit = 0 730 for shift := uint(0); ; shift += 7 { 731 if shift >= 64 { 732 return ErrIntOverflowWasmx 733 } 734 if iNdEx >= l { 735 return io.ErrUnexpectedEOF 736 } 737 b := dAtA[iNdEx] 738 iNdEx++ 739 m.GasLimit |= uint64(b&0x7F) << shift 740 if b < 0x80 { 741 break 742 } 743 } 744 case 2: 745 if wireType != 0 { 746 return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) 747 } 748 m.GasPrice = 0 749 for shift := uint(0); ; shift += 7 { 750 if shift >= 64 { 751 return ErrIntOverflowWasmx 752 } 753 if iNdEx >= l { 754 return io.ErrUnexpectedEOF 755 } 756 b := dAtA[iNdEx] 757 iNdEx++ 758 m.GasPrice |= uint64(b&0x7F) << shift 759 if b < 0x80 { 760 break 761 } 762 } 763 case 3: 764 if wireType != 0 { 765 return fmt.Errorf("proto: wrong wireType = %d for field IsExecutable", wireType) 766 } 767 var v int 768 for shift := uint(0); ; shift += 7 { 769 if shift >= 64 { 770 return ErrIntOverflowWasmx 771 } 772 if iNdEx >= l { 773 return io.ErrUnexpectedEOF 774 } 775 b := dAtA[iNdEx] 776 iNdEx++ 777 v |= int(b&0x7F) << shift 778 if b < 0x80 { 779 break 780 } 781 } 782 m.IsExecutable = bool(v != 0) 783 case 4: 784 if wireType != 0 { 785 return fmt.Errorf("proto: wrong wireType = %d for field CodeId", wireType) 786 } 787 m.CodeId = 0 788 for shift := uint(0); ; shift += 7 { 789 if shift >= 64 { 790 return ErrIntOverflowWasmx 791 } 792 if iNdEx >= l { 793 return io.ErrUnexpectedEOF 794 } 795 b := dAtA[iNdEx] 796 iNdEx++ 797 m.CodeId |= uint64(b&0x7F) << shift 798 if b < 0x80 { 799 break 800 } 801 } 802 case 5: 803 if wireType != 2 { 804 return fmt.Errorf("proto: wrong wireType = %d for field AdminAddress", wireType) 805 } 806 var stringLen uint64 807 for shift := uint(0); ; shift += 7 { 808 if shift >= 64 { 809 return ErrIntOverflowWasmx 810 } 811 if iNdEx >= l { 812 return io.ErrUnexpectedEOF 813 } 814 b := dAtA[iNdEx] 815 iNdEx++ 816 stringLen |= uint64(b&0x7F) << shift 817 if b < 0x80 { 818 break 819 } 820 } 821 intStringLen := int(stringLen) 822 if intStringLen < 0 { 823 return ErrInvalidLengthWasmx 824 } 825 postIndex := iNdEx + intStringLen 826 if postIndex < 0 { 827 return ErrInvalidLengthWasmx 828 } 829 if postIndex > l { 830 return io.ErrUnexpectedEOF 831 } 832 m.AdminAddress = string(dAtA[iNdEx:postIndex]) 833 iNdEx = postIndex 834 case 6: 835 if wireType != 2 { 836 return fmt.Errorf("proto: wrong wireType = %d for field GranterAddress", wireType) 837 } 838 var stringLen uint64 839 for shift := uint(0); ; shift += 7 { 840 if shift >= 64 { 841 return ErrIntOverflowWasmx 842 } 843 if iNdEx >= l { 844 return io.ErrUnexpectedEOF 845 } 846 b := dAtA[iNdEx] 847 iNdEx++ 848 stringLen |= uint64(b&0x7F) << shift 849 if b < 0x80 { 850 break 851 } 852 } 853 intStringLen := int(stringLen) 854 if intStringLen < 0 { 855 return ErrInvalidLengthWasmx 856 } 857 postIndex := iNdEx + intStringLen 858 if postIndex < 0 { 859 return ErrInvalidLengthWasmx 860 } 861 if postIndex > l { 862 return io.ErrUnexpectedEOF 863 } 864 m.GranterAddress = string(dAtA[iNdEx:postIndex]) 865 iNdEx = postIndex 866 case 7: 867 if wireType != 0 { 868 return fmt.Errorf("proto: wrong wireType = %d for field FundMode", wireType) 869 } 870 m.FundMode = 0 871 for shift := uint(0); ; shift += 7 { 872 if shift >= 64 { 873 return ErrIntOverflowWasmx 874 } 875 if iNdEx >= l { 876 return io.ErrUnexpectedEOF 877 } 878 b := dAtA[iNdEx] 879 iNdEx++ 880 m.FundMode |= FundingMode(b&0x7F) << shift 881 if b < 0x80 { 882 break 883 } 884 } 885 default: 886 iNdEx = preIndex 887 skippy, err := skipWasmx(dAtA[iNdEx:]) 888 if err != nil { 889 return err 890 } 891 if (skippy < 0) || (iNdEx+skippy) < 0 { 892 return ErrInvalidLengthWasmx 893 } 894 if (iNdEx + skippy) > l { 895 return io.ErrUnexpectedEOF 896 } 897 iNdEx += skippy 898 } 899 } 900 901 if iNdEx > l { 902 return io.ErrUnexpectedEOF 903 } 904 return nil 905 } 906 func skipWasmx(dAtA []byte) (n int, err error) { 907 l := len(dAtA) 908 iNdEx := 0 909 depth := 0 910 for iNdEx < l { 911 var wire uint64 912 for shift := uint(0); ; shift += 7 { 913 if shift >= 64 { 914 return 0, ErrIntOverflowWasmx 915 } 916 if iNdEx >= l { 917 return 0, io.ErrUnexpectedEOF 918 } 919 b := dAtA[iNdEx] 920 iNdEx++ 921 wire |= (uint64(b) & 0x7F) << shift 922 if b < 0x80 { 923 break 924 } 925 } 926 wireType := int(wire & 0x7) 927 switch wireType { 928 case 0: 929 for shift := uint(0); ; shift += 7 { 930 if shift >= 64 { 931 return 0, ErrIntOverflowWasmx 932 } 933 if iNdEx >= l { 934 return 0, io.ErrUnexpectedEOF 935 } 936 iNdEx++ 937 if dAtA[iNdEx-1] < 0x80 { 938 break 939 } 940 } 941 case 1: 942 iNdEx += 8 943 case 2: 944 var length int 945 for shift := uint(0); ; shift += 7 { 946 if shift >= 64 { 947 return 0, ErrIntOverflowWasmx 948 } 949 if iNdEx >= l { 950 return 0, io.ErrUnexpectedEOF 951 } 952 b := dAtA[iNdEx] 953 iNdEx++ 954 length |= (int(b) & 0x7F) << shift 955 if b < 0x80 { 956 break 957 } 958 } 959 if length < 0 { 960 return 0, ErrInvalidLengthWasmx 961 } 962 iNdEx += length 963 case 3: 964 depth++ 965 case 4: 966 if depth == 0 { 967 return 0, ErrUnexpectedEndOfGroupWasmx 968 } 969 depth-- 970 case 5: 971 iNdEx += 4 972 default: 973 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 974 } 975 if iNdEx < 0 { 976 return 0, ErrInvalidLengthWasmx 977 } 978 if depth == 0 { 979 return iNdEx, nil 980 } 981 } 982 return 0, io.ErrUnexpectedEOF 983 } 984 985 var ( 986 ErrInvalidLengthWasmx = fmt.Errorf("proto: negative length found during unmarshaling") 987 ErrIntOverflowWasmx = fmt.Errorf("proto: integer overflow") 988 ErrUnexpectedEndOfGroupWasmx = fmt.Errorf("proto: unexpected end of group") 989 )