Skip to content

Commit

Permalink
Renaming "last sort key" to "prev sort key"
Browse files Browse the repository at this point in the history
  • Loading branch information
szynwelski committed Oct 17, 2023
1 parent 41b4210 commit c970a5a
Show file tree
Hide file tree
Showing 43 changed files with 717 additions and 716 deletions.
114 changes: 57 additions & 57 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46488,16 +46488,52 @@ paths:
additionalProperties: {}
tags:
- Query
/warp-contracts/sequencer/sequencer/last_sort_key:
/warp-contracts/sequencer/sequencer/params:
get:
summary: Parameters queries the parameters of the module.
operationId: SequencerSequencerParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
tags:
- Query
/warp-contracts/sequencer/sequencer/prev_sort_key:
get:
operationId: SequencerSequencerLastSortKeyAll
operationId: SequencerSequencerPrevSortKeyAll
responses:
'200':
description: A successful response.
schema:
type: object
properties:
lastSortKey:
prevSortKey:
type: array
items:
type: object
Expand Down Expand Up @@ -46611,17 +46647,17 @@ paths:
type: boolean
tags:
- Query
/warp-contracts/sequencer/sequencer/last_sort_key/{contract}:
/warp-contracts/sequencer/sequencer/prev_sort_key/{contract}:
get:
summary: Queries a list of LastSortKey items.
operationId: SequencerSequencerLastSortKey
summary: Queries a list of PrevSortKey items.
operationId: SequencerSequencerPrevSortKey
responses:
'200':
description: A successful response.
schema:
type: object
properties:
lastSortKey:
prevSortKey:
type: object
properties:
contract:
Expand Down Expand Up @@ -46653,42 +46689,6 @@ paths:
type: string
tags:
- Query
/warp-contracts/sequencer/sequencer/params:
get:
summary: Parameters queries the parameters of the module.
operationId: SequencerSequencerParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
tags:
- Query
definitions:
cosmos.auth.v1beta1.AddressBytesToStringResponse:
type: object
Expand Down Expand Up @@ -75451,7 +75451,7 @@ definitions:
type: string
description: >-
Store basic information about L1 interaction needed for calculating
sort_key and last_sort_key.
sort_key and prev_sort_key.
sequencer.sequencer.ArweaveTransactionWithInfo:
type: object
properties:
Expand All @@ -75466,8 +75466,8 @@ definitions:
type: string
description: >-
Store basic information about L1 interaction needed for calculating
sort_key and last_sort_key.
last_sort_key:
sort_key and prev_sort_key.
prev_sort_key:
type: string
random:
type: string
Expand All @@ -75494,24 +75494,24 @@ definitions:
type: string
format: int64
title: Information about the latest Arweave block added to the blockchain
sequencer.sequencer.LastSortKey:
type: object
properties:
contract:
type: string
sortKey:
type: string
sequencer.sequencer.MsgArweaveBlockResponse:
type: object
sequencer.sequencer.MsgDataItemResponse:
type: object
sequencer.sequencer.Params:
type: object
description: Params defines the parameters for the module.
sequencer.sequencer.QueryAllLastSortKeyResponse:
sequencer.sequencer.PrevSortKey:
type: object
properties:
contract:
type: string
sortKey:
type: string
sequencer.sequencer.QueryAllPrevSortKeyResponse:
type: object
properties:
lastSortKey:
prevSortKey:
type: array
items:
type: object
Expand Down Expand Up @@ -75568,10 +75568,10 @@ definitions:
type: string
format: int64
title: Information about the latest Arweave block added to the blockchain
sequencer.sequencer.QueryGetLastSortKeyResponse:
sequencer.sequencer.QueryGetPrevSortKeyResponse:
type: object
properties:
lastSortKey:
prevSortKey:
type: object
properties:
contract:
Expand Down
2 changes: 1 addition & 1 deletion proto/sequencer/sequencer/arweave_transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sequencer.sequencer;

option go_package = "github.com/warp-contracts/sequencer/x/sequencer/types";

