Skip to content

Commit

Permalink
Test the new GHA.
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-aptos committed Jan 10, 2025
1 parent 979e285 commit 59e7416
Show file tree
Hide file tree
Showing 7 changed files with 2,687 additions and 2,635 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/indexer-protos-sdk-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,28 @@ jobs:
run: git diff --exit-code
update-sdk:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
if: | # Only run on each PR once an appropriate event occurs
(
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'indexer-sdk-update')
)
steps:
- name: Google Cloud Auth
id: auth
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
- name: Get Secret Manager Secrets
id: secrets
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
token:aptos-ci/github-actions-repository-dispatch
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ steps.secrets.outputs.token }}

# Install buf, which we use to generate code from the protos for Rust and TS.
- name: Install buf
Expand All @@ -71,19 +82,6 @@ jobs:
echo "::set-output name=commit_hash::$(echo $GITHUB_SHA)"
# Echo the PR branch name to the output
echo "::set-output name=branch_name::${{ github.head_ref }}"
- name: Google Cloud Auth
id: auth
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
- name: Get Secret Manager Secrets
id: secrets
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
token:aptos-ci/github-actions-repository-dispatch
- name: Dispatch Event to SDK Repo
uses: peter-evans/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions protos/proto/aptos/transaction/v1/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ message Block {

// Chain ID informs us which chain we're trying to index, this is important to ensure that we're not mixing chains within a single pipeline.
uint32 chain_id = 4;

// This is for testing.
uint32 testing = 5;
}

// Transaction as it happened on the chain, there are 4 types of transactions:
Expand Down
336 changes: 168 additions & 168 deletions protos/python/aptos_protos/aptos/transaction/v1/transaction_pb2.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,24 @@ MOVE_ABILITY_STORE: MoveAbility
MOVE_ABILITY_KEY: MoveAbility

class Block(_message.Message):
__slots__ = ["timestamp", "height", "transactions", "chain_id"]
__slots__ = ["timestamp", "height", "transactions", "chain_id", "testing"]
TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
HEIGHT_FIELD_NUMBER: _ClassVar[int]
TRANSACTIONS_FIELD_NUMBER: _ClassVar[int]
CHAIN_ID_FIELD_NUMBER: _ClassVar[int]
TESTING_FIELD_NUMBER: _ClassVar[int]
timestamp: _timestamp_pb2.Timestamp
height: int
transactions: _containers.RepeatedCompositeFieldContainer[Transaction]
chain_id: int
testing: int
def __init__(
self,
timestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
height: _Optional[int] = ...,
transactions: _Optional[_Iterable[_Union[Transaction, _Mapping]]] = ...,
chain_id: _Optional[int] = ...,
testing: _Optional[int] = ...,
) -> None: ...

class Transaction(_message.Message):
Expand Down
4,906 changes: 2,458 additions & 2,448 deletions protos/rust/src/pb/aptos.transaction.v1.rs

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions protos/rust/src/pb/aptos.transaction.v1.serde.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions protos/typescript/src/aptos/transaction/v1/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ export interface Block {
| Transaction[]
| undefined;
/** Chain ID informs us which chain we're trying to index, this is important to ensure that we're not mixing chains within a single pipeline. */
chainId?: number | undefined;
chainId?:
| number
| undefined;
/** This is for testing. */
testing?: number | undefined;
}

/**
Expand Down Expand Up @@ -1189,7 +1193,7 @@ export interface WriteOpSizeInfo {
}

function createBaseBlock(): Block {
return { timestamp: undefined, height: BigInt("0"), transactions: [], chainId: 0 };
return { timestamp: undefined, height: BigInt("0"), transactions: [], chainId: 0, testing: 0 };
}

export const Block = {
Expand All @@ -1211,6 +1215,9 @@ export const Block = {
if (message.chainId !== undefined && message.chainId !== 0) {
writer.uint32(32).uint32(message.chainId);
}
if (message.testing !== undefined && message.testing !== 0) {
writer.uint32(40).uint32(message.testing);
}
return writer;
},

Expand Down Expand Up @@ -1249,6 +1256,13 @@ export const Block = {

message.chainId = reader.uint32();
continue;
case 5:
if (tag !== 40) {
break;
}

message.testing = reader.uint32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down Expand Up @@ -1298,6 +1312,7 @@ export const Block = {
? object.transactions.map((e: any) => Transaction.fromJSON(e))
: [],
chainId: isSet(object.chainId) ? globalThis.Number(object.chainId) : 0,
testing: isSet(object.testing) ? globalThis.Number(object.testing) : 0,
};
},

Expand All @@ -1315,6 +1330,9 @@ export const Block = {
if (message.chainId !== undefined && message.chainId !== 0) {
obj.chainId = Math.round(message.chainId);
}
if (message.testing !== undefined && message.testing !== 0) {
obj.testing = Math.round(message.testing);
}
return obj;
},

Expand All @@ -1329,6 +1347,7 @@ export const Block = {
message.height = object.height ?? BigInt("0");
message.transactions = object.transactions?.map((e) => Transaction.fromPartial(e)) || [];
message.chainId = object.chainId ?? 0;
message.testing = object.testing ?? 0;
return message;
},
};
Expand Down

0 comments on commit 59e7416

Please sign in to comment.