Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Use Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'

- name: Cache node modules
uses: actions/cache@v5
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
Comment thread
rafa-stacks marked this conversation as resolved.
env:
cache-name: cache-node-modules
with:
Expand Down Expand Up @@ -72,17 +72,17 @@ jobs:
STACKS_NODE_RPC_PORT: 24440
SNP_REDIS_URL: redis://localhost:6379
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'

- name: Cache node modules
uses: actions/cache@v5
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
env:
cache-name: cache-node-modules
with:
Expand All @@ -102,7 +102,7 @@ jobs:
run: npx c8 --reporter=lcov npm run test:${{ matrix.suite }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -112,12 +112,12 @@ jobs:
outputs:
next_version: ${{ steps.calc.outputs.next_version }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'

Expand Down Expand Up @@ -160,35 +160,35 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Docker Meta
id: docker_meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr

- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build/Tag/Push Image
id: docker_push
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
platforms: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
id-token: write
steps:
- name: Checkout tag
uses: actions/checkout@v6
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: v${{ inputs.version }}

- name: Use Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
Comment thread
rafa-stacks marked this conversation as resolved.
node-version-file: '.nvmrc'

Expand All @@ -44,19 +44,19 @@ jobs:
packages: write
steps:
- name: Checkout tag
uses: actions/checkout@v6
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: v${{ inputs.version }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ghcr.io/${{ github.repository }}
tags: |
Expand All @@ -66,14 +66,14 @@ jobs:
type=raw,value=latest,enable=${{ !contains(inputs.version, '-') }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build/Tag/Push Image
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -87,7 +87,7 @@ jobs:
contents: write
steps:
- name: Checkout tag
uses: actions/checkout@v6
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: v${{ inputs.version }}

Expand Down
19 changes: 8 additions & 11 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@sinclair/typebox": "^0.34.48",
"@stacks/api-toolkit": "^1.13.0",
"@stacks/blockchain-api-client": "^8.14.2",
"@stacks/codec": "^1.6.0",
"@stacks/codec": "^2.1.0",
"@stacks/node-publisher-client": "^2.0.5",
"@stacks/transactions": "^7.4.0",
"@types/node": "^24.0.0",
Expand Down
15 changes: 10 additions & 5 deletions src/stacks-core/stacks-core-block-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import {
SmartContractDeployment,
TokenMetadataUpdateNotification,
} from '../token-processor/util/sip-validation.js';
import codec from '@stacks/codec';
import {
ClarityTypeID,
DecodedTxResult,
decodeClarityValue,
decodeTransaction,
} from '@stacks/codec';
import { StacksCorePgStore } from '../pg/stacks-core-pg-store.js';
import { logger, stopwatch } from '@stacks/api-toolkit';
import {
Expand All @@ -24,7 +29,7 @@ import {

export type DecodedStacksTransaction = {
tx: NewBlockTransaction;
decoded: codec.DecodedTxResult;
decoded: DecodedTxResult;
events: NewBlockEvent[];
};

Expand Down Expand Up @@ -53,7 +58,7 @@ export function decodeStacksCoreBlock(block: NewBlockMessage): DecodedStacksBloc
if (tx.burnchain_op) continue;
transactions.push({
tx,
decoded: codec.decodeTransaction(tx.raw_tx.substring(2)),
decoded: decodeTransaction(tx.raw_tx.substring(2)),
events: (events.get(tx.txid) || []).sort((a, b) => a.event_index - b.event_index),
});
}
Expand Down Expand Up @@ -228,8 +233,8 @@ export class StacksCoreBlockProcessor {
event: NewBlockNftMintEvent,
nftMints: NftMintEvent[]
) {
const value = codec.decodeClarityValue(event.nft_mint_event.raw_value);
if (value.type_id === codec.ClarityTypeID.UInt) {
const value = decodeClarityValue(event.nft_mint_event.raw_value);
if (value.type_id === ClarityTypeID.UInt) {
const principal = event.nft_mint_event.asset_identifier.split('::')[0];
const tokenId = BigInt(value.value);
nftMints.push({
Expand Down
8 changes: 4 additions & 4 deletions src/token-processor/queue/job/process-token-job.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cvToHex, uintCV } from '@stacks/transactions';
import codec from '@stacks/codec';
import { ClarityValueUInt, decodeClarityValueToRepr } from '@stacks/codec';
import {
DbMetadataLocaleInsertBundle,
DbProcessedTokenUpdateBundle,
Expand Down Expand Up @@ -216,13 +216,13 @@ export class ProcessTokenJob extends Job {
}
}

private uIntCv(n: bigint): codec.ClarityValueUInt {
private uIntCv(n: bigint): ClarityValueUInt {
const cv = uintCV(n);
const hex = cvToHex(cv);
return {
value: n.toString(),
hex: hex,
repr: codec.decodeClarityValueToRepr(hex),
} as codec.ClarityValueUInt;
repr: decodeClarityValueToRepr(hex),
} as ClarityValueUInt;
}
}
10 changes: 5 additions & 5 deletions src/token-processor/queue/job/update-token-supply-job.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cvToHex, uintCV } from '@stacks/transactions';
import codec from '@stacks/codec';
import { ClarityValueUInt, decodeClarityValueToRepr } from '@stacks/codec';
import { DbSmartContract, DbToken, DbTokenType } from '../../../pg/types.js';
import { StacksNodeRpcClient } from '../../stacks-node/stacks-node-rpc-client.js';
import { SmartContractClarityError, UserError } from '../../util/errors.js';
Expand Down Expand Up @@ -83,7 +83,7 @@ export class UpdateTokenSupplyJob extends Job {
private async updateTokenSupply(
client: StacksNodeRpcClient,
token: DbToken,
arg: codec.ClarityValueUInt[] = []
arg: ClarityValueUInt[] = []
) {
let fTotalSupply: PgNumeric | undefined;
try {
Expand All @@ -103,13 +103,13 @@ export class UpdateTokenSupplyJob extends Job {
await this.db.core.updateTokenSupply({ id: token.id, total_supply: fTotalSupply });
}

private uIntCv(n: bigint): codec.ClarityValueUInt {
private uIntCv(n: bigint): ClarityValueUInt {
const cv = uintCV(n);
const hex = cvToHex(cv);
return {
value: n.toString(),
hex: hex,
repr: codec.decodeClarityValueToRepr(hex),
} as codec.ClarityValueUInt;
repr: decodeClarityValueToRepr(hex),
} as ClarityValueUInt;
}
}
Loading
Loading