Skip to content

Commit

Permalink
Merge #2562 #2593
Browse files Browse the repository at this point in the history
2562: ADP-744 Swagger spec update r=rvl a=reactormonk

# Issue Number

ADP-744


# Overview

The `inspectAddress` passes along a `Value` struct directly from `addresses`, so there isn't much work to be done here. See IntersectMBO/cardano-addresses#110 for the actual implementation

- [x] Updates OpenAPI spec
- [x] Adds integration test, testing that bech32 fields are present and correct (the rest of the tests are in cardano-addresses).
- [x] Updates cardano-addresses revision in `stack.yaml` and `cabal.project` to a master branch rev with IntersectMBO/cardano-addresses#115 merged.
- [x] Update for cardano-addresses API changes since last release.

# Comments

- May be worth considering typing `inspectAddress` in a more fine-grained manner ⇒ ADP-847.
- Requires IntersectMBO/cardano-addresses#115 to be merged first.


2593: Regenerate TLS certs for unit tests r=Anviking a=rvl

### Issue Number

ADP-852

### Overview

- Generate new certificates for the TLS tests, because the current ones have expired.
- Add a script to regenerate those files.

### Comments

Using cardano-sl-x509 turned out to be harder than expected ... doh ... should have just used openssl.


Co-authored-by: Simon Hafner <[email protected]>
Co-authored-by: Rodney Lorrimar <[email protected]>
  • Loading branch information
3 people authored Apr 1, 2021
3 parents af82524 + e768806 + e14b037 commit 20dc1dd
Show file tree
Hide file tree
Showing 40 changed files with 557 additions and 468 deletions.
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-addresses
tag: 05bd6d0b877d8fc440be83142935fa1e7a915916
tag: 55f174b32095e4264e0c75344caf34f4207a4e58
subdir: command-line
core

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,17 @@ spec = describe "SHELLEY_ADDRESSES" $ do
r <- request @Aeson.Value ctx (Link.inspectAddress str) Default Empty
expectResponseCode HTTP.status400 r

it "ADDRESS_INSPECT_03 - Address inspect bech32" $ \ctx -> do
let str = "addr_test1qzamu40sglnsrylzv9jylekjmzgaqsg5v5z9u6yk3jpnnxjwck77fqu8deuumsvnazjnjhwasc2eetfqpa2pvygts78ssd5388"
r <- request @Aeson.Value ctx (Link.inspectAddress str) Default Empty
verify r
[ expectResponseCode HTTP.status200
, expectField (Aeson.key "spending_key_hash_bech32" . Aeson._String)
(`shouldBe` "addr_test1hwl9tuz8uuqe8cnpv387d5kcj8gyz9r9q30x395vsvue5una0f4")
, expectField (Aeson.key "stake_key_hash_bech32" . Aeson._String)
(`shouldBe` "stake_vkh1fmzmmeyrsah8nnwpj0522w2amkrpt89dyq84g9s3pwrc7dqjnfu")
]

-- Generating golden test data for enterprise addresses - script credential:
--- $ cardano-address script hash "$(cat script.txt)" \
--- | cardano-address address payment --from-script --network-tag mainnet
Expand Down
1 change: 1 addition & 0 deletions lib/core/cardano-wallet-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ test-suite unit
, cardano-wallet-core
, cardano-wallet-launcher
, cardano-wallet-test-utils
, cardano-sl-x509
, cardano-slotting
, cborg
, connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import Data.Either.Combinators
import Data.Kind
( Type )
import Data.Maybe
( fromMaybe, isJust )
( fromJust, fromMaybe, isJust )
import Data.Type.Equality
( (:~:) (..), testEquality )
import Type.Reflection
Expand Down Expand Up @@ -107,7 +107,7 @@ replaceCosignersWithVerKeys role (ScriptTemplate xpubs scriptTemplate) ix =
ActiveFromSlot s -> ActiveFromSlot s
ActiveUntilSlot s -> ActiveUntilSlot s
convertIndex :: Index 'Soft 'ScriptK -> CA.Index 'CA.Soft 'CA.PaymentK
convertIndex = toEnum .fromEnum
convertIndex = fromJust . CA.indexFromWord32 . fromIntegral . fromEnum
toKeyHash :: Cosigner -> KeyHash
toKeyHash c =
let (Just accXPub) =
Expand Down
36 changes: 18 additions & 18 deletions lib/core/test/data/PKIs/1/ca.crt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDSDCCAjCgAwIBAgIB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ZuzTbD4ZfzQhBrBN1yUO+dx4Rf
A6yXxOBtUfRBkaugFUwSwNEeaWFgXURkYU5n7mW5wIFyCpuCSZCxFigR6jlzeXl3
oDs7L/5YC+GT5+IgJ+akGQIp7FQkzk4V3+7IVFSeBxZ0konl
-----END CERTIFICATE-----
20 changes: 0 additions & 20 deletions lib/core/test/data/PKIs/1/client.crt

