-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating tests and updates from tests
- Loading branch information
1 parent
fbc41f6
commit 906a046
Showing
27 changed files
with
3,832 additions
and
2,939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,600 changes: 885 additions & 715 deletions
1,600
...sts/btc/referenced_payment_noneexistence/referenced_payment_noneexistence_mic.e2e-spec.ts
Large diffs are not rendered by default.
Oops, something went wrong.
1,890 changes: 1,048 additions & 842 deletions
1,890
...renced_payment_noneexistence/referenced_payment_noneexistence_prepare_request.e2e-spec.ts
Large diffs are not rendered by default.
Oops, something went wrong.
2,219 changes: 1,346 additions & 873 deletions
2,219
...enced_payment_noneexistence/referenced_payment_noneexistence_prepare_response.e2e-spec.ts
Large diffs are not rendered by default.
Oops, something went wrong.
141 changes: 66 additions & 75 deletions
141
...c/referenced_payment_noneexistence/referenced_payment_noneexistence_verifyFDC.e2e-spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,67 @@ | ||
import { expect } from "chai"; | ||
import * as request from "supertest"; | ||
import { app } from "../helper"; | ||
|
||
|
||
describe("/ReferencedPaymentNonexistence/verifyFDC", () => { | ||
it("should get status", async () => { | ||
const payload = { | ||
abiEncodedRequest: "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb" | ||
} | ||
const response = await request(app.getHttpServer()) | ||
.post("/ReferencedPaymentNonexistence/verifyFDC") | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(200) | ||
.expect('Content-Type', /json/) | ||
|
||
expect(response.body.status).to.be.equal('VALID'); | ||
}); | ||
it("should get abiEncodedResponse without 0x in abiEncodedRequest", async () => { | ||
const payload = { | ||
abiEncodedRequest: "5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb", | ||
} | ||
const response = await request(app.getHttpServer()) | ||
.post("/ReferencedPaymentNonexistence/verifyFDC") | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(200) | ||
.expect('Content-Type', /json/) | ||
|
||
expect(response.body.status).to.be.equal('VALID'); | ||
}); | ||
it("should get abiEncodedResponse with 0X in abiEncodedRequest", async () => { | ||
const payload = { | ||
abiEncodedRequest: "0X5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb", | ||
} | ||
const response = await request(app.getHttpServer()) | ||
.post("/ReferencedPaymentNonexistence/verifyFDC") | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(200) | ||
.expect('Content-Type', /json/) | ||
|
||
expect(response.body.status).to.be.equal('VALID'); | ||
}); | ||
it("should get bad request (400) with empty payload", async () => { | ||
const payload = { | ||
} | ||
await request(app.getHttpServer()) | ||
.post("/ReferencedPaymentNonexistence/verifyFDC") | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(400) | ||
}); | ||
it("should get bad request (400) with non hexadecimal character in abiEncodedRequest", async () => { | ||
const payload = { | ||
abiEncodedRequest: "0xy265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb", | ||
} | ||
await request(app.getHttpServer()) | ||
.post("/ReferencedPaymentNonexistence/verifyFDC") | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(400) | ||
}); | ||
import { expect } from 'chai'; | ||
import * as request from 'supertest'; | ||
import { app } from '../helper'; | ||
|
||
describe('/ReferencedPaymentNonexistence/verifyFDC', () => { | ||
it('should get status', async () => { | ||
const payload = { | ||
abiEncodedRequest: | ||
'0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb', | ||
}; | ||
const response = await request(app.getHttpServer()) | ||
.post('/ReferencedPaymentNonexistence/verifyFDC') | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(200) | ||
.expect('Content-Type', /json/); | ||
|
||
expect(response.body.status).to.be.equal('VALID'); | ||
}); | ||
it('should get abiEncodedResponse without 0x in abiEncodedRequest', async () => { | ||
const payload = { | ||
abiEncodedRequest: | ||
'5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb', | ||
}; | ||
const response = await request(app.getHttpServer()) | ||
.post('/ReferencedPaymentNonexistence/verifyFDC') | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(200) | ||
.expect('Content-Type', /json/); | ||
|
||
expect(response.body.status).to.be.equal('VALID'); | ||
}); | ||
it('should get abiEncodedResponse with 0X in abiEncodedRequest', async () => { | ||
const payload = { | ||
abiEncodedRequest: | ||
'0X5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb', | ||
}; | ||
const response = await request(app.getHttpServer()) | ||
.post('/ReferencedPaymentNonexistence/verifyFDC') | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(200) | ||
.expect('Content-Type', /json/); | ||
|
||
expect(response.body.status).to.be.equal('VALID'); | ||
}); | ||
it('should get bad request (400) with empty payload', async () => { | ||
const payload = {}; | ||
await request(app.getHttpServer()) | ||
.post('/ReferencedPaymentNonexistence/verifyFDC') | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(400); | ||
}); | ||
it('should get bad request (400) with non hexadecimal character in abiEncodedRequest', async () => { | ||
const payload = { | ||
abiEncodedRequest: | ||
'0xy265666572656e6365645061796d656e744e6f6e6578697374656e6365000000746573744254430000000000000000000000000000000000000000000000000082397886cabdaf4b939554abd5c36dbcb2607d3af32f6e1ad8bdba4a368ba6ec0000000000000000000000000000000000000000000000000000000000354167000000000000000000000000000000000000000000000000000000000035416a0000000000000000000000000000000000000000000000000000000067481f7910b66af8f7bb2f450482037671e44a90ebcaf13e032108d3e8e82b9ec13bfc3700000000000000000000000000000000000000000000000000000000004e86c600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001cb59478070fabf8aef96f6ff20a05abb8e922601cd24f13a4fc876b35fa62feb', | ||
}; | ||
await request(app.getHttpServer()) | ||
.post('/ReferencedPaymentNonexistence/verifyFDC') | ||
.send(payload) | ||
.set('X-API-KEY', '12345') | ||
.expect(400); | ||
}); | ||
}); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.