Page MenuHomePhabricator

D17279.diff
No OneTemporary

D17279.diff

diff --git a/cashtab/src/components/Agora/__tests__/index.test.js b/cashtab/src/components/Agora/__tests__/index.test.js
--- a/cashtab/src/components/Agora/__tests__/index.test.js
+++ b/cashtab/src/components/Agora/__tests__/index.test.js
@@ -53,10 +53,6 @@
localforage,
);
- // We need to give mockedChronik a plugin function
- // This is required for creating a new Agora(mockedChronik)
- mockedChronik.plugin = () => 'dummy plugin';
-
// Mock chronik calls used to build token cache to show
// the user can load a page without having the token info cached
for (const tokenCacheMock of [
diff --git a/cashtab/src/components/Etokens/__tests__/TokenActions.test.js b/cashtab/src/components/Etokens/__tests__/TokenActions.test.js
--- a/cashtab/src/components/Etokens/__tests__/TokenActions.test.js
+++ b/cashtab/src/components/Etokens/__tests__/TokenActions.test.js
@@ -242,10 +242,6 @@
output: { txid: adListTxid },
});
- // We need to give mockedChronik a plugin function
- // This is required for creating a new Agora(mockedChronik)
- mockedChronik.plugin = () => 'dummy plugin';
-
// Mock response for agora select params check
// Note
// We obtain EXPECTED_OFFER_P2SH by adding
@@ -1778,10 +1774,6 @@
output: { txid: offerTxid },
});
- // We need to give mockedChronik a plugin function
- // This is required for creating a new Agora(mockedChronik)
- mockedChronik.plugin = () => 'dummy plugin';
-
// Mock response for agora select params check
// Note
// We obtain EXPECTED_OFFER_P2SH by adding
diff --git a/modules/mock-chronik-client/README.md b/modules/mock-chronik-client/README.md
--- a/modules/mock-chronik-client/README.md
+++ b/modules/mock-chronik-client/README.md
@@ -164,3 +164,7 @@
1.12.2
- Add `MockAgora` to stub ts declarations [D17274](https://reviews.bitcoinabc.org/D17274)
+
+1.12.3
+
+- Add dummy `plugin` method to allow construction of `new Agora()` from `ecash-agora` with a `MockChronikClient` [D17279](https://reviews.bitcoinabc.org/D17279)
diff --git a/modules/mock-chronik-client/index.js b/modules/mock-chronik-client/index.js
--- a/modules/mock-chronik-client/index.js
+++ b/modules/mock-chronik-client/index.js
@@ -91,6 +91,10 @@
// Can access self from inside a method and still get the class
const self = this;
+ // We need to give mockedChronik a plugin function
+ // This is required for creating a new Agora(mockedChronik)
+ self.plugin = () => 'dummy plugin';
+
// API call mock return objects
// Can be set with self.setMock
self.mockedResponses = {
diff --git a/modules/mock-chronik-client/package-lock.json b/modules/mock-chronik-client/package-lock.json
--- a/modules/mock-chronik-client/package-lock.json
+++ b/modules/mock-chronik-client/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "mock-chronik-client",
- "version": "1.12.2",
+ "version": "1.12.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "mock-chronik-client",
- "version": "1.12.2",
+ "version": "1.12.3",
"license": "MIT",
"dependencies": {
"ecashaddrjs": "file:../ecashaddrjs"
diff --git a/modules/mock-chronik-client/package.json b/modules/mock-chronik-client/package.json
--- a/modules/mock-chronik-client/package.json
+++ b/modules/mock-chronik-client/package.json
@@ -4,7 +4,7 @@
},
"name": "mock-chronik-client",
"description": "Testing utility to mock the Chronik indexer client and support unit tests that need to mock chronik related API calls.",
- "version": "1.12.2",
+ "version": "1.12.3",
"main": "index.js",
"devDependencies": {
"mocha": "^10.2.0",

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 10:11 (7 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187304
Default Alt Text
D17279.diff (3 KB)

Event Timeline