Skip to content

Commit

Permalink
feat(x/intent): use fixed Intent in Actions and improve ActionsByAddr…
Browse files Browse the repository at this point in the history
…ess query performance (#117)

* feat(x/intent): separate ActionKeeper from x/intent's Keeper

This is a way of separating concerns, and will allow expanding the ActionKeeper abilities
without impacting the rest of the Keeper.

* feat(wardend): store immutable Intents inside Actions and remove Intent generators

* fix(x/warden): allow Space Owners to be indexed inside default Intent

* feat(x/intent): build an "action_by_address" store index

* chore(spaceward): regen hooks
  • Loading branch information
Pitasi committed Mar 22, 2024
1 parent cc2bb99 commit e35f3ef
Show file tree
Hide file tree
Showing 95 changed files with 28,199 additions and 18,815 deletions.
285 changes: 161 additions & 124 deletions api/warden/intent/action.pulsar.go

Large diffs are not rendered by default.

22,212 changes: 15,511 additions & 6,701 deletions docs/static/openapi.yml

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions proto/warden/intent/action.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "warden/intent/intent.proto";

option go_package = "github.com/warden-protocol/wardenprotocol/warden/x/intent/types";

Expand All @@ -21,10 +22,6 @@ message Action {
uint64 id = 1;
repeated Approver approvers = 2;
ActionStatus status = 3;
// Optional intent id that must be satisfied by the approvers.
// If not specified, it's up to the creator of the action to decide what to
// apply.
uint64 intent_id = 4;
// Original message that started the action, it will be executed when the
// intent is satisfied.
google.protobuf.Any msg = 5;
Expand All @@ -40,6 +37,10 @@ message Action {
// updated_at is a timestamp specifying when the action's status was updated
google.protobuf.Timestamp updated_at = 10
[(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true];
// intent is the intent that this action is associated with. Instead of
// storing the intent ID, we store the entire intent object so that is
// immutable and cannot be changed later.
intent.Intent intent = 11 [(gogoproto.nullable) = false];
}

// MsgActionCreated is returned by rpc that creates an action.
Expand Down

0 comments on commit e35f3ef

Please sign in to comment.