Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 58a9bc4

Browse files
lidelAlan Shaw
authored and
Alan Shaw
committed
fix: allow setting Addresses.Delegates (#2253)
This PR adds `Addresses.Delegates` (added in #2195) as an optional array to the schema used for config validation. It fixes the error below: ![2019-07-12--21-00-53](https://user-images.githubusercontent.com/157609/61152758-92e00180-a4e9-11e9-8ef1-c6c1200575ee.png) ps. I tested it in Brave (embedded js-ipfs + preload nodes) and delegated DHT queries produce expected responses 👌 > ![2019-07-12--21-27-35](https://user-images.githubusercontent.com/157609/61153580-eeab8a00-a4eb-11e9-9152-0dcb51e2a67d.png) > ![2019-07-12--21-27-52](https://user-images.githubusercontent.com/157609/61153579-eeab8a00-a4eb-11e9-8478-71f68d3330d4.png) License: MIT Signed-off-by: Marcin Rataj <[email protected]>
1 parent 7fa867e commit 58a9bc4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/core/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const configSchema = s({
5353
config: optional(s({
5454
API: 'object?',
5555
Addresses: optional(s({
56+
Delegates: optional(s(['multiaddr'])),
5657
Swarm: optional(s(['multiaddr'])),
5758
API: 'multiaddr?',
5859
Gateway: 'multiaddr'

test/core/config.spec.js

+4
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ describe('config', () => {
144144
{ config: { Bootstrap: ['/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z'] } },
145145
{ config: { Bootstrap: [] } },
146146

147+
{ config: { Addresses: { Delegates: ['/dns4/node0.preload.ipfs.io/tcp/443/https'] } } },
148+
{ config: { Addresses: { Delegates: [] } } },
149+
{ config: { Addresses: { Delegates: undefined } } },
150+
147151
{ config: undefined }
148152
]
149153

0 commit comments

Comments
 (0)