From 938de6bbc653d347bba55b0acc0db2d37c36f9fa Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Wed, 10 Nov 2021 10:17:32 -0600 Subject: [PATCH 1/3] fix(tip tags): Use consistent tags with web app PE-675 --- src/ardrive.ts | 1 + src/commands/send_ar.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ardrive.ts b/src/ardrive.ts index a5a5476a..df7344a2 100644 --- a/src/ardrive.ts +++ b/src/ardrive.ts @@ -219,6 +219,7 @@ export class ArDrive extends ArDriveAnonymous { return [ { name: 'App-Name', value: this.appName }, { name: 'App-Version', value: this.appVersion }, + { name: 'Type', value: 'fee' }, { name: 'Tip-Type', value: tipType } ]; } diff --git a/src/commands/send_ar.ts b/src/commands/send_ar.ts index dbd120ea..a27a4f20 100644 --- a/src/commands/send_ar.ts +++ b/src/commands/send_ar.ts @@ -1,4 +1,4 @@ -import { cliWalletDao } from '..'; +import { cliWalletDao, CLI_APP_NAME, CLI_APP_VERSION } from '..'; import { ArweaveAddress } from '../arweave_address'; import { CLICommand } from '../CLICommand'; import { ParametersHelper } from '../CLICommand'; @@ -34,8 +34,8 @@ new CLICommand({ rewardSetting, options.dryRun, [ - { name: 'App-Name', value: 'ArDrive-CLI' }, - { name: 'App-Version', value: '2.0' }, + { name: 'App-Name', value: CLI_APP_NAME }, + { name: 'App-Version', value: CLI_APP_VERSION }, { name: 'Type', value: 'transfer' } ], true From fd46d8f4d7a74fa1b578dd8e59334ed65f6d40b1 Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Wed, 10 Nov 2021 10:18:16 -0600 Subject: [PATCH 2/3] chore(version): Bump to 1.0.3 PE-675 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9481ab6f..416f7ba5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ardrive-cli", - "version": "1.0.2", + "version": "1.0.3", "description": "The ArDrive Command Line Interface (CLI is a Node.js application for terminal-based ArDrive workflows. It also offers utility operations for securely interacting with Arweave wallets and inspecting various Arweave blockchain conditions.", "main": "./lib/index.js", "bin": { From 26f70fd95cbadc83db9d4007304cd6d4702aed9d Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Wed, 10 Nov 2021 10:26:12 -0600 Subject: [PATCH 3/3] test(tip tags): Adjust unit tests PE-675 --- src/utils/ardrive.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/ardrive.test.ts b/src/utils/ardrive.test.ts index 864dcd11..63dea349 100644 --- a/src/utils/ardrive.test.ts +++ b/src/utils/ardrive.test.ts @@ -97,10 +97,14 @@ describe('ArDrive class', () => { { name: 'App-Version', value: '1.0' } ]; const inputsAndExpectedOutputs = [ - [undefined, [...baseTags, { name: 'Tip-Type', value: 'data upload' }]], - ['data upload', [...baseTags, { name: 'Tip-Type', value: 'data upload' }]] + [undefined, [...baseTags, { name: 'Type', value: 'fee' }, { name: 'Tip-Type', value: 'data upload' }]], + [ + 'data upload', + [...baseTags, { name: 'Type', value: 'fee' }, { name: 'Tip-Type', value: 'data upload' }] + ] ]; inputsAndExpectedOutputs.forEach(([input, expectedOutput]) => { + console.log(JSON.stringify(expectedOutput, null, 4)); expect(arDrive.getTipTags(input as TipType)).to.deep.equal(expectedOutput); }); });