Skip to content

Commit

Permalink
chore: update autopeering bruno environment, fix MASE request (#2813)
Browse files Browse the repository at this point in the history
* chore(bruno): check data exists before setting the variables

* chore(bruno): set autopeering vars

* chore(mase): fix wallet address key creation

* chore(bruno): add some more env vars to autopeering collection
  • Loading branch information
mkurapov authored Jul 22, 2024
1 parent 15c6ac2 commit e65e032
Show file tree
Hide file tree
Showing 18 changed files with 91 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);

if (body?.data) {
bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);

if (body?.data) {
bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);

if (body?.data) {
bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);

if (body?.data) {
bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}
}

tests {
Expand Down
6 changes: 4 additions & 2 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Asset.bru
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("assetId", body.data.createAsset.asset?.id);

if (body?.data) {
bru.setEnvVar("assetId", body.data.createAsset.asset?.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("incomingPaymentId", body.data.createIncomingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("incomingPaymentId", body.data.createIncomingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("peerId", body.data.createOrUpdatePeerByUrl?.peer.id);

if (body?.data) {
bru.setEnvVar("peerId", body.data.createOrUpdatePeerByUrl?.peer.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPaymentFromIncomingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPaymentFromIncomingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}
}

tests {
Expand Down
6 changes: 4 additions & 2 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Peer.bru
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("peerId", body.data.createPeer.peer.id);

if (body?.data) {
bru.setEnvVar("peerId", body.data.createPeer.peer.id);
}
}
6 changes: 4 additions & 2 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);

if (body?.data) {
bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);

if (body?.data) {
bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("walletAddressKeyId", body.data.createWalletAddressKey.walletAddressKey.id);

if (body?.data) {
bru.setEnvVar("walletAddressKeyId", body.data.createWalletAddressKey.walletAddressKey.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ script:pre-request {

script:post-response {
const body = res.getBody();
bru.setEnvVar("walletAddressId", body.data.createWalletAddress.walletAddress.id);

bru.setEnvVar("walletAddressUrl", body.data.createWalletAddress.walletAddress.url);

bru.setEnvVar('initialWalletAddressRequest',req)

if (body?.data) {
bru.setEnvVar("walletAddressId", body.data.createWalletAddress.walletAddress.id);
bru.setEnvVar("walletAddressUrl", body.data.createWalletAddress.walletAddress.url);
bru.setEnvVar('initialWalletAddressRequest',req)
}
}

tests {
Expand Down
22 changes: 20 additions & 2 deletions bruno/collections/Rafiki/environments/Autopeering.bru
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
vars {
clientWalletAddress: https://ilp.rafiki.money/d99f0eee
clientKeyId: e9a47ee7-99b3-4656-b85f-12431dbc16b9
senderWalletAddress: null
receiverWalletAddress: https://ilp.rafiki.money/d99f0eee
clientWalletAddress: https://ilp.rafiki.money/d99f0eee
clientKeyId: e9a47ee7-99b3-4656-b85f-12431dbc16b9
RafikiGraphqlHost: http://localhost:3001
RafikiAuthGraphqlHost: http://localhost:3003
PeerGraphqlHost: http://localhost:4001
PeerAuthGraphqlHost: http://localhost:4003
cloudNineWalletWebhookUrl: http://localhost:3030/webhooks
happyLifeBankWebhookUrl: http://localhost:3031/webhooks
signatureUrl: https://kxu5d4mr4blcthphxomjlc4xk40rvdsx.lambda-url.eu-central-1.on.aws/
clientPrivateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1DNENBUUF3QlFZREsyVndCQ0lFSUUvMmFwQXduMlJPek5WNWd1L2ltZzdpT05rOWE1Ui9yakFxWVlUWHozZzgKLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLQ==
gfranklinWalletAddress: https://cloud-nine-wallet-backend/accounts/gfranklin
bhamchestWalletAddress: https://cloud-nine-wallet-backend/accounts/bhamchest
wbdcWalletAddress: https://cloud-nine-wallet-backend/accounts/wbdc
pfryWalletAddress: https://happy-life-bank-backend/accounts/pfry
planexWalletAddress: https://happy-life-bank-backend/accounts/planex
asmithWalletAddress: https://happy-life-bank-backend/accounts/asmith
larsWalletAddress: https://happy-life-bank-backend/accounts/lars
davidWalletAddress: https://happy-life-bank-backend/accounts/david
withdrawalTimeout: 60
backendApiSignatureVersion: 1
backendApiSignatureSecret: iyIgCprjb9uL8wFckR+pLEkJWMB7FJhgkvqhTQR/964=
authApiSignatureVersion: 1
authApiSignatureSecret: rPoZpe9tVyBNCigm05QDco7WLcYa0xMao7lO5KG1XG4=
}
9 changes: 5 additions & 4 deletions localenv/mock-account-servicing-entity/app/lib/requesters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ export async function createWalletAddressKey({
const createWalletAddressKeyMutation = gql`
mutation CreateWalletAddressKey($input: CreateWalletAddressKeyInput!) {
createWalletAddressKey(input: $input) {
code
success
message
walletAddressKey {
id
walletAddressId
}
}
}
`
Expand All @@ -148,7 +149,7 @@ export async function createWalletAddressKey({
}
})
.then(({ data }): CreateWalletAddressKeyMutationResponse => {
if (!data.createWalletAddressKey.success) {
if (!data.createWalletAddressKey.walletAddressKey) {
throw new Error('Data was empty')
}
return data.createWalletAddressKey
Expand Down

0 comments on commit e65e032

Please sign in to comment.