Skip to content

Commit

Permalink
feat(release): update 5487df9 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler authored Dec 19, 2023
2 parents e86dd4b + 2da28bd commit 36a9799
Showing 5 changed files with 25 additions and 26 deletions.
22 changes: 0 additions & 22 deletions appspec.json

This file was deleted.

4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -50,6 +50,10 @@ export const maxDataItemSize = process.env.MAX_DATA_ITEM_SIZE
? +process.env.MAX_DATA_ITEM_SIZE
: fourGiB;

export const tickArnsContractEnabled =
process.env.TICK_ARNS_REGISTRY_ENABLED === "true";
export const arnsContractTxId = process.env.ARNS_CONTRACT_TX_ID;

export const freeArfsDataAllowLimit = +(
process.env.FREE_UPLOAD_LIMIT ?? oneKiB * 505
); // Extra to account for the header sizes
21 changes: 19 additions & 2 deletions src/jobs/prepare.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,11 @@ import {
} from "../bundles/assembleBundleHeader";
import { rawIdFromRawSignature } from "../bundles/rawIdFromRawSignature";
import { signatureTypeInfo } from "../bundles/verifyDataItem";
import { gatewayUrl } from "../constants";
import {
arnsContractTxId,
gatewayUrl,
tickArnsContractEnabled,
} from "../constants";
import defaultLogger from "../logger";
import { PlanId } from "../types/dbTypes";
import { JWKInterface } from "../types/jwkTypes";
@@ -193,8 +197,21 @@ export async function prepareBundleHandler(
// Mint $U
bundleTx.addTag("App-Name", "SmartWeaveAction");
bundleTx.addTag("App-Version", "0.3.0");
bundleTx.addTag("Input", '{ "function": "mint" }');
bundleTx.addTag("Contract", "KTzTXT_ANmF84fWEKHzWURD1LWd9QaFR9yfYUwH2Lxw");
bundleTx.addTag("Input", JSON.stringify({ function: "mint" }));

// tick arns contract
if (tickArnsContractEnabled && arnsContractTxId) {
logger.info(
"Adding tick interaction to ArNS registry to bundle transaction.",
{
txId: bundleTx.id,
arnsContractTxId,
}
);
bundleTx.addTag("Contract", arnsContractTxId);
bundleTx.addTag("Input", JSON.stringify({ function: "tick" }));
}

await arweave.signTx(bundleTx, jwk);

2 changes: 1 addition & 1 deletion tests/arlocal.int.test.ts
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ describe("ArLocal <--> Jobs Integration Test", function () {

// bundle tx on disk
const bundleTx = readFileSync(`temp/bundle/${bundleId}`);
expect(bundleTx.byteLength).to.equal(2129);
expect(bundleTx.byteLength).to.equal(2125);

// bundle header on disk
const bundleHead = readFileSync(`temp/header/${planId}`);
2 changes: 1 addition & 1 deletion tests/prepare.test.ts
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ describe("Prepare bundle job handler", () => {

const bundleTxId = newBundleDbResult[0].bundle_id;

const bundleTx = await getBundleTx(objectStore, bundleTxId, 2125);
const bundleTx = await getBundleTx(objectStore, bundleTxId);

// We expect no tips on bundle transactions by default
expect(bundleTx.quantity).to.equal("0");

0 comments on commit 36a9799

Please sign in to comment.