Skip to content

Commit ae90061

Browse files
slapec93Gergely Békési
andauthored
test: bee-factory (#755)
* docs: update readme for act (#754) Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org> * fix: spec URLs * fix: jest config * fix: update ports in specs --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org>
1 parent d41b1d0 commit ae90061

5 files changed

Lines changed: 19 additions & 17 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ swarm-cli access grant --list-name <grantee_list_name> --grantee <grantee_public
122122
### Revoke access from a certain grantee
123123

124124
```sh
125-
swarm-cli revoke grant --list-name <grantee_list_name> --grantee <grantee_public_key>
125+
swarm-cli access revoke --list-name <grantee_list_name> --grantee <grantee_public_key>
126126
```
127127

128128
### Show list of grantee lists
@@ -156,7 +156,7 @@ swarm-cli upload <file> --act --stamp <postage_batch_id>
156156

157157
### Download a file with ACT
158158

159-
`token` constructed from the owners public key and the history address
159+
`token` constructed from the owner's public key and the history address
160160

161161
```sh
162162
swarm-cli download <swarm_hash> <file> --access <token>
@@ -193,7 +193,7 @@ swarm-cli grantee get <grantee_reference>
193193
### Patch a grantees list [DEPRECATED]
194194

195195
```sh
196-
swarm-cli grantee patch grantees-patch.json \
196+
swarm-cli grantee patch grantees-patch.json \
197197
--reference <grantee_reference> \
198198
--history <grantee_history_reference> \
199199
--stamp <postage_batch_id>
@@ -270,6 +270,8 @@ pss Send, receive, or subscribe to PSS messages
270270
manifest Operate on manifests
271271
utility Utility commands for managing wallets
272272
grantee Create, Get, Patch grantee list
273+
history Get upload history
274+
access Share access to your uploaded files/folders
273275
274276
Run 'swarm-cli GROUP --help' to see available commands in a group
275277

‎jest.config.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import { Bee, BZZ } from '@ethersphere/bee-js'
66
import type { Config } from '@jest/types'
77
import { Dates, System } from 'cafe-utility'
8+
import { CommandLog, VerbosityLevel } from './src/command/root-command/command-log'
89
import { getPssAddress } from './test/utility/address'
910
import { getOrBuyStamp } from './test/utility/stamp'
10-
import { CommandLog, VerbosityLevel } from './src/command/root-command/command-log'
1111

1212
export default async (): Promise<Config.InitialOptions> => {
1313
/**
@@ -20,15 +20,15 @@ export default async (): Promise<Config.InitialOptions> => {
2020
process.env.SKIP_VERSION_CHECK = 'true'
2121

2222
if (!process.env.SKIP_WORKER) {
23-
process.env.WORKER_PSS_ADDRESS = (await getPssAddress('http://localhost:11633')).toCompressedHex()
23+
process.env.WORKER_PSS_ADDRESS = (await getPssAddress('http://localhost:1635')).toCompressedHex()
2424
}
2525

2626
if (!process.env.TEST_STAMP) {
2727
process.env.TEST_STAMP = (await getOrBuyStamp()).toHex()
2828
}
2929

3030
for (let i = 0; i < 5; i++) {
31-
const port = 1633 + i * 10000
31+
const port = 1633 + i * 2
3232
const bee = new Bee(`http://localhost:${port}`)
3333

3434
const startedAt = Date.now()
@@ -44,7 +44,7 @@ export default async (): Promise<Config.InitialOptions> => {
4444
}
4545

4646
for (let i = 0; i < 5; i++) {
47-
const port = 1633 + i * 10000
47+
const port = 1633 + i * 2
4848
const bee = new Bee(`http://localhost:${port}`)
4949

5050
console.log('Asserting chequebook balance on port', port)

‎test/command/access.spec.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describeCommand(
1616
})
1717
describe('init', () => {
1818
it('should initialize access with pss address as grantee', async () => {
19-
const pubKey = await getPublicAddress('http://localhost:21633')
19+
const pubKey = await getPublicAddress('http://localhost:1637')
2020
await invokeTestCli(['access', 'init', ...getStampOption(), '--list-name', 'test-access', '--grantee', pubKey])
2121
expect(getLastMessage()).toEqual("Grantee list 'test-access' initialized successfully!")
2222
})
@@ -45,7 +45,7 @@ describeCommand(
4545
it('should grant access to a new grantee', async () => {
4646
await invokeTestCli(['access', 'init', ...getStampOption(), '-n', 'test-access'])
4747
await System.sleepMillis(1000)
48-
const pubKey = await getPublicAddress('http://localhost:21633')
48+
const pubKey = await getPublicAddress('http://localhost:1637')
4949
await invokeTestCli(['access', 'grant', '--list-name', 'test-access', '--grantee', pubKey])
5050
expect(getLastMessage()).toContain(`Access granted to ${pubKey}`)
5151
})
@@ -72,7 +72,7 @@ describeCommand(
7272
it('should show grantee list reference and history address', async () => {
7373
await invokeTestCli(['access', 'init', ...getStampOption(), '-n', 'test-access'])
7474
await System.sleepMillis(1000)
75-
const pubKey = await getPublicAddress('http://localhost:21633')
75+
const pubKey = await getPublicAddress('http://localhost:1637')
7676
await invokeTestCli(['access', 'grant', '--list-name', 'test-access', '--grantee', pubKey, '--verbose'])
7777
expect(getNthLastMessage(2)).toContain('Grantee list reference')
7878
expect(getNthLastMessage(2)).toMatch(/[a-f0-9]{64}/g)
@@ -84,7 +84,7 @@ describeCommand(
8484

8585
describe('revoke', () => {
8686
it('should revoke access from a grantee', async () => {
87-
const pubKey = await getPublicAddress('http://localhost:21633')
87+
const pubKey = await getPublicAddress('http://localhost:1637')
8888
await invokeTestCli(['access', 'init', ...getStampOption(), '-n', 'test-access', '--grantee', pubKey])
8989
await System.sleepMillis(1000)
9090
await invokeTestCli(['access', 'revoke', '--list-name', 'test-access', '--grantee', pubKey])
@@ -111,7 +111,7 @@ describeCommand(
111111

112112
describe('when verbose option is used', () => {
113113
it('should show grantee list reference and history address', async () => {
114-
const pubKey = await getPublicAddress('http://localhost:21633')
114+
const pubKey = await getPublicAddress('http://localhost:1637')
115115
await invokeTestCli(['access', 'init', ...getStampOption(), '-n', 'test-access', '--grantee', pubKey])
116116
await System.sleepMillis(1000)
117117
await invokeTestCli(['access', 'revoke', '--list-name', 'test-access', '--grantee', pubKey, '--verbose'])
@@ -125,7 +125,7 @@ describeCommand(
125125

126126
describe('show', () => {
127127
it('should show all grantees in the list', async () => {
128-
const granteePubKey = await getPublicAddress('http://localhost:21633')
128+
const granteePubKey = await getPublicAddress('http://localhost:1637')
129129
await invokeTestCli(['access', 'init', ...getStampOption(), '-n', 'test-access'])
130130
await System.sleepMillis(1000)
131131
await invokeTestCli(['access', 'grant', '--list-name', 'test-access', '--grantee', granteePubKey])
@@ -169,7 +169,7 @@ describeCommand(
169169

170170
describe('history', () => {
171171
it('should show the history of operations on a grantee list', async () => {
172-
const granteePubKey = await getPublicAddress('http://localhost:21633')
172+
const granteePubKey = await getPublicAddress('http://localhost:1637')
173173
await invokeTestCli(['access', 'init', ...getStampOption(), '-n', 'test-access', '--grantee', granteePubKey])
174174
await System.sleepMillis(1000)
175175
await invokeTestCli(['access', 'revoke', '--list-name', 'test-access', '--grantee', granteePubKey])

‎test/command/pss.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function sendAndExpect(message: string): Promise<void> {
1515
'--topic-string',
1616
topic,
1717
'--bee-api-url',
18-
'http://localhost:11633',
18+
'http://localhost:1635',
1919
'--timeout',
2020
'120000',
2121
])
@@ -51,7 +51,7 @@ describeCommand('Test PSS command', ({ getNthLastMessage, getLastMessage }) => {
5151
'--topic-string',
5252
'PSS Test',
5353
'--bee-api-url',
54-
'http://localhost:11633',
54+
'http://localhost:1635',
5555
'--timeout',
5656
'30000',
5757
'--out-file',

‎test/command/stamp.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describeCommand(
105105
})
106106

107107
it('should print custom message when there are no stamps', async () => {
108-
await invokeTestCli(['stamp', 'list', '--bee-api-url', 'http://localhost:21633'])
108+
await invokeTestCli(['stamp', 'list', '--bee-api-url', 'http://localhost:1637'])
109109
expect(getNthLastMessage(4)).toContain('You do not have any stamps.')
110110
})
111111

0 commit comments

Comments
 (0)