Skip to content

Commit

Permalink
Merge pull request #150 from ardriveapp/PE-675_fix_tip_tags
Browse files Browse the repository at this point in the history
PE-675: Use consistent tags on tip transactions
  • Loading branch information
fedellen authored Nov 10, 2021
2 parents 53602b6 + 9316685 commit 7413c9e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/ardrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,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 }
];
}
Expand Down
6 changes: 3 additions & 3 deletions src/commands/send_ar.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/utils/ardrive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand Down

0 comments on commit 7413c9e

Please sign in to comment.