This file was deleted.

27 changes: 0 additions & 27 deletions lib/core/test/data/PKIs/1/client.key

This file was deleted.

47 changes: 0 additions & 47 deletions lib/core/test/data/PKIs/1/client.pem

This file was deleted.

20 changes: 20 additions & 0 deletions lib/core/test/data/PKIs/1/client/client.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDVjCCAj6gAwIBAgIBAzANBgkqhkiG9w0BAQsFADBHMRgwFgYDVQQKDA9JbnB1
dCBPdXRwdXQgSEsxKzApBgNVBAMMImNhcmRhbm8td2FsbGV0IFNlbGYtU2lnbmVk
IFJvb3QgQ0EwHhcNMjEwNDAxMDYyODU1WhcNMjIwNDAxMDYyOTU1WjA+MRgwFgYD
VQQKDA9JbnB1dCBPdXRwdXQgSEsxIjAgBgNVBAMMGWNhcmRhbm8td2FsbGV0IFRl
c3QgU3VpdGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfRk/SNmYW
5f6jZfqwilHWpYCTbrmO5oLYhEmv+oxRAaqUPcsBbxpNXAfOUau8tpjfmdWY6N8C
0JPVd3X2Fqu5m2u26fPKCZkbZHxJoIKwaAFTIDYXAY7UeNf623oTqGyjb13sTvcE
rNlwOe5Ghb8OBRnzVYwwZOVz65H8065iQwv/U1OzvawChWKHRt/8FsKerOkG5RHc
N7lzIz2iscVDwc1LeNRlAvdCSBsvGsTIU6cn6lK11yty1HaAWVu4O8A7xCTZTaK7
7wpjvwCeAOBJPwYzTA9sGBvVPTWlD6GeZVDcPXpCcG5rp+3AhluZ1HppHpTf1FPS
2X3c+arNg+oHAgMBAAGjVjBUMA8GA1UdDwEB/wQFAwMHoAAwEwYDVR0lBAwwCgYI
KwYBBQUHAwIwDAYDVR0TBAUwAwEBADANBgNVHQ4EBgQEUbVogTAPBgNVHSMECDAG
gASaNDWcMA0GCSqGSIb3DQEBCwUAA4IBAQCcnZVyujIOjH2Shvslj5XJ4+8LO0aM
CuzHBZY5e2CH8qOdW6tTBF7yGlwL8+vUDwpvCkeXzn8sVF6nsEQhmM/fgwtKc7Eq
PtaFiEUHdVFlKl97bPA+cPqEMPCJyx3upN4YV1undZ7kZdcQdmBW0jxSHyAGOJVa
pi8GDSWyY2sbn8WOebSXLhPHqxjGTwMpFK7kTD0BZx4I0C1OawRBzrJAd1SFNJq+
LJpI3TEjzUYy4SC4ziR0AgDlmyLne8aAbYWF6KG80Y3wDhf8XhCCHfZKOezjr7fz
pHqgER2c/vi/gkUpZ7mIgYPApcBXuUlrRWFv9vGjTzLmIbQGitl49zFS
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions lib/core/test/data/PKIs/1/client/client.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAn0ZP0jZmFuX+o2X6sIpR1qWAk265juaC2IRJr/qMUQGqlD3L
AW8aTVwHzlGrvLaY35nVmOjfAtCT1Xd19haruZtrtunzygmZG2R8SaCCsGgBUyA2
FwGO1HjX+tt6E6hso29d7E73BKzZcDnuRoW/DgUZ81WMMGTlc+uR/NOuYkML/1NT
s72sAoVih0bf/BbCnqzpBuUR3De5cyM9orHFQ8HNS3jUZQL3QkgbLxrEyFOnJ+pS
tdcrctR2gFlbuDvAO8Qk2U2iu+8KY78AngDgST8GM0wPbBgb1T01pQ+hnmVQ3D16
QnBua6ftwIZbmdR6aR6U39RT0tl93PmqzYPqBwIDAQABAoIBAQCao9uwD50DMn8P
Cl5htYpLyxiRDHog4nG74oTg1XQS2nlRwMUvOT3iSi5SBT2m1eqLfoLCGaccxoIi
SgA/1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mttZ+US
tlTx0N5L84mMkLQFESEwU60zEjPF+bLhPgJBj3Xepwf8VVZbNgOaEg==
-----END RSA PRIVATE KEY-----
47 changes: 47 additions & 0 deletions lib/core/test/data/PKIs/1/client/client.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAn0ZP0jZmFuX+o2X6sIpR1qWAk265juaC2IRJr/qMUQGqlD3L
AW8aTVwHzlGrvLaY35nVmOjfAtCT1Xd19haruZtrtunzygmZG2R8SaCCsGgBUyA2
FwGO1HjX+tt6E6hso29d7E73BKzZcDnuRoW/DgUZ81WMMGTlc+uR/NOuYkML/1NT
s72sAoVih0bf/BbCnqzpBuUR3De5cyM9orHFQ8HNS3jUZQL3QkgbLxrEyFOnJ+pS
tdcrctR2gFlbuDvAO8Qk2U2iu+8KY78AngDgST8GM0wPbBgb1T01pQ+hnmVQ3D16
QnBua6ftwIZbmdR6aR6U39RT0tl93PmqzYPqBwIDAQABAoIBAQCao9uwD50DMn8P
Cl5htYpLyxiRDHog4nG74oTg1XQS2nlRwMUvOT3iSi5SBT2m1eqLfoLCGaccxoIi
SgA/1Dca2Gm2iGNoj/UVgXSiz7LTr8dJfAbIQ3z3kfSw3RMjruz7qY8ZdnmjEmdy
7OwJkKW06QMPHMol2nBlIhz1yliPkV0iHXIUVW9euUmq+Pi2jlDKwImAmsVXugQX
Iop33mWROBk2lqkueqykNyq2htK4yopk+AjoIm6m005Qd6k0xx0+GIv8YAomOctq
GVGK+bXCgI106boqOCbL8act2bXtJZhE6oqdufwb2ycOObe7OoJCtbjUKxZET+mX
LBhfRAvhAoGBAMkK6lIJGH/iLa55mMVqMz5cyfVRAvm8IIPP49Szhwmq+adxll9e
fUGBrGSmC2l8jrERZxzLvoX6qRkBoG6auVsFN2gAmCxgF9wCc7L5/L2GSeMX/blB
3vHr8cKpt5FGHKsNU1aNAU04ozFSEJjhykX1f4aTT9nJPvBJOBObli+5AoGBAMr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jZfqwilHWpYCTbrmO5oLYhEmv+oxRAaqUPcsBbxpNXAfOUau8tpjfmdWY6N8C
0JPVd3X2Fqu5m2u26fPKCZkbZHxJoIKwaAFTIDYXAY7UeNf623oTqGyjb13sTvcE
rNlwOe5Ghb8OBRnzVYwwZOVz65H8065iQwv/U1OzvawChWKHRt/8FsKerOkG5RHc
N7lzIz2iscVDwc1LeNRlAvdCSBsvGsTIU6cn6lK11yty1HaAWVu4O8A7xCTZTaK7
7wpjvwCeAOBJPwYzTA9sGBvVPTWlD6GeZVDcPXpCcG5rp+3AhluZ1HppHpTf1FPS
2X3c+arNg+oHAgMBAAGjVjBUMA8GA1UdDwEB/wQFAwMHoAAwEwYDVR0lBAwwCgYI
KwYBBQUHAwIwDAYDVR0TBAUwAwEBADANBgNVHQ4EBgQEUbVogTAPBgNVHSMECDAG
gASaNDWcMA0GCSqGSIb3DQEBCwUAA4IBAQCcnZVyujIOjH2Shvslj5XJ4+8LO0aM
CuzHBZY5e2CH8qOdW6tTBF7yGlwL8+vUDwpvCkeXzn8sVF6nsEQhmM/fgwtKc7Eq
PtaFiEUHdVFlKl97bPA+cPqEMPCJyx3upN4YV1undZ7kZdcQdmBW0jxSHyAGOJVa
pi8GDSWyY2sbn8WOebSXLhPHqxjGTwMpFK7kTD0BZx4I0C1OawRBzrJAd1SFNJq+
LJpI3TEjzUYy4SC4ziR0AgDlmyLne8aAbYWF6KG80Y3wDhf8XhCCHfZKOezjr7fz
pHqgER2c/vi/gkUpZ7mIgYPApcBXuUlrRWFv9vGjTzLmIbQGitl49zFS
-----END CERTIFICATE-----
22 changes: 0 additions & 22 deletions lib/core/test/data/PKIs/1/server.crt

This file was deleted.

27 changes: 0 additions & 27 deletions lib/core/test/data/PKIs/1/server.key

This file was deleted.

Loading

0 comments on commit 20dc1dd

Please sign in to comment.