// Store basic information about L1 interaction needed for calculating sort_key and last_sort_key.
// Store basic information about L1 interaction needed for calculating sort_key and prev_sort_key.
message ArweaveTransaction {
string id = 1;
string contract = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ option go_package = "github.com/warp-contracts/sequencer/x/sequencer/types";
// L1 interaction with a sort key value from the previous interaction with the contract
message ArweaveTransactionWithInfo {
ArweaveTransaction transaction = 1;
string last_sort_key = 2;
string prev_sort_key = 2;
bytes random = 3;
}
4 changes: 2 additions & 2 deletions proto/sequencer/sequencer/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ package sequencer.sequencer;
import "gogoproto/gogo.proto";
import "sequencer/sequencer/params.proto";
import "sequencer/sequencer/last_arweave_block.proto";
import "sequencer/sequencer/last_sort_key.proto";
import "sequencer/sequencer/prev_sort_key.proto";

option go_package = "github.com/warp-contracts/sequencer/x/sequencer/types";

// GenesisState defines the sequencer module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
LastArweaveBlock lastArweaveBlock = 2;
repeated LastSortKey lastSortKeyList = 3 [(gogoproto.nullable) = false];
repeated PrevSortKey prevSortKeyList = 3 [(gogoproto.nullable) = false];
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sequencer.sequencer;

option go_package = "github.com/warp-contracts/sequencer/x/sequencer/types";

message LastSortKey {
message PrevSortKey {
string contract = 1;
string sortKey = 2;

Expand Down
24 changes: 12 additions & 12 deletions proto/sequencer/sequencer/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "sequencer/sequencer/params.proto";
import "sequencer/sequencer/last_arweave_block.proto";
import "sequencer/sequencer/last_sort_key.proto";
import "sequencer/sequencer/prev_sort_key.proto";

option go_package = "github.com/warp-contracts/sequencer/x/sequencer/types";

Expand All @@ -26,13 +26,13 @@ service Query {

}

// Queries a list of LastSortKey items.
rpc LastSortKey (QueryGetLastSortKeyRequest) returns (QueryGetLastSortKeyResponse) {
option (google.api.http).get = "/warp-contracts/sequencer/sequencer/last_sort_key/{contract}";
// Queries a list of PrevSortKey items.
rpc PrevSortKey (QueryGetPrevSortKeyRequest) returns (QueryGetPrevSortKeyResponse) {
option (google.api.http).get = "/warp-contracts/sequencer/sequencer/prev_sort_key/{contract}";

}
rpc LastSortKeyAll (QueryAllLastSortKeyRequest) returns (QueryAllLastSortKeyResponse) {
option (google.api.http).get = "/warp-contracts/sequencer/sequencer/last_sort_key";
rpc PrevSortKeyAll (QueryAllPrevSortKeyRequest) returns (QueryAllPrevSortKeyResponse) {
option (google.api.http).get = "/warp-contracts/sequencer/sequencer/prev_sort_key";

}
}
Expand All @@ -52,20 +52,20 @@ message QueryGetLastArweaveBlockResponse {
LastArweaveBlock LastArweaveBlock = 1 [(gogoproto.nullable) = false];
}

message QueryGetLastSortKeyRequest {
message QueryGetPrevSortKeyRequest {
string contract = 1;
}

message QueryGetLastSortKeyResponse {
LastSortKey lastSortKey = 1 [(gogoproto.nullable) = false];
message QueryGetPrevSortKeyResponse {
PrevSortKey prevSortKey = 1 [(gogoproto.nullable) = false];
}

message QueryAllLastSortKeyRequest {
message QueryAllPrevSortKeyRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllLastSortKeyResponse {
repeated LastSortKey lastSortKey = 1 [(gogoproto.nullable) = false];
message QueryAllPrevSortKeyResponse {
repeated PrevSortKey prevSortKey = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

2 changes: 1 addition & 1 deletion proto/sequencer/sequencer/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ service Msg {
message MsgDataItem {
bytes data_item = 1 [(gogoproto.customtype) = "github.com/warp-contracts/syncer/src/utils/bundlr.BundleItem", (gogoproto.nullable) = false];
string sort_key = 2;
string last_sort_key = 3;
string prev_sort_key = 3;
bytes random = 4;
}

Expand Down
4 changes: 2 additions & 2 deletions x/sequencer/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command {

cmd.AddCommand(CmdQueryParams())
cmd.AddCommand(CmdShowLastArweaveBlock())
cmd.AddCommand(CmdListLastSortKey())
cmd.AddCommand(CmdShowLastSortKey())
cmd.AddCommand(CmdListPrevSortKey())
cmd.AddCommand(CmdShowPrevSortKey())
// this line is used by starport scaffolding # 1

return cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/warp-contracts/sequencer/x/sequencer/types"
)

func CmdListLastSortKey() *cobra.Command {
func CmdListPrevSortKey() *cobra.Command {
cmd := &cobra.Command{
Use: "list-last-sort-key",
Short: "list all last-sort-key",
Use: "list-prev-dort-key",
Short: "list all prev-dort-key",
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
Expand All @@ -25,11 +25,11 @@ func CmdListLastSortKey() *cobra.Command {

queryClient := types.NewQueryClient(clientCtx)

params := &types.QueryAllLastSortKeyRequest{
params := &types.QueryAllPrevSortKeyRequest{
Pagination: pageReq,
}

res, err := queryClient.LastSortKeyAll(cmd.Context(), params)
res, err := queryClient.PrevSortKeyAll(cmd.Context(), params)
if err != nil {
return err
}
Expand All @@ -44,10 +44,10 @@ func CmdListLastSortKey() *cobra.Command {
return cmd
}

func CmdShowLastSortKey() *cobra.Command {
func CmdShowPrevSortKey() *cobra.Command {
cmd := &cobra.Command{
Use: "show-last-sort-key [contract]",
Short: "shows a last-sort-key",
Use: "show-prev-dort-key [contract]",
Short: "shows a prev-dort-key",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
Expand All @@ -59,11 +59,11 @@ func CmdShowLastSortKey() *cobra.Command {

argContract := args[0]

params := &types.QueryGetLastSortKeyRequest{
params := &types.QueryGetPrevSortKeyRequest{
Contract: argContract,
}

res, err := queryClient.LastSortKey(cmd.Context(), params)
res, err := queryClient.PrevSortKey(cmd.Context(), params)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit c970a5a

Please sign in to comment.