diff --git a/.github/workflows/js_sdk_ci.yml b/.github/workflows/js_sdk_ci.yml index 0640270c..e20a0802 100644 --- a/.github/workflows/js_sdk_ci.yml +++ b/.github/workflows/js_sdk_ci.yml @@ -13,8 +13,7 @@ jobs: strategy: matrix: - node-version: [14.x, 15.x] - node-env: ['', ':node'] + node-version: [14.x, 15.x, 16.x, 17.x] steps: - uses: actions/checkout@v2 @@ -37,6 +36,6 @@ jobs: docker run -d --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local --aqua-pool-size 2 - run: npm install - - run: npm run test${{ matrix.node-env }}:all + - run: npm run test:all env: CI: true diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 5ace1724..29e5b0f4 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1 +1 @@ -window.searchData = {"kinds":{"32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":64,"name":"setLogLevel","url":"modules.html#setLogLevel","classes":"tsd-kind-function"},{"id":1,"kind":32,"name":"Fluence","url":"modules.html#Fluence","classes":"tsd-kind-variable"},{"id":2,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"Fluence"},{"id":3,"kind":1024,"name":"start","url":"modules.html#Fluence.__type.start","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":4,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":5,"kind":1024,"name":"stop","url":"modules.html#Fluence.__type.stop","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":6,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":7,"kind":1024,"name":"getStatus","url":"modules.html#Fluence.__type.getStatus","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":8,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":9,"kind":1024,"name":"getPeer","url":"modules.html#Fluence.__type.getPeer","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":10,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":11,"kind":256,"name":"PeerStatus","url":"interfaces/PeerStatus.html","classes":"tsd-kind-interface"},{"id":12,"kind":1024,"name":"isInitialized","url":"interfaces/PeerStatus.html#isInitialized","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":13,"kind":1024,"name":"isConnected","url":"interfaces/PeerStatus.html#isConnected","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":14,"kind":1024,"name":"peerId","url":"interfaces/PeerStatus.html#peerId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":15,"kind":1024,"name":"relayPeerId","url":"interfaces/PeerStatus.html#relayPeerId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":16,"kind":128,"name":"KeyPair","url":"classes/KeyPair.html","classes":"tsd-kind-class"},{"id":17,"kind":2048,"name":"fromEd25519SK","url":"classes/KeyPair.html#fromEd25519SK","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"KeyPair"},{"id":18,"kind":2048,"name":"randomEd25519","url":"classes/KeyPair.html#randomEd25519","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"KeyPair"},{"id":19,"kind":512,"name":"constructor","url":"classes/KeyPair.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"KeyPair"},{"id":20,"kind":1024,"name":"Libp2pPeerId","url":"classes/KeyPair.html#Libp2pPeerId","classes":"tsd-kind-property tsd-parent-kind-class","parent":"KeyPair"},{"id":21,"kind":2048,"name":"toEd25519PrivateKey","url":"classes/KeyPair.html#toEd25519PrivateKey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"KeyPair"},{"id":22,"kind":128,"name":"FluencePeer","url":"classes/FluencePeer.html","classes":"tsd-kind-class"},{"id":23,"kind":2048,"name":"isInstance","url":"classes/FluencePeer.html#isInstance","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"FluencePeer"},{"id":24,"kind":512,"name":"constructor","url":"classes/FluencePeer.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"FluencePeer"},{"id":25,"kind":2048,"name":"getStatus","url":"classes/FluencePeer.html#getStatus","classes":"tsd-kind-method tsd-parent-kind-class","parent":"FluencePeer"},{"id":26,"kind":2048,"name":"start","url":"classes/FluencePeer.html#start","classes":"tsd-kind-method tsd-parent-kind-class","parent":"FluencePeer"},{"id":27,"kind":2048,"name":"stop","url":"classes/FluencePeer.html#stop","classes":"tsd-kind-method tsd-parent-kind-class","parent":"FluencePeer"},{"id":28,"kind":262144,"name":"internals","url":"classes/FluencePeer.html#internals","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"FluencePeer"},{"id":29,"kind":4194304,"name":"AvmLoglevel","url":"modules.html#AvmLoglevel","classes":"tsd-kind-type-alias"},{"id":30,"kind":256,"name":"PeerConfig","url":"interfaces/PeerConfig.html","classes":"tsd-kind-interface"},{"id":31,"kind":1024,"name":"connectTo","url":"interfaces/PeerConfig.html#connectTo","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":32,"kind":1024,"name":"avmLogLevel","url":"interfaces/PeerConfig.html#avmLogLevel","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":33,"kind":1024,"name":"KeyPair","url":"interfaces/PeerConfig.html#KeyPair","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":34,"kind":1024,"name":"checkConnectionTimeoutMs","url":"interfaces/PeerConfig.html#checkConnectionTimeoutMs","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":35,"kind":1024,"name":"skipCheckConnection","url":"interfaces/PeerConfig.html#skipCheckConnection","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":36,"kind":1024,"name":"dialTimeoutMs","url":"interfaces/PeerConfig.html#dialTimeoutMs","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":37,"kind":1024,"name":"defaultTtlMs","url":"interfaces/PeerConfig.html#defaultTtlMs","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":38,"kind":4194304,"name":"PeerIdB58","url":"modules.html#PeerIdB58","classes":"tsd-kind-type-alias"},{"id":39,"kind":256,"name":"CallParams","url":"interfaces/CallParams.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":40,"kind":1024,"name":"particleId","url":"interfaces/CallParams.html#particleId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":41,"kind":1024,"name":"initPeerId","url":"interfaces/CallParams.html#initPeerId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":42,"kind":1024,"name":"timestamp","url":"interfaces/CallParams.html#timestamp","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":43,"kind":1024,"name":"ttl","url":"interfaces/CallParams.html#ttl","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":44,"kind":1024,"name":"signature","url":"interfaces/CallParams.html#signature","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":45,"kind":1024,"name":"tetraplets","url":"interfaces/CallParams.html#tetraplets","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,34.447]],["parent/0",[]],["name/1",[1,29.339]],["parent/1",[]],["name/2",[2,21.454]],["parent/2",[1,2.668]],["name/3",[3,29.339]],["parent/3",[4,1.555]],["name/4",[2,21.454]],["parent/4",[4,1.555]],["name/5",[5,29.339]],["parent/5",[4,1.555]],["name/6",[2,21.454]],["parent/6",[4,1.555]],["name/7",[6,29.339]],["parent/7",[4,1.555]],["name/8",[2,21.454]],["parent/8",[4,1.555]],["name/9",[7,34.447]],["parent/9",[4,1.555]],["name/10",[2,21.454]],["parent/10",[4,1.555]],["name/11",[8,21.454]],["parent/11",[]],["name/12",[9,34.447]],["parent/12",[8,1.951]],["name/13",[10,34.447]],["parent/13",[8,1.951]],["name/14",[11,34.447]],["parent/14",[8,1.951]],["name/15",[12,34.447]],["parent/15",[8,1.951]],["name/16",[13,18.352]],["parent/16",[]],["name/17",[14,34.447]],["parent/17",[13,1.669]],["name/18",[15,34.447]],["parent/18",[13,1.669]],["name/19",[16,29.339]],["parent/19",[13,1.669]],["name/20",[17,34.447]],["parent/20",[13,1.669]],["name/21",[18,34.447]],["parent/21",[13,1.669]],["name/22",[19,18.352]],["parent/22",[]],["name/23",[20,34.447]],["parent/23",[19,1.669]],["name/24",[16,29.339]],["parent/24",[19,1.669]],["name/25",[6,29.339]],["parent/25",[19,1.669]],["name/26",[3,29.339]],["parent/26",[19,1.669]],["name/27",[5,29.339]],["parent/27",[19,1.669]],["name/28",[21,34.447]],["parent/28",[19,1.669]],["name/29",[22,29.339]],["parent/29",[]],["name/30",[23,17.101]],["parent/30",[]],["name/31",[24,34.447]],["parent/31",[23,1.555]],["name/32",[22,29.339]],["parent/32",[23,1.555]],["name/33",[13,18.352]],["parent/33",[23,1.555]],["name/34",[25,34.447]],["parent/34",[23,1.555]],["name/35",[26,34.447]],["parent/35",[23,1.555]],["name/36",[27,34.447]],["parent/36",[23,1.555]],["name/37",[28,34.447]],["parent/37",[23,1.555]],["name/38",[29,34.447]],["parent/38",[]],["name/39",[30,18.352]],["parent/39",[]],["name/40",[31,34.447]],["parent/40",[30,1.669]],["name/41",[32,34.447]],["parent/41",[30,1.669]],["name/42",[33,34.447]],["parent/42",[30,1.669]],["name/43",[34,34.447]],["parent/43",[30,1.669]],["name/44",[35,34.447]],["parent/44",[30,1.669]],["name/45",[36,34.447]],["parent/45",[30,1.669]]],"invertedIndex":[["__type",{"_index":2,"name":{"2":{},"4":{},"6":{},"8":{},"10":{}},"parent":{}}],["avmloglevel",{"_index":22,"name":{"29":{},"32":{}},"parent":{}}],["callparams",{"_index":30,"name":{"39":{}},"parent":{"40":{},"41":{},"42":{},"43":{},"44":{},"45":{}}}],["checkconnectiontimeoutms",{"_index":25,"name":{"34":{}},"parent":{}}],["connectto",{"_index":24,"name":{"31":{}},"parent":{}}],["constructor",{"_index":16,"name":{"19":{},"24":{}},"parent":{}}],["defaultttlms",{"_index":28,"name":{"37":{}},"parent":{}}],["dialtimeoutms",{"_index":27,"name":{"36":{}},"parent":{}}],["fluence",{"_index":1,"name":{"1":{}},"parent":{"2":{}}}],["fluence.__type",{"_index":4,"name":{},"parent":{"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{}}}],["fluencepeer",{"_index":19,"name":{"22":{}},"parent":{"23":{},"24":{},"25":{},"26":{},"27":{},"28":{}}}],["fromed25519sk",{"_index":14,"name":{"17":{}},"parent":{}}],["getpeer",{"_index":7,"name":{"9":{}},"parent":{}}],["getstatus",{"_index":6,"name":{"7":{},"25":{}},"parent":{}}],["initpeerid",{"_index":32,"name":{"41":{}},"parent":{}}],["internals",{"_index":21,"name":{"28":{}},"parent":{}}],["isconnected",{"_index":10,"name":{"13":{}},"parent":{}}],["isinitialized",{"_index":9,"name":{"12":{}},"parent":{}}],["isinstance",{"_index":20,"name":{"23":{}},"parent":{}}],["keypair",{"_index":13,"name":{"16":{},"33":{}},"parent":{"17":{},"18":{},"19":{},"20":{},"21":{}}}],["libp2ppeerid",{"_index":17,"name":{"20":{}},"parent":{}}],["particleid",{"_index":31,"name":{"40":{}},"parent":{}}],["peerconfig",{"_index":23,"name":{"30":{}},"parent":{"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{}}}],["peerid",{"_index":11,"name":{"14":{}},"parent":{}}],["peeridb58",{"_index":29,"name":{"38":{}},"parent":{}}],["peerstatus",{"_index":8,"name":{"11":{}},"parent":{"12":{},"13":{},"14":{},"15":{}}}],["randomed25519",{"_index":15,"name":{"18":{}},"parent":{}}],["relaypeerid",{"_index":12,"name":{"15":{}},"parent":{}}],["setloglevel",{"_index":0,"name":{"0":{}},"parent":{}}],["signature",{"_index":35,"name":{"44":{}},"parent":{}}],["skipcheckconnection",{"_index":26,"name":{"35":{}},"parent":{}}],["start",{"_index":3,"name":{"3":{},"26":{}},"parent":{}}],["stop",{"_index":5,"name":{"5":{},"27":{}},"parent":{}}],["tetraplets",{"_index":36,"name":{"45":{}},"parent":{}}],["timestamp",{"_index":33,"name":{"42":{}},"parent":{}}],["toed25519privatekey",{"_index":18,"name":{"21":{}},"parent":{}}],["ttl",{"_index":34,"name":{"43":{}},"parent":{}}]],"pipeline":[]}} \ No newline at end of file +window.searchData = {"kinds":{"32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":64,"name":"setLogLevel","url":"modules.html#setLogLevel","classes":"tsd-kind-function"},{"id":1,"kind":32,"name":"Fluence","url":"modules.html#Fluence","classes":"tsd-kind-variable"},{"id":2,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"Fluence"},{"id":3,"kind":1024,"name":"start","url":"modules.html#Fluence.__type.start","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":4,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":5,"kind":1024,"name":"stop","url":"modules.html#Fluence.__type.stop","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":6,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":7,"kind":1024,"name":"getStatus","url":"modules.html#Fluence.__type.getStatus","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":8,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":9,"kind":1024,"name":"getPeer","url":"modules.html#Fluence.__type.getPeer","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":10,"kind":65536,"name":"__type","url":"modules.html#Fluence.__type.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-literal","parent":"Fluence.__type"},{"id":11,"kind":256,"name":"PeerStatus","url":"interfaces/PeerStatus.html","classes":"tsd-kind-interface"},{"id":12,"kind":1024,"name":"isInitialized","url":"interfaces/PeerStatus.html#isInitialized","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":13,"kind":1024,"name":"isConnected","url":"interfaces/PeerStatus.html#isConnected","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":14,"kind":1024,"name":"peerId","url":"interfaces/PeerStatus.html#peerId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":15,"kind":1024,"name":"relayPeerId","url":"interfaces/PeerStatus.html#relayPeerId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerStatus"},{"id":16,"kind":128,"name":"KeyPair","url":"classes/KeyPair.html","classes":"tsd-kind-class"},{"id":17,"kind":2048,"name":"fromEd25519SK","url":"classes/KeyPair.html#fromEd25519SK","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"KeyPair"},{"id":18,"kind":2048,"name":"randomEd25519","url":"classes/KeyPair.html#randomEd25519","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"KeyPair"},{"id":19,"kind":512,"name":"constructor","url":"classes/KeyPair.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"KeyPair"},{"id":20,"kind":1024,"name":"Libp2pPeerId","url":"classes/KeyPair.html#Libp2pPeerId","classes":"tsd-kind-property tsd-parent-kind-class","parent":"KeyPair"},{"id":21,"kind":2048,"name":"toEd25519PrivateKey","url":"classes/KeyPair.html#toEd25519PrivateKey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"KeyPair"},{"id":22,"kind":2048,"name":"signBytes","url":"classes/KeyPair.html#signBytes","classes":"tsd-kind-method tsd-parent-kind-class","parent":"KeyPair"},{"id":23,"kind":2048,"name":"verify","url":"classes/KeyPair.html#verify","classes":"tsd-kind-method tsd-parent-kind-class","parent":"KeyPair"},{"id":24,"kind":128,"name":"FluencePeer","url":"classes/FluencePeer.html","classes":"tsd-kind-class"},{"id":25,"kind":2048,"name":"isInstance","url":"classes/FluencePeer.html#isInstance","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"FluencePeer"},{"id":26,"kind":512,"name":"constructor","url":"classes/FluencePeer.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"FluencePeer"},{"id":27,"kind":2048,"name":"getStatus","url":"classes/FluencePeer.html#getStatus","classes":"tsd-kind-method tsd-parent-kind-class","parent":"FluencePeer"},{"id":28,"kind":2048,"name":"start","url":"classes/FluencePeer.html#start","classes":"tsd-kind-method tsd-parent-kind-class","parent":"FluencePeer"},{"id":29,"kind":2048,"name":"stop","url":"classes/FluencePeer.html#stop","classes":"tsd-kind-method tsd-parent-kind-class","parent":"FluencePeer"},{"id":30,"kind":262144,"name":"internals","url":"classes/FluencePeer.html#internals","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"FluencePeer"},{"id":31,"kind":4194304,"name":"AvmLoglevel","url":"modules.html#AvmLoglevel","classes":"tsd-kind-type-alias"},{"id":32,"kind":256,"name":"PeerConfig","url":"interfaces/PeerConfig.html","classes":"tsd-kind-interface"},{"id":33,"kind":1024,"name":"connectTo","url":"interfaces/PeerConfig.html#connectTo","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":34,"kind":1024,"name":"avmLogLevel","url":"interfaces/PeerConfig.html#avmLogLevel","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":35,"kind":1024,"name":"KeyPair","url":"interfaces/PeerConfig.html#KeyPair","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":36,"kind":1024,"name":"checkConnectionTimeoutMs","url":"interfaces/PeerConfig.html#checkConnectionTimeoutMs","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":37,"kind":1024,"name":"skipCheckConnection","url":"interfaces/PeerConfig.html#skipCheckConnection","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":38,"kind":1024,"name":"dialTimeoutMs","url":"interfaces/PeerConfig.html#dialTimeoutMs","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":39,"kind":1024,"name":"defaultTtlMs","url":"interfaces/PeerConfig.html#defaultTtlMs","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":40,"kind":1024,"name":"avmRunner","url":"interfaces/PeerConfig.html#avmRunner","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PeerConfig"},{"id":41,"kind":4194304,"name":"PeerIdB58","url":"modules.html#PeerIdB58","classes":"tsd-kind-type-alias"},{"id":42,"kind":256,"name":"CallParams","url":"interfaces/CallParams.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":43,"kind":1024,"name":"particleId","url":"interfaces/CallParams.html#particleId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":44,"kind":1024,"name":"initPeerId","url":"interfaces/CallParams.html#initPeerId","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":45,"kind":1024,"name":"timestamp","url":"interfaces/CallParams.html#timestamp","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":46,"kind":1024,"name":"ttl","url":"interfaces/CallParams.html#ttl","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":47,"kind":1024,"name":"signature","url":"interfaces/CallParams.html#signature","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"},{"id":48,"kind":1024,"name":"tetraplets","url":"interfaces/CallParams.html#tetraplets","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CallParams"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,35.066]],["parent/0",[]],["name/1",[1,29.957]],["parent/1",[]],["name/2",[2,22.073]],["parent/2",[1,2.743]],["name/3",[3,29.957]],["parent/3",[4,1.623]],["name/4",[2,22.073]],["parent/4",[4,1.623]],["name/5",[5,29.957]],["parent/5",[4,1.623]],["name/6",[2,22.073]],["parent/6",[4,1.623]],["name/7",[6,29.957]],["parent/7",[4,1.623]],["name/8",[2,22.073]],["parent/8",[4,1.623]],["name/9",[7,35.066]],["parent/9",[4,1.623]],["name/10",[2,22.073]],["parent/10",[4,1.623]],["name/11",[8,22.073]],["parent/11",[]],["name/12",[9,35.066]],["parent/12",[8,2.021]],["name/13",[10,35.066]],["parent/13",[8,2.021]],["name/14",[11,35.066]],["parent/14",[8,2.021]],["name/15",[12,35.066]],["parent/15",[8,2.021]],["name/16",[13,16.607]],["parent/16",[]],["name/17",[14,35.066]],["parent/17",[13,1.521]],["name/18",[15,35.066]],["parent/18",[13,1.521]],["name/19",[16,29.957]],["parent/19",[13,1.521]],["name/20",[17,35.066]],["parent/20",[13,1.521]],["name/21",[18,35.066]],["parent/21",[13,1.521]],["name/22",[19,35.066]],["parent/22",[13,1.521]],["name/23",[20,35.066]],["parent/23",[13,1.521]],["name/24",[21,18.971]],["parent/24",[]],["name/25",[22,35.066]],["parent/25",[21,1.737]],["name/26",[16,29.957]],["parent/26",[21,1.737]],["name/27",[6,29.957]],["parent/27",[21,1.737]],["name/28",[3,29.957]],["parent/28",[21,1.737]],["name/29",[5,29.957]],["parent/29",[21,1.737]],["name/30",[23,35.066]],["parent/30",[21,1.737]],["name/31",[24,29.957]],["parent/31",[]],["name/32",[25,16.607]],["parent/32",[]],["name/33",[26,35.066]],["parent/33",[25,1.521]],["name/34",[24,29.957]],["parent/34",[25,1.521]],["name/35",[13,16.607]],["parent/35",[25,1.521]],["name/36",[27,35.066]],["parent/36",[25,1.521]],["name/37",[28,35.066]],["parent/37",[25,1.521]],["name/38",[29,35.066]],["parent/38",[25,1.521]],["name/39",[30,35.066]],["parent/39",[25,1.521]],["name/40",[31,35.066]],["parent/40",[25,1.521]],["name/41",[32,35.066]],["parent/41",[]],["name/42",[33,18.971]],["parent/42",[]],["name/43",[34,35.066]],["parent/43",[33,1.737]],["name/44",[35,35.066]],["parent/44",[33,1.737]],["name/45",[36,35.066]],["parent/45",[33,1.737]],["name/46",[37,35.066]],["parent/46",[33,1.737]],["name/47",[38,35.066]],["parent/47",[33,1.737]],["name/48",[39,35.066]],["parent/48",[33,1.737]]],"invertedIndex":[["__type",{"_index":2,"name":{"2":{},"4":{},"6":{},"8":{},"10":{}},"parent":{}}],["avmloglevel",{"_index":24,"name":{"31":{},"34":{}},"parent":{}}],["avmrunner",{"_index":31,"name":{"40":{}},"parent":{}}],["callparams",{"_index":33,"name":{"42":{}},"parent":{"43":{},"44":{},"45":{},"46":{},"47":{},"48":{}}}],["checkconnectiontimeoutms",{"_index":27,"name":{"36":{}},"parent":{}}],["connectto",{"_index":26,"name":{"33":{}},"parent":{}}],["constructor",{"_index":16,"name":{"19":{},"26":{}},"parent":{}}],["defaultttlms",{"_index":30,"name":{"39":{}},"parent":{}}],["dialtimeoutms",{"_index":29,"name":{"38":{}},"parent":{}}],["fluence",{"_index":1,"name":{"1":{}},"parent":{"2":{}}}],["fluence.__type",{"_index":4,"name":{},"parent":{"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{}}}],["fluencepeer",{"_index":21,"name":{"24":{}},"parent":{"25":{},"26":{},"27":{},"28":{},"29":{},"30":{}}}],["fromed25519sk",{"_index":14,"name":{"17":{}},"parent":{}}],["getpeer",{"_index":7,"name":{"9":{}},"parent":{}}],["getstatus",{"_index":6,"name":{"7":{},"27":{}},"parent":{}}],["initpeerid",{"_index":35,"name":{"44":{}},"parent":{}}],["internals",{"_index":23,"name":{"30":{}},"parent":{}}],["isconnected",{"_index":10,"name":{"13":{}},"parent":{}}],["isinitialized",{"_index":9,"name":{"12":{}},"parent":{}}],["isinstance",{"_index":22,"name":{"25":{}},"parent":{}}],["keypair",{"_index":13,"name":{"16":{},"35":{}},"parent":{"17":{},"18":{},"19":{},"20":{},"21":{},"22":{},"23":{}}}],["libp2ppeerid",{"_index":17,"name":{"20":{}},"parent":{}}],["particleid",{"_index":34,"name":{"43":{}},"parent":{}}],["peerconfig",{"_index":25,"name":{"32":{}},"parent":{"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"40":{}}}],["peerid",{"_index":11,"name":{"14":{}},"parent":{}}],["peeridb58",{"_index":32,"name":{"41":{}},"parent":{}}],["peerstatus",{"_index":8,"name":{"11":{}},"parent":{"12":{},"13":{},"14":{},"15":{}}}],["randomed25519",{"_index":15,"name":{"18":{}},"parent":{}}],["relaypeerid",{"_index":12,"name":{"15":{}},"parent":{}}],["setloglevel",{"_index":0,"name":{"0":{}},"parent":{}}],["signature",{"_index":38,"name":{"47":{}},"parent":{}}],["signbytes",{"_index":19,"name":{"22":{}},"parent":{}}],["skipcheckconnection",{"_index":28,"name":{"37":{}},"parent":{}}],["start",{"_index":3,"name":{"3":{},"28":{}},"parent":{}}],["stop",{"_index":5,"name":{"5":{},"29":{}},"parent":{}}],["tetraplets",{"_index":39,"name":{"48":{}},"parent":{}}],["timestamp",{"_index":36,"name":{"45":{}},"parent":{}}],["toed25519privatekey",{"_index":18,"name":{"21":{}},"parent":{}}],["ttl",{"_index":37,"name":{"46":{}},"parent":{}}],["verify",{"_index":20,"name":{"23":{}},"parent":{}}]],"pipeline":[]}} \ No newline at end of file diff --git a/docs/classes/FluencePeer.html b/docs/classes/FluencePeer.html index b38c4462..86ca9cb0 100644 --- a/docs/classes/FluencePeer.html +++ b/docs/classes/FluencePeer.html @@ -121,7 +121,7 @@
Methods
+- sign
Bytes
- to
Ed25519PrivateKey
+ - verify
- from
Ed25519SK
- random
Ed25519
@@ -112,7 +114,7 @@Parameters
@@ -134,7 +136,7 @@Methods
+signBytes
++- sign
Bytes(data: Uint8Array): Promise<Uint8Array>
+
++-
+
+
+
+Parameters
++-
+
+
+data: Uint8Array
+Returns Promise<Uint8Array>
+toEd25519PrivateKey
@@ -156,7 +181,7 @@Returns Uint8Array
@@ -164,6 +189,32 @@verify
++- verify(data: Uint8Array, signature: Uint8Array): Promise<boolean>
+
++-
+
+
+
+Parameters
++-
+
+ -
+
+
+data: Uint8Array
+signature: Uint8Array
+Returns Promise<boolean>
+Static fromEd25519SK
@@ -174,7 +225,7 @@Optional avmRunner
+Plugable AVM runner implementation. If not specified AvmBackgroundRunner will be used
+Optional checkConnectionTimeoutMs
Parameters
diff --git a/jest-patched-jsdom.js b/jest-patched-jsdom.js deleted file mode 100644 index a49175ac..00000000 --- a/jest-patched-jsdom.js +++ /dev/null @@ -1,14 +0,0 @@ -const Environment = require('jest-environment-jsdom'); - -module.exports = class CustomTestEnvironment extends Environment { - async setup() { - await super.setup(); - if (typeof this.global.TextEncoder === 'undefined') { - const { TextEncoder, TextDecoder } = require('util'); - this.global.TextEncoder = TextEncoder; - this.global.TextDecoder = TextDecoder; - this.global.Uint8Array = Uint8Array; - this.global.ArrayBuffer = ArrayBuffer; - } - } -}; diff --git a/jest.config.js b/jest.config.js index 2b6b7ead..6d6062b3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,4 @@ module.exports = { preset: 'ts-jest', - testEnvironment: './jest-patched-jsdom.js', + testEnvironment: 'node', }; diff --git a/package-lock.json b/package-lock.json index d3edc826..dd739d62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,9 @@ "license": "Apache-2.0", "dependencies": { "@chainsafe/libp2p-noise": "4.0.0", - "@fluencelabs/avm": "^0.19.3", + "@fluencelabs/avm": "0.19.6", + "@fluencelabs/avm-runner-background": "0.1.1", + "@fluencelabs/avm-runner-interface": "^0.2.0", "async": "3.2.0", "bs58": "4.0.1", "cids": "0.8.1", @@ -27,6 +29,9 @@ "ts-pattern": "^3.3.3", "uuid": "8.3.0" }, + "bin": { + "copy-avm-public": "dist/tools/copyAvmPublic" + }, "devDependencies": { "@types/jest": "^26.0.22", "jest": "^26.6.3", @@ -646,13 +651,31 @@ } }, "node_modules/@fluencelabs/avm": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.3.tgz", - "integrity": "sha512-KvrQrh41dpKzYzgbozmTykwD/E3me3Boiz7rC/zjs5xma738YibjymCV30ZXMfe3iNT5JlXsj3LJML6HlkjNfA==", - "dependencies": { - "base64-js": "1.5.1" + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", + "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==", + "bin": { + "copy-avm": "dist/copyAvm.js" } }, + "node_modules/@fluencelabs/avm-runner-background": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-background/-/avm-runner-background-0.1.1.tgz", + "integrity": "sha512-XUnw3eUakBDngLZMIhTUXIT3Oz6N+6aclo7p2YIvjRHqhUUnL5/VEZcbuxLdkdzMdSdbQE7C/btKNVTO2kWJBw==", + "dependencies": { + "@fluencelabs/avm-runner-interface": "^0.2.0", + "browser-or-node": "^2.0.0", + "threads": "^1.7.0" + }, + "bin": { + "copy-avm-runner": "dist/copyRunnerScript.js" + } + }, + "node_modules/@fluencelabs/avm-runner-interface": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-interface/-/avm-runner-interface-0.2.0.tgz", + "integrity": "sha512-Y41pL+UwZZVdormxju8cJQsNRp6tdER0VqJ9Kg9gH2wd1KJAaYTJkyVbn8NB7fEFRUbqfbb1BXHi9wWBYOgGYQ==" + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1829,6 +1852,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "node_modules/browser-or-node": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.0.0.tgz", + "integrity": "sha512-3Lrks/Okgof+/cRguUNG+qRXSeq79SO3hY4QrXJayJofwJwHiGC0qi99uDjsfTwULUFSr1OGVsBkdIkygKjTUA==" + }, "node_modules/browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", @@ -1940,7 +1968,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -2583,6 +2610,15 @@ "source-map": "~0.6.1" } }, + "node_modules/esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -3687,6 +3723,17 @@ "node": ">=0.12.0" } }, + "node_modules/is-observable": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-2.1.0.tgz", + "integrity": "sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -5784,6 +5831,11 @@ "node": ">=0.10.0" } }, + "node_modules/observable-fns": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.6.1.tgz", + "integrity": "sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg==" + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -7461,6 +7513,23 @@ "node": ">=8" } }, + "node_modules/threads": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/threads/-/threads-1.7.0.tgz", + "integrity": "sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==", + "dependencies": { + "callsites": "^3.1.0", + "debug": "^4.2.0", + "is-observable": "^2.1.0", + "observable-fns": "^0.6.1" + }, + "funding": { + "url": "https://github.com/andywer/threads.js?sponsor=1" + }, + "optionalDependencies": { + "tiny-worker": ">= 2" + } + }, "node_modules/throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -7481,6 +7550,15 @@ "resolved": "https://registry.npmjs.org/retimer/-/retimer-2.0.0.tgz", "integrity": "sha512-KLXY85WkEq2V2bKex/LOO1ViXVn2KGYe4PYysAdYdjmraYIUsVkXu8O4am+8+5UbaaGl1qho4aqAAPHNQ4GSbg==" }, + "node_modules/tiny-worker": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tiny-worker/-/tiny-worker-2.3.0.tgz", + "integrity": "sha512-pJ70wq5EAqTAEl9IkGzA+fN0836rycEuz2Cn6yeZ6FRzlVS5IDOkFHpIoEsksPRQV34GDqXm65+OlnZqUSyK2g==", + "optional": true, + "dependencies": { + "esm": "^3.2.25" + } + }, "node_modules/tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -8693,13 +8771,25 @@ } }, "@fluencelabs/avm": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.3.tgz", - "integrity": "sha512-KvrQrh41dpKzYzgbozmTykwD/E3me3Boiz7rC/zjs5xma738YibjymCV30ZXMfe3iNT5JlXsj3LJML6HlkjNfA==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", + "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==" + }, + "@fluencelabs/avm-runner-background": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-background/-/avm-runner-background-0.1.1.tgz", + "integrity": "sha512-XUnw3eUakBDngLZMIhTUXIT3Oz6N+6aclo7p2YIvjRHqhUUnL5/VEZcbuxLdkdzMdSdbQE7C/btKNVTO2kWJBw==", "requires": { - "base64-js": "1.5.1" + "@fluencelabs/avm-runner-interface": "^0.2.0", + "browser-or-node": "^2.0.0", + "threads": "^1.7.0" } }, + "@fluencelabs/avm-runner-interface": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-interface/-/avm-runner-interface-0.2.0.tgz", + "integrity": "sha512-Y41pL+UwZZVdormxju8cJQsNRp6tdER0VqJ9Kg9gH2wd1KJAaYTJkyVbn8NB7fEFRUbqfbb1BXHi9wWBYOgGYQ==" + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -9702,6 +9792,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "browser-or-node": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.0.0.tgz", + "integrity": "sha512-3Lrks/Okgof+/cRguUNG+qRXSeq79SO3hY4QrXJayJofwJwHiGC0qi99uDjsfTwULUFSr1OGVsBkdIkygKjTUA==" + }, "browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", @@ -9782,8 +9877,7 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "camelcase": { "version": "5.3.1", @@ -10289,6 +10383,12 @@ "source-map": "~0.6.1" } }, + "esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "optional": true + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -11142,6 +11242,11 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-observable": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-2.1.0.tgz", + "integrity": "sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw==" + }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -12855,6 +12960,11 @@ "isobject": "^3.0.1" } }, + "observable-fns": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/observable-fns/-/observable-fns-0.6.1.tgz", + "integrity": "sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -14176,6 +14286,18 @@ "minimatch": "^3.0.4" } }, + "threads": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/threads/-/threads-1.7.0.tgz", + "integrity": "sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==", + "requires": { + "callsites": "^3.1.0", + "debug": "^4.2.0", + "is-observable": "^2.1.0", + "observable-fns": "^0.6.1", + "tiny-worker": ">= 2" + } + }, "throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -14198,6 +14320,15 @@ } } }, + "tiny-worker": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tiny-worker/-/tiny-worker-2.3.0.tgz", + "integrity": "sha512-pJ70wq5EAqTAEl9IkGzA+fN0836rycEuz2Cn6yeZ6FRzlVS5IDOkFHpIoEsksPRQV34GDqXm65+OlnZqUSyK2g==", + "optional": true, + "requires": { + "esm": "^3.2.25" + } + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", diff --git a/package.json b/package.json index 4588deb0..6dbcb17d 100644 --- a/package.json +++ b/package.json @@ -9,19 +9,20 @@ "test:all": "jest", "test:unit": "jest --testPathPattern=src/__test__/unit", "test:integration": "jest --testPathPattern=src/__test__/integration", - "test:node": "jest --env=node --watch", - "test:node:all": "jest --env=node", - "test:node:unit": "jest --env=node --testPathPattern=src/__test__/unit", - "test:node:integration": "jest --env=node --testPathPattern=src/__test__/integration", "build": "tsc", "build:docs": "typedoc" }, "repository": "https://github.com/fluencelabs/fluence-js", "author": "Fluence Labs", "license": "Apache-2.0", + "bin": { + "copy-avm-public": "dist/tools/copyAvmPublic.js" + }, "dependencies": { "@chainsafe/libp2p-noise": "4.0.0", - "@fluencelabs/avm": "^0.19.3", + "@fluencelabs/avm-runner-background": "0.1.1", + "@fluencelabs/avm": "0.19.6", + "@fluencelabs/avm-runner-interface": "^0.2.0", "async": "3.2.0", "bs58": "4.0.1", "cids": "0.8.1", diff --git a/src/__test__/integration/avm.spec.ts b/src/__test__/integration/avm.spec.ts index 46f6dc12..55d504be 100644 --- a/src/__test__/integration/avm.spec.ts +++ b/src/__test__/integration/avm.spec.ts @@ -3,10 +3,21 @@ import { Particle } from '../../internal/Particle'; import { handleTimeout } from '../../internal/utils'; import { registerHandlersHelper } from '../util'; +let peer: FluencePeer; + describe('Avm spec', () => { + afterEach(async () => { + if (peer) { + await peer.stop(); + } + }); + + beforeEach(() => { + peer = new FluencePeer(); + }); + it('Simple call', async () => { // arrange - const peer = new FluencePeer(); await peer.start(); // act @@ -36,7 +47,6 @@ describe('Avm spec', () => { it('Par call', async () => { // arrange - const peer = new FluencePeer(); await peer.start(); // act @@ -75,7 +85,6 @@ describe('Avm spec', () => { it('Timeout in par call: race', async () => { // arrange - const peer = new FluencePeer(); await peer.start(); // act @@ -113,7 +122,6 @@ describe('Avm spec', () => { it('Timeout in par call: wait', async () => { // arrange - const peer = new FluencePeer(); await peer.start(); // act diff --git a/src/__test__/integration/compiler/compiler.spec.ts b/src/__test__/integration/compiler/compiler.spec.ts index 771867ca..dcc3f98c 100644 --- a/src/__test__/integration/compiler/compiler.spec.ts +++ b/src/__test__/integration/compiler/compiler.spec.ts @@ -205,5 +205,7 @@ describe('Compiler support infrastructure tests', () => { // assert await expect(action).rejects.toMatch(/incorrect air script/); + + await anotherPeer.stop(); }); }); diff --git a/src/__test__/integration/peer.spec.ts b/src/__test__/integration/peer.spec.ts index fe5e100f..77f292e8 100644 --- a/src/__test__/integration/peer.spec.ts +++ b/src/__test__/integration/peer.spec.ts @@ -5,15 +5,19 @@ import { checkConnection, doNothing, handleTimeout } from '../../internal/utils' import { Particle } from '../../internal/Particle'; import { registerHandlersHelper } from '../util'; -const anotherPeer = new FluencePeer(); +let peer; describe('Typescript usage suite', () => { afterEach(async () => { - if (anotherPeer) { - await anotherPeer.stop(); + if (peer) { + await peer.stop(); } }); + beforeEach(() => { + peer = new FluencePeer(); + }); + it('should perform test for FluencePeer class correctly', () => { // arrange const peer: any = new FluencePeer(); @@ -37,10 +41,10 @@ describe('Typescript usage suite', () => { describe('Should expose correct peer status', () => { it('Should expose correct status for uninitialized peer', () => { // arrange - const peer = new FluencePeer(); + const nonStartedPeer = new FluencePeer(); // act - const status = peer.getStatus(); + const status = nonStartedPeer.getStatus(); // assert expect(status.isConnected).toBe(false); @@ -51,7 +55,6 @@ describe('Typescript usage suite', () => { it('Should expose correct status for initialized but not connected peer', async () => { // arrange - const peer = new FluencePeer(); await peer.start(); // act @@ -68,7 +71,6 @@ describe('Typescript usage suite', () => { it('Should expose correct status for connected peer', async () => { // arrange - const peer = new FluencePeer(); await peer.start({ connectTo: nodes[0] }); // act @@ -86,7 +88,7 @@ describe('Typescript usage suite', () => { it('should make a call through network', async () => { // arrange - await anotherPeer.start({ connectTo: nodes[0] }); + await peer.start({ connectTo: nodes[0] }); // act const promise = new Promise