From 9d33f5bdf668c9856a22f08a43aaa974aa88ae97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Lehtim=C3=A4ki?= Date: Thu, 5 Sep 2024 12:11:33 +0300 Subject: [PATCH 1/5] fix(faucet): compatibility with award (#789) This fixes issue when using award (`atto`) WARD and changes dailySupply to be handled as WARD not WARD + DENOM --- cmd/faucet/faucet.go | 19 ++++++++++--------- cmd/faucet/pkg/config/config.go | 9 +++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index c0035c8f4..208b9fcaa 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -35,10 +35,9 @@ type Faucet struct { } const ( - mutexLocked = 1 - workers = 2 - uwardConversion = 1000000 - dailyHours = 24 + mutexLocked = 1 + workers = 2 + dailyHours = 24 ) func execute(cmdString string) (Out, error) { @@ -150,8 +149,8 @@ func InitFaucet(logger zerolog.Logger) (Faucet, error) { Mutex: &sync.Mutex{}, Batch: []string{}, log: logger, - TokensAvailable: float64(cfg.DailyLimit) / uwardConversion, - DailySupply: float64(cfg.DailyLimit) / uwardConversion, + TokensAvailable: float64(cfg.DailyLimit), + DailySupply: float64(cfg.DailyLimit), Amount: float64(amount), } @@ -231,9 +230,10 @@ func (f *Faucet) Send(addr string, force bool) (string, int, error) { send = "multi-send" } - f.log.Info().Msgf("sending %s%s to %v", f.config.Amount, f.config.Denom, f.Batch) + f.log.Info().Msgf("sending %s WARD to %v", f.config.Amount, f.Batch) - amount := f.config.Amount + f.config.Denom + amount := f.config.Amount + strings.Repeat("0", f.config.Decimals) + f.config.Denom + f.log.Info().Msg(amount) cmd := strings.Join([]string{ f.config.CliName, @@ -255,6 +255,7 @@ func (f *Faucet) Send(addr string, force bool) (string, int, error) { "-o", "json", }, " ") + f.log.Info().Msg(cmd) out, err := execute(cmd) if err != nil { @@ -278,7 +279,7 @@ func (f *Faucet) Send(addr string, force bool) (string, int, error) { ) } - f.TokensAvailable = (f.TokensAvailable - float64(len(f.Batch))*f.Amount/uwardConversion) + f.TokensAvailable = (f.TokensAvailable - float64(len(f.Batch))*f.Amount) f.log.Info().Msgf("tokens available: %f", f.TokensAvailable) dailySupply.Set(f.TokensAvailable) diff --git a/cmd/faucet/pkg/config/config.go b/cmd/faucet/pkg/config/config.go index 54208ed77..920177aad 100644 --- a/cmd/faucet/pkg/config/config.go +++ b/cmd/faucet/pkg/config/config.go @@ -26,15 +26,16 @@ type Config struct { ChainID string `env:"CHAIN_ID" envDefault:"buenavista-1" mapstructure:"CHAIN_ID"` CliName string `env:"CLI_NAME" envDefault:"wardend" mapstructure:"CLI_NAME"` AccountName string `env:"ACCOUNT_NAME" envDefault:"faucet" mapstructure:"ACCOUNT_NAME"` - Denom string `env:"DENOM" envDefault:"uward" mapstructure:"DENOM"` - Amount string `env:"AMOUNT" envDefault:"1000000" mapstructure:"AMOUNT"` - Fees string `env:"FEES" envDefault:"25uward" mapstructure:"FEES"` + Denom string `env:"DENOM" envDefault:"award" mapstructure:"DENOM"` + Amount string `env:"AMOUNT" envDefault:"1" mapstructure:"AMOUNT"` + Fees string `env:"FEES" envDefault:"25000000000000award" mapstructure:"FEES"` KeyringBackend string `env:"KEYRING" envDefault:"test" mapstructure:"KEYRING"` BatchInterval time.Duration `env:"BATCH_INTERVAL" envDefault:"5s" mapstructure:"BATCH_INTERVAL"` - DailyLimit int64 `env:"DAILY_LIMIT" envDefault:"100000000" mapstructure:"DAILY_LIMIT"` + DailyLimit int64 `env:"DAILY_LIMIT" envDefault:"100000" mapstructure:"DAILY_LIMIT"` BatchLimit int `env:"BATCH_LIMIT" envDefault:"10" mapstructure:"BATCH_LIMIT"` TXRetry int `env:"TX_RETRY" envDefault:"10" mapstructure:"TX_RETRY"` Chain string `env:"CHAIN" envDefault:"Buenavista" mapstructure:"CHAIN"` + Decimals int `env:"DECIMALS" envDefault:"18" mapstructure:"DECIMALS"` } func LoadConfig() (Config, error) { From c992b5941ed6819dbacff2cf79bbea4ef376a3e0 Mon Sep 17 00:00:00 2001 From: Jon Heywood <94459819+jjheywood@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:00:37 +0200 Subject: [PATCH 2/5] fix(spaceward): updated chain id for devnet (#793) --- spaceward/src/config/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spaceward/src/config/chains.ts b/spaceward/src/config/chains.ts index 9d8ff420e..0b2b9efd7 100644 --- a/spaceward/src/config/chains.ts +++ b/spaceward/src/config/chains.ts @@ -122,11 +122,11 @@ export const wardenprotocoldevnet: Chain = { status: "live", network_type: "testnet", pretty_name: "Warden Protocol (devnet)", - chain_id: "warden", + chain_id: "devnet_12345-1", bech32_prefix: "warden", daemon_name: "wardend", node_home: "$HOME/.warden", - key_algos: ["secp256k1", "ethsecp256k1"], + key_algos: ["ethsecp256k1"], slip44: 60, fees: { fee_tokens: [ From 7922d2354d7ccc6aeb59c153e2d662b393df0fb4 Mon Sep 17 00:00:00 2001 From: Max Nabokov Date: Thu, 5 Sep 2024 13:56:12 +0300 Subject: [PATCH 3/5] move evm changes to breaking (#792) --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8e1a69dc..b6e4e537d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,16 +54,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Added Keybase Id field (16 symbols) * (x/act) [#631](https://github.com/warden-protocol/wardenprotocol/631) Add pruning of timed-out actions * (x/warden) Make `KeychainFees` fields non-nullable, use an empty list of coins to indicate no fees +* (evm) Resolve dependencies issues. For go-ethereum use [evmos fork](https://github.com/evmos/go-ethereum/releases/tag/v1.10.26-evmos-rc2) patched with [c1b68f1d05a7ee8eee1bde3c4054f49f5d3e3b9f](https://github.com/ethereum/go-ethereum/pull/24911) from original repository to support slinky. +* (evm) To adopt ethsecp256k1 use fork of evmos's cosmos-sdk. Fork patched runtime/module adding into ProvideApp two arguments to customize registering interface registry and legacy amino codec. +* (evm) Introduce award denomination to adjust units with Ethereum +* (evm) Using ethsecp256k1 signature for all transactions. Users should reimport their seeds to get new addresses. * (x/act) Introduce Votes and Approve/Reject expressions for Actions ### Features (non-breaking) * (x/act) Add support for sdk.Coins fields in autogenerated CLI commands for new actions * (x/warden) Add the ability for the user to specify the maximum keychain fee size to be deducted -* (evm) Resolve dependencies issues. For go-ethereum use [evmos fork](https://github.com/evmos/go-ethereum/releases/tag/v1.10.26-evmos-rc2) patched with [c1b68f1d05a7ee8eee1bde3c4054f49f5d3e3b9f](https://github.com/ethereum/go-ethereum/pull/24911) from original repository to support slinky. -* (evm) To adopt ethsecp256k1 use fork of evmos's cosmos-sdk. Fork patched runtime/module adding into ProvideApp two arguments to customize registering interface registry and legacy amino codec. -* (evm) Introduce award denomination to adjust units with Ethereum -* (evm) Using ethsecp256k1 signature for all transactions. Users should reimport their seeds to get new addresses. * (x/warden) Return error if analyzer's address is not bech32 * (wardend) Validate bech32 format in add-genesis-keychain and add-genesis-space From 5940b07aa1a677cb7c47c0bf5635b642fb3bdc65 Mon Sep 17 00:00:00 2001 From: Antonio Pitasi Date: Thu, 5 Sep 2024 04:31:49 -0700 Subject: [PATCH 4/5] fix(spaceward): build TxRaw without StargateClient (#795) --- spaceward/src/features/actions/hooks.ts | 12 ++++------ spaceward/src/hooks/useClient.ts | 31 ++++++++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/spaceward/src/features/actions/hooks.ts b/spaceward/src/features/actions/hooks.ts index 6e671c078..66d834832 100644 --- a/spaceward/src/features/actions/hooks.ts +++ b/spaceward/src/features/actions/hooks.ts @@ -3,7 +3,7 @@ import { useChain } from "@cosmos-kit/react"; import { cosmos } from "@wardenprotocol/wardenjs"; import { createPersistantState } from "../../hooks/state"; import { useNewAction } from "../../hooks/useAction"; -import { getSigningClient, TxOptions } from "../../hooks/useClient"; +import { TxOptions, useTx } from "../../hooks/useClient"; import { env } from "../../env"; import { Action } from "@wardenprotocol/wardenjs/codegen/warden/act/v1beta1/action"; import { TransactionLike } from "ethers"; @@ -60,11 +60,9 @@ export const useActionsState = createPersistantState< export function useEnqueueAction( getMessage: ReturnType>["getMessage"], ) { - const { address, getOfflineSignerDirect: getOfflineSigner } = useChain( - env.cosmoskitChainName, - ); - + const { address } = useChain(env.cosmoskitChainName); const { setData } = useActionsState(); + const { sign } = useTx(); async function addAction( data: Parameters[0], @@ -100,11 +98,9 @@ export function useEnqueueAction( } const storeId = getActionId(); - const signer = getOfflineSigner(); - const client = await getSigningClient(signer); const msg = getMessage(data, actionTimeoutHeight); const fee = opts.fee || defaultFee; - const signedTx = await client.sign(address, [msg], fee, ""); + const signedTx = await sign([msg], { fee }); setData({ [storeId]: { diff --git a/spaceward/src/hooks/useClient.ts b/spaceward/src/hooks/useClient.ts index b61e8a886..71012012d 100755 --- a/spaceward/src/hooks/useClient.ts +++ b/spaceward/src/hooks/useClient.ts @@ -43,6 +43,19 @@ export function useTx() { const { address, getOfflineSignerDirect: getOfflineSigner, chain } = useChain(env.cosmoskitChainName); const { toast } = useToast(); + const sign = async (msgs: EncodeObject[], options: TxOptions) => { + const signer = getOfflineSigner(); + const client = await getSigningClient(signer); + + const fee = options.fee || defaultFee; + const txBody = TxBody.fromPartial({ + messages: msgs, + memo: '', + }); + + return await buildTxRaw(chain.chain_id, client, signer, txBody, fee); + } + const tx = async (msgs: EncodeObject[], options: TxOptions) => { if (!address) { toast({ @@ -52,17 +65,13 @@ export function useTx() { return; } - let signed: Uint8Array; const signer = getOfflineSigner(); const client = await getSigningClient(signer); + let signed: Uint8Array; try { - const fee = options.fee || defaultFee; - const txBody = TxBody.fromPartial({ - messages: msgs, - memo: '', - }); - signed = await buildTxRaw(chain.chain_id, client, signer, txBody, fee); + const txRaw = await sign(msgs, options); + signed = TxRaw.encode(txRaw).finish(); } catch (e: unknown) { console.error(e); toast({ @@ -79,7 +88,7 @@ export function useTx() { duration: 999999, }); - if (client && signed) { + if (signed) { try { const res = await client.broadcastTx(signed); if (isDeliverTxSuccess(res)) { @@ -122,7 +131,7 @@ export function useTx() { } }; - return { tx }; + return { tx, sign }; } export function useQueryHooks() { @@ -176,11 +185,11 @@ async function buildTxRaw( const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, Number(account.accountNumber)); const { signature, signed } = await signer.signDirect(signerAddress, signDoc); - return TxRaw.encode({ + return TxRaw.fromPartial({ bodyBytes: signed.bodyBytes, authInfoBytes: signed.authInfoBytes, signatures: [fromBase64(signature.signature)], - }).finish(); + }); } async function fetchAccount(address: string) { From 3396066f9631c6f1f4102c3661a0b12975905bda Mon Sep 17 00:00:00 2001 From: Max Nabokov Date: Thu, 5 Sep 2024 14:47:39 +0300 Subject: [PATCH 5/5] add expected approval&reject expressions to MsgNewAction (#791) * add expected approval&reject expressions to MsgNewAction * update changelog * make expected expressions not nullable * expected_approval_expression -> expected_approve_expression --- CHANGELOG.md | 1 + api/warden/act/v1beta1/tx.pulsar.go | 293 +++++++++++++++---- proto/warden/act/v1beta1/tx.proto | 5 + warden/x/act/keeper/actions.go | 5 +- warden/x/act/keeper/msg_server_new_action.go | 2 +- warden/x/act/types/v1beta1/tx.pb.go | 222 ++++++++++---- warden/x/warden/types/v1beta3/keychain.pb.go | 2 +- warden/x/warden/types/v1beta3/tx.pb.go | 64 ++-- 8 files changed, 443 insertions(+), 151 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e4e537d..826b42b33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * (evm) Introduce award denomination to adjust units with Ethereum * (evm) Using ethsecp256k1 signature for all transactions. Users should reimport their seeds to get new addresses. * (x/act) Introduce Votes and Approve/Reject expressions for Actions +* (x/act) Add expected expressions to MsgAddAction ### Features (non-breaking) diff --git a/api/warden/act/v1beta1/tx.pulsar.go b/api/warden/act/v1beta1/tx.pulsar.go index d8ad8bbfb..937bbb162 100644 --- a/api/warden/act/v1beta1/tx.pulsar.go +++ b/api/warden/act/v1beta1/tx.pulsar.go @@ -8,6 +8,7 @@ import ( _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + ast "github.com/warden-protocol/wardenprotocol/api/shield/ast" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -873,10 +874,12 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } var ( - md_MsgNewAction protoreflect.MessageDescriptor - fd_MsgNewAction_creator protoreflect.FieldDescriptor - fd_MsgNewAction_message protoreflect.FieldDescriptor - fd_MsgNewAction_action_timeout_height protoreflect.FieldDescriptor + md_MsgNewAction protoreflect.MessageDescriptor + fd_MsgNewAction_creator protoreflect.FieldDescriptor + fd_MsgNewAction_message protoreflect.FieldDescriptor + fd_MsgNewAction_action_timeout_height protoreflect.FieldDescriptor + fd_MsgNewAction_expected_approve_expression protoreflect.FieldDescriptor + fd_MsgNewAction_expected_reject_expression protoreflect.FieldDescriptor ) func init() { @@ -885,6 +888,8 @@ func init() { fd_MsgNewAction_creator = md_MsgNewAction.Fields().ByName("creator") fd_MsgNewAction_message = md_MsgNewAction.Fields().ByName("message") fd_MsgNewAction_action_timeout_height = md_MsgNewAction.Fields().ByName("action_timeout_height") + fd_MsgNewAction_expected_approve_expression = md_MsgNewAction.Fields().ByName("expected_approve_expression") + fd_MsgNewAction_expected_reject_expression = md_MsgNewAction.Fields().ByName("expected_reject_expression") } var _ protoreflect.Message = (*fastReflection_MsgNewAction)(nil) @@ -970,6 +975,18 @@ func (x *fastReflection_MsgNewAction) Range(f func(protoreflect.FieldDescriptor, return } } + if x.ExpectedApproveExpression != nil { + value := protoreflect.ValueOfMessage(x.ExpectedApproveExpression.ProtoReflect()) + if !f(fd_MsgNewAction_expected_approve_expression, value) { + return + } + } + if x.ExpectedRejectExpression != nil { + value := protoreflect.ValueOfMessage(x.ExpectedRejectExpression.ProtoReflect()) + if !f(fd_MsgNewAction_expected_reject_expression, value) { + return + } + } } // Has reports whether a field is populated. @@ -991,6 +1008,10 @@ func (x *fastReflection_MsgNewAction) Has(fd protoreflect.FieldDescriptor) bool return x.Message != nil case "warden.act.v1beta1.MsgNewAction.action_timeout_height": return x.ActionTimeoutHeight != uint64(0) + case "warden.act.v1beta1.MsgNewAction.expected_approve_expression": + return x.ExpectedApproveExpression != nil + case "warden.act.v1beta1.MsgNewAction.expected_reject_expression": + return x.ExpectedRejectExpression != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgNewAction")) @@ -1013,6 +1034,10 @@ func (x *fastReflection_MsgNewAction) Clear(fd protoreflect.FieldDescriptor) { x.Message = nil case "warden.act.v1beta1.MsgNewAction.action_timeout_height": x.ActionTimeoutHeight = uint64(0) + case "warden.act.v1beta1.MsgNewAction.expected_approve_expression": + x.ExpectedApproveExpression = nil + case "warden.act.v1beta1.MsgNewAction.expected_reject_expression": + x.ExpectedRejectExpression = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgNewAction")) @@ -1038,6 +1063,12 @@ func (x *fastReflection_MsgNewAction) Get(descriptor protoreflect.FieldDescripto case "warden.act.v1beta1.MsgNewAction.action_timeout_height": value := x.ActionTimeoutHeight return protoreflect.ValueOfUint64(value) + case "warden.act.v1beta1.MsgNewAction.expected_approve_expression": + value := x.ExpectedApproveExpression + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "warden.act.v1beta1.MsgNewAction.expected_reject_expression": + value := x.ExpectedRejectExpression + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgNewAction")) @@ -1064,6 +1095,10 @@ func (x *fastReflection_MsgNewAction) Set(fd protoreflect.FieldDescriptor, value x.Message = value.Message().Interface().(*anypb.Any) case "warden.act.v1beta1.MsgNewAction.action_timeout_height": x.ActionTimeoutHeight = value.Uint() + case "warden.act.v1beta1.MsgNewAction.expected_approve_expression": + x.ExpectedApproveExpression = value.Message().Interface().(*ast.Expression) + case "warden.act.v1beta1.MsgNewAction.expected_reject_expression": + x.ExpectedRejectExpression = value.Message().Interface().(*ast.Expression) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgNewAction")) @@ -1089,6 +1124,16 @@ func (x *fastReflection_MsgNewAction) Mutable(fd protoreflect.FieldDescriptor) p x.Message = new(anypb.Any) } return protoreflect.ValueOfMessage(x.Message.ProtoReflect()) + case "warden.act.v1beta1.MsgNewAction.expected_approve_expression": + if x.ExpectedApproveExpression == nil { + x.ExpectedApproveExpression = new(ast.Expression) + } + return protoreflect.ValueOfMessage(x.ExpectedApproveExpression.ProtoReflect()) + case "warden.act.v1beta1.MsgNewAction.expected_reject_expression": + if x.ExpectedRejectExpression == nil { + x.ExpectedRejectExpression = new(ast.Expression) + } + return protoreflect.ValueOfMessage(x.ExpectedRejectExpression.ProtoReflect()) case "warden.act.v1beta1.MsgNewAction.creator": panic(fmt.Errorf("field creator of message warden.act.v1beta1.MsgNewAction is not mutable")) case "warden.act.v1beta1.MsgNewAction.action_timeout_height": @@ -1113,6 +1158,12 @@ func (x *fastReflection_MsgNewAction) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "warden.act.v1beta1.MsgNewAction.action_timeout_height": return protoreflect.ValueOfUint64(uint64(0)) + case "warden.act.v1beta1.MsgNewAction.expected_approve_expression": + m := new(ast.Expression) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "warden.act.v1beta1.MsgNewAction.expected_reject_expression": + m := new(ast.Expression) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: warden.act.v1beta1.MsgNewAction")) @@ -1193,6 +1244,14 @@ func (x *fastReflection_MsgNewAction) ProtoMethods() *protoiface.Methods { if x.ActionTimeoutHeight != 0 { n += 1 + runtime.Sov(uint64(x.ActionTimeoutHeight)) } + if x.ExpectedApproveExpression != nil { + l = options.Size(x.ExpectedApproveExpression) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ExpectedRejectExpression != nil { + l = options.Size(x.ExpectedRejectExpression) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1222,6 +1281,34 @@ func (x *fastReflection_MsgNewAction) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ExpectedRejectExpression != nil { + encoded, err := options.Marshal(x.ExpectedRejectExpression) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if x.ExpectedApproveExpression != nil { + encoded, err := options.Marshal(x.ExpectedApproveExpression) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } if x.ActionTimeoutHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ActionTimeoutHeight)) i-- @@ -1384,6 +1471,78 @@ func (x *fastReflection_MsgNewAction) ProtoMethods() *protoiface.Methods { break } } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpectedApproveExpression", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ExpectedApproveExpression == nil { + x.ExpectedApproveExpression = &ast.Expression{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExpectedApproveExpression); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpectedRejectExpression", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ExpectedRejectExpression == nil { + x.ExpectedRejectExpression = &ast.Expression{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExpectedRejectExpression); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7361,6 +7520,10 @@ type MsgNewAction struct { Message *anypb.Any `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // action_timeout_height is the block height up until this action can be executed. ActionTimeoutHeight uint64 `protobuf:"varint,3,opt,name=action_timeout_height,json=actionTimeoutHeight,proto3" json:"action_timeout_height,omitempty"` + // expected_approve_expression is the expected approval expression the action is created with + ExpectedApproveExpression *ast.Expression `protobuf:"bytes,4,opt,name=expected_approve_expression,json=expectedApproveExpression,proto3" json:"expected_approve_expression,omitempty"` + // expected_reject_expression is the expected reject expression the action is created with + ExpectedRejectExpression *ast.Expression `protobuf:"bytes,5,opt,name=expected_reject_expression,json=expectedRejectExpression,proto3" json:"expected_reject_expression,omitempty"` } func (x *MsgNewAction) Reset() { @@ -7404,6 +7567,20 @@ func (x *MsgNewAction) GetActionTimeoutHeight() uint64 { return 0 } +func (x *MsgNewAction) GetExpectedApproveExpression() *ast.Expression { + if x != nil { + return x.ExpectedApproveExpression + } + return nil +} + +func (x *MsgNewAction) GetExpectedRejectExpression() *ast.Expression { + if x != nil { + return x.ExpectedRejectExpression + } + return nil +} + type MsgNewActionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7940,29 +8117,42 @@ var file_warden_act_v1beta1_tx_proto_rawDesc = []byte{ 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xb9, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, - 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x2f, 0x82, 0xe7, 0xb0, - 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, - 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x78, 0x2f, 0x61, 0x63, 0x74, 0x2f, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x4e, - 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x13, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, + 0x1a, 0x14, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x2f, 0x61, 0x73, 0x74, 0x2f, 0x61, 0x73, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x3a, 0x2f, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x77, 0x61, 0x72, 0x64, 0x65, 0x6e, 0x2f, 0x78, 0x2f, 0x61, + 0x63, 0x74, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd4, 0x02, + 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x5c, 0x0a, 0x1b, + 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x45, + 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x19, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5a, 0x0a, 0x1a, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x65, 0x78, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x18, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x78, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x26, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x57, 0x0a, 0x10, @@ -8119,33 +8309,36 @@ var file_warden_act_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgVoteForActionResponse)(nil), // 15: warden.act.v1beta1.MsgVoteForActionResponse (*Params)(nil), // 16: warden.act.v1beta1.Params (*anypb.Any)(nil), // 17: google.protobuf.Any - (ActionVoteType)(0), // 18: warden.act.v1beta1.ActionVoteType + (*ast.Expression)(nil), // 18: shield.ast.Expression + (ActionVoteType)(0), // 19: warden.act.v1beta1.ActionVoteType } var file_warden_act_v1beta1_tx_proto_depIdxs = []int32{ 16, // 0: warden.act.v1beta1.MsgUpdateParams.params:type_name -> warden.act.v1beta1.Params 17, // 1: warden.act.v1beta1.MsgNewAction.message:type_name -> google.protobuf.Any - 18, // 2: warden.act.v1beta1.MsgVoteForAction.vote:type_name -> warden.act.v1beta1.ActionVoteType - 0, // 3: warden.act.v1beta1.Msg.UpdateParams:input_type -> warden.act.v1beta1.MsgUpdateParams - 2, // 4: warden.act.v1beta1.Msg.NewAction:input_type -> warden.act.v1beta1.MsgNewAction - 4, // 5: warden.act.v1beta1.Msg.ApproveAction:input_type -> warden.act.v1beta1.MsgApproveAction - 12, // 6: warden.act.v1beta1.Msg.CheckAction:input_type -> warden.act.v1beta1.MsgCheckAction - 6, // 7: warden.act.v1beta1.Msg.NewRule:input_type -> warden.act.v1beta1.MsgNewRule - 8, // 8: warden.act.v1beta1.Msg.UpdateRule:input_type -> warden.act.v1beta1.MsgUpdateRule - 10, // 9: warden.act.v1beta1.Msg.RevokeAction:input_type -> warden.act.v1beta1.MsgRevokeAction - 14, // 10: warden.act.v1beta1.Msg.VoteForAction:input_type -> warden.act.v1beta1.MsgVoteForAction - 1, // 11: warden.act.v1beta1.Msg.UpdateParams:output_type -> warden.act.v1beta1.MsgUpdateParamsResponse - 3, // 12: warden.act.v1beta1.Msg.NewAction:output_type -> warden.act.v1beta1.MsgNewActionResponse - 5, // 13: warden.act.v1beta1.Msg.ApproveAction:output_type -> warden.act.v1beta1.MsgApproveActionResponse - 13, // 14: warden.act.v1beta1.Msg.CheckAction:output_type -> warden.act.v1beta1.MsgCheckActionResponse - 7, // 15: warden.act.v1beta1.Msg.NewRule:output_type -> warden.act.v1beta1.MsgNewRuleResponse - 9, // 16: warden.act.v1beta1.Msg.UpdateRule:output_type -> warden.act.v1beta1.MsgUpdateRuleResponse - 11, // 17: warden.act.v1beta1.Msg.RevokeAction:output_type -> warden.act.v1beta1.MsgRevokeActionResponse - 15, // 18: warden.act.v1beta1.Msg.VoteForAction:output_type -> warden.act.v1beta1.MsgVoteForActionResponse - 11, // [11:19] is the sub-list for method output_type - 3, // [3:11] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 18, // 2: warden.act.v1beta1.MsgNewAction.expected_approve_expression:type_name -> shield.ast.Expression + 18, // 3: warden.act.v1beta1.MsgNewAction.expected_reject_expression:type_name -> shield.ast.Expression + 19, // 4: warden.act.v1beta1.MsgVoteForAction.vote:type_name -> warden.act.v1beta1.ActionVoteType + 0, // 5: warden.act.v1beta1.Msg.UpdateParams:input_type -> warden.act.v1beta1.MsgUpdateParams + 2, // 6: warden.act.v1beta1.Msg.NewAction:input_type -> warden.act.v1beta1.MsgNewAction + 4, // 7: warden.act.v1beta1.Msg.ApproveAction:input_type -> warden.act.v1beta1.MsgApproveAction + 12, // 8: warden.act.v1beta1.Msg.CheckAction:input_type -> warden.act.v1beta1.MsgCheckAction + 6, // 9: warden.act.v1beta1.Msg.NewRule:input_type -> warden.act.v1beta1.MsgNewRule + 8, // 10: warden.act.v1beta1.Msg.UpdateRule:input_type -> warden.act.v1beta1.MsgUpdateRule + 10, // 11: warden.act.v1beta1.Msg.RevokeAction:input_type -> warden.act.v1beta1.MsgRevokeAction + 14, // 12: warden.act.v1beta1.Msg.VoteForAction:input_type -> warden.act.v1beta1.MsgVoteForAction + 1, // 13: warden.act.v1beta1.Msg.UpdateParams:output_type -> warden.act.v1beta1.MsgUpdateParamsResponse + 3, // 14: warden.act.v1beta1.Msg.NewAction:output_type -> warden.act.v1beta1.MsgNewActionResponse + 5, // 15: warden.act.v1beta1.Msg.ApproveAction:output_type -> warden.act.v1beta1.MsgApproveActionResponse + 13, // 16: warden.act.v1beta1.Msg.CheckAction:output_type -> warden.act.v1beta1.MsgCheckActionResponse + 7, // 17: warden.act.v1beta1.Msg.NewRule:output_type -> warden.act.v1beta1.MsgNewRuleResponse + 9, // 18: warden.act.v1beta1.Msg.UpdateRule:output_type -> warden.act.v1beta1.MsgUpdateRuleResponse + 11, // 19: warden.act.v1beta1.Msg.RevokeAction:output_type -> warden.act.v1beta1.MsgRevokeActionResponse + 15, // 20: warden.act.v1beta1.Msg.VoteForAction:output_type -> warden.act.v1beta1.MsgVoteForActionResponse + 13, // [13:21] is the sub-list for method output_type + 5, // [5:13] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_warden_act_v1beta1_tx_proto_init() } diff --git a/proto/warden/act/v1beta1/tx.proto b/proto/warden/act/v1beta1/tx.proto index d466dfdb2..00debb6ad 100644 --- a/proto/warden/act/v1beta1/tx.proto +++ b/proto/warden/act/v1beta1/tx.proto @@ -9,6 +9,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "warden/act/v1beta1/params.proto"; import "warden/act/v1beta1/action_vote.proto"; +import "shield/ast/ast.proto"; option go_package = "github.com/warden-protocol/wardenprotocol/warden/x/act/types/v1beta1"; @@ -68,6 +69,10 @@ message MsgNewAction { google.protobuf.Any message = 2; // action_timeout_height is the block height up until this action can be executed. uint64 action_timeout_height = 3; + // expected_approve_expression is the expected approval expression the action is created with + .shield.ast.Expression expected_approve_expression = 4 [(gogoproto.nullable) = false]; + // expected_reject_expression is the expected reject expression the action is created with + .shield.ast.Expression expected_reject_expression = 5 [(gogoproto.nullable) = false]; } message MsgNewActionResponse { diff --git a/warden/x/act/keeper/actions.go b/warden/x/act/keeper/actions.go index 54720bec3..33cb9a764 100644 --- a/warden/x/act/keeper/actions.go +++ b/warden/x/act/keeper/actions.go @@ -10,6 +10,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/warden-protocol/wardenprotocol/shield" + "github.com/warden-protocol/wardenprotocol/shield/ast" "github.com/warden-protocol/wardenprotocol/shield/object" "github.com/warden-protocol/wardenprotocol/warden/x/act/cosmoshield" types "github.com/warden-protocol/wardenprotocol/warden/x/act/types/v1beta1" @@ -133,7 +134,7 @@ type actionCreatorKey struct{} // AddAction creates a new action. // The action is created with the provided creator as the first approver. // This function also tries to execute the action immediately if it's ready. -func (k Keeper) AddAction(ctx context.Context, creator string, msg sdk.Msg, timeoutHeight uint64) (*types.Action, error) { +func (k Keeper) AddAction(ctx context.Context, creator string, msg sdk.Msg, timeoutHeight uint64, expectedApproveExpression ast.Expression, expectedRejectExpression ast.Expression) (*types.Action, error) { if err := k.validateActionMsgSigners(msg); err != nil { return nil, err } @@ -144,6 +145,8 @@ func (k Keeper) AddAction(ctx context.Context, creator string, msg sdk.Msg, time return nil, errors.Wrapf(types.ErrNoRuleRegistryHandler, "%v", err) } + // todo: check that expressions from rulesRegistry (templateRegistry) match with expected + wrappedMsg, err := codectypes.NewAnyWithValue(msg) if err != nil { return nil, err diff --git a/warden/x/act/keeper/msg_server_new_action.go b/warden/x/act/keeper/msg_server_new_action.go index 86329c46a..0fd2187b0 100644 --- a/warden/x/act/keeper/msg_server_new_action.go +++ b/warden/x/act/keeper/msg_server_new_action.go @@ -15,7 +15,7 @@ func (k msgServer) NewAction(ctx context.Context, msg *types.MsgNewAction) (*typ return nil, fmt.Errorf("can't unpack any: %w", err) } - act, err := k.AddAction(ctx, msg.Creator, message, msg.ActionTimeoutHeight) + act, err := k.AddAction(ctx, msg.Creator, message, msg.ActionTimeoutHeight, msg.ExpectedApproveExpression, msg.ExpectedRejectExpression) if err != nil { return nil, err } diff --git a/warden/x/act/types/v1beta1/tx.pb.go b/warden/x/act/types/v1beta1/tx.pb.go index 41af8c855..0e66ee83f 100644 --- a/warden/x/act/types/v1beta1/tx.pb.go +++ b/warden/x/act/types/v1beta1/tx.pb.go @@ -13,6 +13,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + ast "github.com/warden-protocol/wardenprotocol/shield/ast" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -132,6 +133,10 @@ type MsgNewAction struct { Message *types.Any `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // action_timeout_height is the block height up until this action can be executed. ActionTimeoutHeight uint64 `protobuf:"varint,3,opt,name=action_timeout_height,json=actionTimeoutHeight,proto3" json:"action_timeout_height,omitempty"` + // expected_approve_expression is the expected approval expression the action is created with + ExpectedApproveExpression ast.Expression `protobuf:"bytes,4,opt,name=expected_approve_expression,json=expectedApproveExpression,proto3" json:"expected_approve_expression"` + // expected_reject_expression is the expected reject expression the action is created with + ExpectedRejectExpression ast.Expression `protobuf:"bytes,5,opt,name=expected_reject_expression,json=expectedRejectExpression,proto3" json:"expected_reject_expression"` } func (m *MsgNewAction) Reset() { *m = MsgNewAction{} } @@ -188,6 +193,20 @@ func (m *MsgNewAction) GetActionTimeoutHeight() uint64 { return 0 } +func (m *MsgNewAction) GetExpectedApproveExpression() ast.Expression { + if m != nil { + return m.ExpectedApproveExpression + } + return ast.Expression{} +} + +func (m *MsgNewAction) GetExpectedRejectExpression() ast.Expression { + if m != nil { + return m.ExpectedRejectExpression + } + return ast.Expression{} +} + type MsgNewActionResponse struct { // id is the unique id of the action. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -847,60 +866,65 @@ func init() { func init() { proto.RegisterFile("warden/act/v1beta1/tx.proto", fileDescriptor_f059980976488200) } var fileDescriptor_f059980976488200 = []byte{ - // 842 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x8f, 0xb3, 0x21, 0x4b, 0xde, 0xa6, 0x4b, 0x31, 0x69, 0x37, 0x75, 0x91, 0x1b, 0xcc, 0xaa, - 0x0a, 0x81, 0xda, 0x6c, 0x90, 0x7a, 0x58, 0x89, 0x43, 0x16, 0x84, 0xe0, 0x10, 0x04, 0xa6, 0x7f, - 0xa4, 0x4a, 0xb0, 0x9d, 0xd8, 0x53, 0xc7, 0xea, 0xda, 0x63, 0x79, 0x26, 0x69, 0x23, 0x2e, 0xc0, - 0x91, 0x13, 0x67, 0xf8, 0x02, 0x1c, 0xf7, 0xc0, 0x85, 0x6f, 0xd0, 0x63, 0xc5, 0x89, 0x13, 0x42, - 0xbb, 0x87, 0xfd, 0x1a, 0xc8, 0x33, 0x63, 0x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 0x15, 0x51, 0x3e, - 0xe3, 0x6c, 0x11, 0x61, 0x9a, 0xfe, 0x24, 0x99, 0x34, 0x39, 0xe8, 0xa3, 0xff, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xa5, 0xa9, 0xb9, 0x4f, 0x79, 0x09, 0x00, 0x00, + // 923 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xaf, 0xd3, 0x6c, 0x4b, 0x5e, 0xbb, 0x65, 0x31, 0xdd, 0x36, 0x75, 0x91, 0x37, 0x98, 0x6a, + 0x55, 0x0a, 0x6b, 0xd3, 0x20, 0xed, 0xa1, 0x12, 0x87, 0x96, 0x3f, 0x82, 0x43, 0x10, 0x98, 0xfd, + 0x23, 0x55, 0x40, 0x76, 0x6a, 0xcf, 0x3a, 0xc3, 0xd6, 0x1e, 0xcb, 0x33, 0xc9, 0x36, 0xe2, 0x02, + 0x1c, 0x39, 0x71, 0xe7, 0x0b, 0x70, 0xec, 0x81, 0x0b, 0xdf, 0x60, 0x8f, 0x2b, 0xc4, 0x81, 0x13, + 0x42, 0xed, 0xa1, 0x5f, 0x03, 0x79, 0x66, 0xec, 0xd8, 0x21, 0xae, 0x7b, 0xe8, 0x21, 0x89, 0x67, + 0xde, 0xef, 0xfd, 0xde, 0x6f, 0xde, 0x7b, 0xf3, 0x62, 0xd8, 0x7c, 0x8e, 0x12, 0x1f, 0x47, 0x0e, + 0xf2, 0xb8, 0x33, 0xda, 0x3d, 0xc2, 0x1c, 0xed, 0x3a, 0xfc, 0xc4, 0x8e, 0x13, 0xca, 0xa9, 0xae, + 0x4b, 0xa3, 0x8d, 0x3c, 0x6e, 0x2b, 0xa3, 0xf1, 0x1a, 0x0a, 0x49, 0x44, 0x1d, 0xf1, 0x2d, 0x61, + 0xc6, 0xba, 0x47, 0x59, 0x48, 0x99, 0x13, 0xb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8, 0xf6, 0x68, 0xe8, 0x48, 0xe2, 0x7b, 0xe2, 0xbf, 0xde, 0xa3, 0xc7, 0x6a, 0x3d, 0xb5, 0x54, + 0x2f, 0x20, 0x7c, 0x1c, 0x63, 0x96, 0xbd, 0x62, 0x1d, 0x2d, 0x08, 0xd0, 0xfb, 0xff, 0x05, 0x00, + 0x00, 0xff, 0xff, 0x51, 0xa5, 0xc0, 0x5b, 0x49, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1337,6 +1361,26 @@ func (m *MsgNewAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.ExpectedRejectExpression.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.ExpectedApproveExpression.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 if m.ActionTimeoutHeight != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ActionTimeoutHeight)) i-- @@ -1846,6 +1890,10 @@ func (m *MsgNewAction) Size() (n int) { if m.ActionTimeoutHeight != 0 { n += 1 + sovTx(uint64(m.ActionTimeoutHeight)) } + l = m.ExpectedApproveExpression.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.ExpectedRejectExpression.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2329,6 +2377,72 @@ func (m *MsgNewAction) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedApproveExpression", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExpectedApproveExpression.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedRejectExpression", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExpectedRejectExpression.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/warden/x/warden/types/v1beta3/keychain.pb.go b/warden/x/warden/types/v1beta3/keychain.pb.go index b31944577..3547931ce 100644 --- a/warden/x/warden/types/v1beta3/keychain.pb.go +++ b/warden/x/warden/types/v1beta3/keychain.pb.go @@ -1185,4 +1185,4 @@ var ( ErrInvalidLengthKeychain = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowKeychain = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupKeychain = fmt.Errorf("proto: unexpected end of group") -) \ No newline at end of file +) diff --git a/warden/x/warden/types/v1beta3/tx.pb.go b/warden/x/warden/types/v1beta3/tx.pb.go index c31d2c68a..6ba50c257 100644 --- a/warden/x/warden/types/v1beta3/tx.pb.go +++ b/warden/x/warden/types/v1beta3/tx.pb.go @@ -512,23 +512,23 @@ func (m *MsgNewKeychain) GetKeychainFees() KeychainFees { return KeychainFees{} } -func (m *MsgNewKeychain) GetUrl() string { +func (m *MsgNewKeychain) GetDescription() string { if m != nil { - return m.Url + return m.Description } return "" } -func (m *MsgNewKeychain) GetKeybaseId() string { +func (m *MsgNewKeychain) GetUrl() string { if m != nil { - return m.KeybaseId + return m.Url } return "" } -func (m *MsgNewKeychain) GetDescription() string { +func (m *MsgNewKeychain) GetKeybaseId() string { if m != nil { - return m.Description + return m.KeybaseId } return "" } @@ -856,23 +856,23 @@ func (m *MsgUpdateKeychain) GetKeychainFees() KeychainFees { return KeychainFees{} } -func (m *MsgUpdateKeychain) GetUrl() string { +func (m *MsgUpdateKeychain) GetDescription() string { if m != nil { - return m.Url + return m.Description } return "" } -func (m *MsgUpdateKeychain) GetKeybaseId() string { +func (m *MsgUpdateKeychain) GetUrl() string { if m != nil { - return m.KeybaseId + return m.Url } return "" } -func (m *MsgUpdateKeychain) GetDescription() string { +func (m *MsgUpdateKeychain) GetKeybaseId() string { if m != nil { - return m.Description + return m.KeybaseId } return "" } @@ -2853,10 +2853,10 @@ func (m *MsgNewKeychain) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x2a } @@ -3087,10 +3087,10 @@ func (m *MsgUpdateKeychain) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x32 } @@ -3982,18 +3982,6 @@ func (m *MsgNewKeychain) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Url) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.KeybaseId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -4103,18 +4091,6 @@ func (m *MsgUpdateKeychain) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Url) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.KeybaseId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } return n }