Skip to content

Commit

Permalink
fix: b36 in http-proxy-over-p2p tests
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
  • Loading branch information
lidel committed Jul 10, 2020
1 parent 79d571f commit 357155c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sharness/t0184-http-proxy-over-p2p.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ test_expect_success 'handle multipart/form-data http request' '
'

# subdomain gateway at *.p2p.example.com requires PeerdID in base32
RECEIVER_ID_CIDv1=$( ipfs cid format -v 1 -b b --codec libp2p-key -- $RECEIVER_ID)
RECEIVER_ID_CIDv1=$( ipfs cid format -v 1 --codec libp2p-key -b base36 -- $RECEIVER_ID)

This comment has been minimized.

Copy link
@ribasushi

ribasushi Jul 10, 2020

Contributor

Hmmmm since we are going "full speed ahead" on keys being b36. Shouldn't the -b be implied now?
That is it should be enough to say ipfs cid format --codec libp2p-key to get the expected canonical version

@aschmahmann @petar thoughts?

This comment has been minimized.

Copy link
@petar

petar Jul 10, 2020

Contributor

Sounds reasonable to me.

This comment has been minimized.

Copy link
@aschmahmann

aschmahmann Jul 10, 2020

Contributor

@ribasushi I think that change would be a bit inconsistent and difficult to document. The current semantics are to take an inbound CID and modify fields in it one by one (i.e. version, codec, base),

This would, for just one codec, set a default base such that if I wanted to have the existing behavior of only changing the codec I would have to do some thing like:

oldBase = ipfs cid format -f "%b"
ipfs cid format -v 1 --codec libp2p-key -b oldBase

How would we document to users that they'd now need to do this?

This comment has been minimized.

Copy link
@ribasushi

ribasushi Jul 10, 2020

Contributor

@aschmahmann good point, I did not think of this use-case of cid format
@lidel suggestion retracted ;)

This comment has been minimized.

Copy link
@aschmahmann

aschmahmann Jul 10, 2020

Contributor

I also wanted to clarify that libp2p-keys are still valid to be represented in any base, it's just that for a nice UX we'd like to print out libp2p keys consistently.

btw it's not even clear that we're going full steam ahead on switching to b36 for all libp2p keys. We will be doing b36 for all IPNS keys, but with libp2p peerIDs it's a bit more complicated to get done (some context in libp2p/go-libp2p#976)


# OK: $peerid.p2p.example.com/http/index.txt
test_expect_success "handle http request to a subdomain gateway" '
Expand Down

0 comments on commit 357155c

Please sign in to comment.