Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openapi/SwarmCommon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ components:
$ref: "#/components/schemas/P2PUnderlay"
ethereum:
$ref: "#/components/schemas/EthereumAddress"
chain_address:
$ref: "#/components/schemas/EthereumAddress"
publicKey:
$ref: "#/components/schemas/PublicKey"
pssPublicKey:
Expand Down
4 changes: 3 additions & 1 deletion pkg/api/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
type addressesResponse struct {
Overlay *swarm.Address `json:"overlay"`
Underlay []multiaddr.Multiaddr `json:"underlay"`
Ethereum common.Address `json:"ethereum"`
Ethereum common.Address `json:"ethereum"` // deprecated
ChainAddress common.Address `json:"chain_address"`
PublicKey string `json:"publicKey"`
PSSPublicKey string `json:"pssPublicKey"`
}
Expand All @@ -43,6 +44,7 @@ func (s *Service) addressesHandler(w http.ResponseWriter, _ *http.Request) {
Overlay: s.overlay,
Underlay: underlay,
Ethereum: s.ethereumAddress,
ChainAddress: s.ethereumAddress,
PublicKey: hex.EncodeToString(crypto.EncodeSecp256k1PublicKey(&s.publicKey)),
PSSPublicKey: hex.EncodeToString(crypto.EncodeSecp256k1PublicKey(&s.pssPublicKey)),
})
Expand Down
1 change: 1 addition & 0 deletions pkg/api/p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestAddresses(t *testing.T) {
Overlay: &overlay,
Underlay: addresses,
Ethereum: ethereumAddress,
ChainAddress: ethereumAddress,
PublicKey: hex.EncodeToString(crypto.EncodeSecp256k1PublicKey(&privateKey.PublicKey)),
PSSPublicKey: hex.EncodeToString(crypto.EncodeSecp256k1PublicKey(&pssPrivateKey.PublicKey)),
}),
Expand Down
Loading