Skip to content

Commit 189e02b

Browse files
authored
Remove circular deps (#2232)
* Removing circular dependencies
1 parent e3ed0f7 commit 189e02b

File tree

24 files changed

+769
-740
lines changed

24 files changed

+769
-740
lines changed

bevm/bevm_attr_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func TestAttrBevm(t *testing.T) {
122122
// Create new ledger
123123
cl, _, err := byzcoin.NewLedger(genesisMsg, false)
124124
require.NoError(t, err)
125+
require.NoError(t, cl.UseNode(0))
125126

126127
// Spawn a new BEvm instance
127128
bevmID, err := NewBEvm(cl, signer, gDarc)

external/js/cothority/spec/byzcoin/stream.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Log } from "../../src";
22
import ByzCoinRPC from "../../src/byzcoin/byzcoin-rpc";
33
import { PaginateRequest, PaginateResponse } from "../../src/byzcoin/proto/stream";
4-
import { WebSocketConnection } from "../../src/network/connection";
4+
import { WebSocketConnection } from "../../src/network";
55
import { BLOCK_INTERVAL, ROSTER, SIGNER, startConodes } from "../support/conondes";
66

77
describe("Stream Tests", () => {

external/js/cothority/spec/network/connection.spec.ts

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Message } from "protobufjs/light";
2-
import { BrowserWebSocketAdapter } from "../../src/network";
32
import {
3+
BrowserWebSocketAdapter,
44
LeaderConnection,
55
RosterWSConnection,
66
setFactory,
77
WebSocketConnection,
8-
} from "../../src/network/connection";
8+
} from "../../src/network";
99
import { Roster, ServerIdentity } from "../../src/network/proto";
1010
import { ROSTER } from "../support/conondes";
1111
import TestWebSocket from "./websocket-test-adapter";
@@ -177,9 +177,15 @@ describe("WebSocketAdapter Tests with sendStream", () => {
177177
const msg = new Roster();
178178

179179
conn.sendStream(msg, Roster).subscribe({
180-
complete: () => {throw new Error("should not complete"); },
181-
error: () => {throw new Error("should not get error"); },
182-
next: () => {done(); },
180+
complete: () => {
181+
throw new Error("should not complete");
182+
},
183+
error: () => {
184+
throw new Error("should not get error");
185+
},
186+
next: () => {
187+
done();
188+
},
183189
});
184190
});
185191

@@ -190,12 +196,16 @@ describe("WebSocketAdapter Tests with sendStream", () => {
190196
const msg = new Roster();
191197

192198
conn.sendStream(msg, Roster).subscribe({
193-
complete: () => {throw new Error("should not complete"); },
199+
complete: () => {
200+
throw new Error("should not complete");
201+
},
194202
error: (err: Error) => {
195203
expect(err).toEqual(new Error("reason to close"));
196204
done();
197205
},
198-
next: () => {throw new Error("should not get value"); },
206+
next: () => {
207+
throw new Error("should not get value");
208+
},
199209
});
200210
});
201211

@@ -207,12 +217,16 @@ describe("WebSocketAdapter Tests with sendStream", () => {
207217
const msg = new Roster();
208218

209219
conn.sendStream(msg, Roster).subscribe({
210-
complete: () => {throw new Error("should not complete"); },
220+
complete: () => {
221+
throw new Error("should not complete");
222+
},
211223
error: (err: Error) => {
212224
expect(err).toEqual(new Error("timeout"));
213225
done();
214226
},
215-
next: () => {throw new Error("should not get value"); },
227+
next: () => {
228+
throw new Error("should not get value");
229+
},
216230
});
217231
});
218232

@@ -222,9 +236,13 @@ describe("WebSocketAdapter Tests with sendStream", () => {
222236
const conn = new WebSocketConnection("http://example.com", "");
223237

224238
conn.sendStream(new Roster(), Roster).subscribe({
225-
complete: () => {throw new Error("shouldn't complete"); },
239+
complete: () => {
240+
throw new Error("shouldn't complete");
241+
},
226242
error: () => done(),
227-
next: () => {throw new Error("should not get value"); },
243+
next: () => {
244+
throw new Error("should not get value");
245+
},
228246
});
229247
});
230248

external/js/cothority/spec/skipchain/skipchain-rpc.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Log from "../../src/log";
2-
import { Roster } from "../../src/network";
3-
import { RosterWSConnection, WebSocketConnection } from "../../src/network/connection";
2+
import { Roster, RosterWSConnection, WebSocketConnection } from "../../src/network";
43
import { SkipBlock, SkipchainRPC } from "../../src/skipchain";
54
import { ROSTER, startConodes } from "../support/conondes";
65

external/js/cothority/spec/support/conondes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fs from "fs";
44
import Long from "long";
55

66
import SignerEd25519 from "../../src/darc/signer-ed25519";
7-
import { RosterWSConnection } from "../../src/network/connection";
7+
import { RosterWSConnection } from "../../src/network";
88
import { Roster } from "../../src/network/proto";
99

1010
const docker = new Docker();

external/js/cothority/src/byzcoin/byzcoin-rpc.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { Rule } from "../darc";
66
import Darc from "../darc/darc";
77
import IdentityEd25519 from "../darc/identity-ed25519";
88
import IdentityWrapper, { IIdentity } from "../darc/identity-wrapper";
9-
import { WebSocketAdapter } from "../network";
10-
import { IConnection, LeaderConnection, RosterWSConnection } from "../network/connection";
11-
import { Roster } from "../network/proto";
9+
import { IConnection, LeaderConnection, Roster, RosterWSConnection, WebSocketAdapter } from "../network";
1210
import { SkipBlock } from "../skipchain/skipblock";
1311
import SkipchainRPC from "../skipchain/skipchain-rpc";
1412
import ClientTransaction, { ICounterUpdater } from "./client-transaction";

external/js/cothority/src/byzcoin/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ByzCoinRPC, { CONFIG_INSTANCE_ID } from "./byzcoin-rpc";
1+
import ByzCoinRPC, { CONFIG_INSTANCE_ID, IStorage, LocalCache } from "./byzcoin-rpc";
22
import ClientTransaction, { Argument, Instruction } from "./client-transaction";
33
import ChainConfig from "./config";
44
import Instance, { InstanceID } from "./instance";
@@ -15,4 +15,6 @@ export {
1515
StateChangeBody,
1616
Instance,
1717
InstanceID,
18+
IStorage,
19+
LocalCache,
1820
};

external/js/cothority/src/calypso/calypso-rpc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Message, Properties } from "protobufjs/light";
33
import { Argument, ClientTransaction, InstanceID, Instruction, Proof } from "../byzcoin";
44
import ByzCoinRPC from "../byzcoin/byzcoin-rpc";
55
import { Signer } from "../darc";
6-
import { Roster, ServerIdentity } from "../network";
7-
import { IConnection, RosterWSConnection, WebSocketConnection } from "../network/connection";
6+
import { IConnection, Roster, ServerIdentity, WebSocketConnection } from "../network";
7+
import { RosterWSConnection } from "../network";
88
import { registerMessage } from "../protobuf";
99
import { DecodeKey, OnChainSecretInstance } from "./calypso-instance";
1010

0 commit comments

Comments
 (0)