Skip to content

fix: network generate with networkInfo #201

fix: network generate with networkInfo

fix: network generate with networkInfo #201

GitHub Actions / mocha-report succeeded Feb 27, 2024 in 0s

122 passed, 0 failed and 26 skipped

Tests passed successfully

✅ test-results.json

148 tests were completed in 623s with 122 passed, 0 failed and 26 skipped.

Test suite Passed Failed Skipped Time
test/fabric/service/backup.test.ts 14✅ 4s
test/fabric/service/caService.test.ts 9✅ 14s
test/fabric/service/chaincode.test.ts 18✅ 13s
test/fabric/service/channel.test.ts 34✅ 19s
test/fabric/service/config.test.ts 5✅ 2ms
test/fabric/service/network.test.ts 7✅ 2⚪ 3s
test/fabric/service/orderer.test.ts 10✅ 11s
test/fabric/service/peer.test.ts 11✅ 1⚪ 7s
test/hello/service/hello.test.ts 1✅ 0ms
test/quorum/service/backup.test.ts 9✅ 4s
test/quorum/service/explorer.test.ts 3✅ 63s
test/quorum/service/network.test.ts 23⚪ 0ms
test/wallet/service/create.test.ts 1✅ 25ms

✅ test/fabric/service/backup.test.ts

Fabric.Backup Fabric.Backup.createNetworkFolder
  ✅ should exist network folder in specified path
Fabric.Backup Fabric.Backup.export
  ✅ should create a orderer backup tarball for a single node
  ✅ should create a peer backup tarball for a single node
  ✅ should handle other node names
  ✅ should have error when tarball error
  ✅ should have error when tarball error
Fabric.Backup Fabric.Backup.exportAll
  ✅ should create a backup tarball for all items
  ✅ should have error when tarball error
Fabric.Backup Fabric.Backup.getBackupItems
  ✅ should return a list of backup items
Fabric.Backup Fabric.Backup.getExportItems
  ✅ should return a list of export items
Fabric.Backup Fabric.Backup.import
  ✅ should exist network folder in specified path
  ✅ should have error when tarball error
  ✅ should import a backup tarball
Fabric.Backup Fabric.Backup.import Fabric.Backup.getDockerComposeList
  ✅ should return a list of docker compose

✅ test/fabric/service/caService.test.ts

Fabric.CA Fabric.CA.enrollICA
  ✅ enroll client
  ✅ register ica
Fabric.CA Fabric.CA.enrollOrg
  ✅ enroll && register orderer
  ✅ enroll && register peer
  ✅ enroll wrong format
  ✅ enroll wrong role
  ✅ enroll wrong tls role 
Fabric.CA Fabric.CA.enrollRCA
  ✅ up & down
Fabric.CA Fabric.CA.reenroll
  ✅ reenroll orderer ca

✅ test/fabric/service/chaincode.test.ts

Chaincode service: approve
  ✅ should use approveSteps
Chaincode service: approveSteps approveOnInstance
  ✅ should approve on instance
Chaincode service: approveSteps discover
  ✅ should discover orderer for approve
Chaincode service: commit
  ✅ should use commitSteps
Chaincode service: commitSteps commitOnInstance
  ✅ should commit on instance
Chaincode service: commitSteps discoverChannelConfig
  ✅ should discover orderer for commit
Chaincode service: commitSteps discoverPeers
  ✅ should discover peers for commit
Chaincode service: getChaincodePackageId
  ✅ should get chaincode package id
Chaincode service: getCommittedChaincode
  ✅ should get all committed chaincode
Chaincode service: install
  ✅ should use installSteps
Chaincode service: installSteps installToPeer
  ✅ should install chaincode to Peer
Chaincode service: installSteps savePackageId
  ✅ should save package id
Chaincode service: invoke
  ✅ should use invokeSteps
Chaincode service: invokeSteps discoverChannelConfig
  ✅ should discover channel config
Chaincode service: invokeSteps discoverEndorsers
  ✅ should discover endorsers
Chaincode service: invokeSteps invokeOnInstance
  ✅ should invoke on instance
Chaincode service: package
  ✅ should package chaincode
Chaincode service: query
  ✅ should query chaincode

✅ test/fabric/service/channel.test.ts

Channel service: approve
  ✅ should approve channel update envelope
Channel service: channelConfigFileName
  ✅ should get filename of channel config
Channel service: computeUpdateConfigTx
  ✅ should create updated configtx
Channel service: create
  ✅ should use createSteps
Channel service: createSteps createChannelArtifact
  ✅ should create channel artifact
Channel service: createSteps createOnInstance
  ✅ should create channel on instance
Channel service: decodeEnvelope applicatieon channel ADD_ORDERER_CONSENTER
  ✅ should decode envelope correctly
Channel service: decodeEnvelope applicatieon channel ADD_ORDERER_TO_CHANNEL
  ✅ should decode envelope correctly
Channel service: decodeEnvelope applicatieon channel ADD_PEER_TO_APPLICATION_CHANNEL
  ✅ should decode envelope correctly
Channel service: decodeEnvelope applicatieon channel UPDATE_ANCHOR_PEER
  ✅ should decode envelope correctly
Channel service: decodeEnvelope system channel ADD_ORDERER_CONSENTER
  ✅ should decode envelope correctly
Channel service: decodeEnvelope system channel ADD_ORDERER_TO_CHANNEL
  ✅ should decode envelope correctly
Channel service: decodeEnvelope system channel ADD_PEER_TO_SYSTEM_CHANNEL
  ✅ should decode envelope correctly
Channel service: fetchChannelBlock should use correct fetchChannelBlockSteps
  ✅ ChannelConfigEnum.CONFIG_BLOCK
  ✅ ChannelConfigEnum.GENESIS_BLOCK
  ✅ ChannelConfigEnum.LATEST_BLOCK
Channel service: fetchChannelBlockSteps fetchChannelConfig
  ✅ should fetch channel config
Channel service: fetchChannelBlockSteps fetchChannelGenesisBlock
  ✅ should fetch channel genesis block
Channel service: fetchChannelBlockSteps fetchChannelNewestBlock
  ✅ should fetch channel newest block
Channel service: fetchChannelConfig
  ✅ should fetch channel config
Channel service: getChannelGroup
  ✅ should use getChannelGroupSteps
Channel service: getChannelGroupSteps decodeFetchedChannelConfig
  ✅ should decode fetched channel config
Channel service: getChannelGroupSteps fetchChannelConfig
  ✅ should fetch channel config
Channel service: getConfigBlock
  ✅ should get channel config
Channel service: join
  ✅ should use joinSteps
Channel service: joinSteps fetchChannelBlock
  ✅ should fetch channel block
Channel service: joinSteps joinOnInstance
  ✅ should join channel on instance
Channel service: listJoinedChannel
  ✅ should list joined channel
Channel service: update
  ✅ should update channel by envelope
Channel service: updateAnchorPeer
  ✅ should use updateAnchorPeerSteps
Channel service: updateAnchorPeerSteps computeUpdateConfigTx
  ✅ should compute config diff
Channel service: updateAnchorPeerSteps fetchChannelConfig
  ✅ should fetch channel config
Channel service: updateAnchorPeerSteps signConfigTx
  ✅ should sign envelop
Channel service: updateAnchorPeerSteps updateChannelConfig
  ✅ should update channel config

✅ test/fabric/service/config.test.ts

Config service:  init
  ✅ .env content and inputs should be the same
  ✅ should exist .env file in specified path
Config service:  ls
  ✅ should return current .env config
Config service:  set
  ✅ .env should be BDK_ORG_DOMAIN=test.set.domain.com
  ✅ should throw init first error message

✅ test/fabric/service/network.test.ts

Network service: copyTLSCa
  ✅ should copy the TLS CA to the specified folder under the blockchain network
Network service: createConnectionProfile
  ✅ should generate peer connection profile file
  ⚪ should throw error when peerOrgs is undefined
Network service: createDockerCompose
  ✅ should generate orderer/peer docker-compose file
Network service: createGenesisBlock
  ✅ should generate genesis.block file and org-json file
Network service: createNetworkFolder
  ✅ should exist network folder in specified path
Network service: cryptogen
  ✅ should generate ca file when function cryptogen done
Network service: delete
  ✅ should delete network folder in specified path
  ⚪ should shutdown docker container

✅ test/fabric/service/orderer.test.ts

Orderer service: addConsenterToChannel
  ✅ should use addConsenterToChannelSteps
Orderer service: addConsenterToChannelSteps computeUpdateConfigTx
  ✅ should compute config diff
Orderer service: addConsenterToChannelSteps fetchChannelConfig
  ✅ should fetch channel config from blockchain
Orderer service: addOrgToChannel
  ✅ should use addOrgToChannelSteps
Orderer service: addOrgToChannelSteps computeUpdateConfigTx
  ✅ should compute config diff
Orderer service: addOrgToChannelSteps fetchChannelConfig
  ✅ should fetch channel config from blockchain
Orderer service: copyTLSCa
  ✅ should copy the orderer TLS CA to the specified folder under the blockchain network
Orderer service: createDockerCompose
  ✅ should generate orderer/peer docker-compose file
Orderer service: cryptogen
  ✅ should generate orderer ca file when function cryptogen done
Orderer service: up & down
  ✅ should start and shutdown docker container

✅ test/fabric/service/peer.test.ts

Peer service: addOrgToChannel
  ✅ should use addOrgToChannelSteps
Peer service: addOrgToChannelSteps computeUpdateConfigTx
  ✅ should compute config diff
Peer service: addOrgToChannelSteps fetchChannelConfig
  ✅ should fetch channel config from blockchain
Peer service: addOrgToSystemChannel
  ✅ should use addOrgToSystemChannelSteps
Peer service: addOrgToSystemChannelSteps computeUpdateConfigTx
  ✅ should compute config diff
Peer service: addOrgToSystemChannelSteps fetchChannelConfig
  ✅ should fetch channel config from blockchain
Peer service: copyTLSCa
  ✅ should copy the peer TLS CA to the specified folder under the blockchain network
Peer service: createConnectionProfileYaml
  ✅ should generate peer connection profile file
  ⚪ should throw error when peerOrgs is undefined
Peer service: createDockerCompose
  ✅ should generate orderer/peer docker-compose file
Peer service: cryptogen
  ✅ should generate peer ca file when function cryptogen done
Peer service: up & down
  ✅ should start and shutdown docker container

✅ test/hello/service/hello.test.ts

hooks
  ✅ Hello unittest

✅ test/quorum/service/backup.test.ts

Quorum.Backup Quorum.Backup.export
  ✅ should create a member backup tarball for a single node
  ✅ should create a validator backup tarball for a single node
  ✅ should have error when tarball error
Quorum.Backup Quorum.Backup.exportAll
  ✅ should create a backup tarball for all items
  ✅ should have error when tarball error
Quorum.Backup Quorum.Backup.getBackupItems
  ✅ should return a list of backup items
Quorum.Backup Quorum.Backup.getExportItems
  ✅ should return a list of export items
Quorum.Backup Quorum.Backup.import
  ✅ should have error when tarball error
  ✅ should import a backup tarball

✅ test/quorum/service/explorer.test.ts

Quorum.Explorer.Service Quorum.Explorer.create
  ✅ should create and start the explorer
Quorum.Explorer.Service Quorum.Explorer.delete
  ✅ should delete the explorer
Quorum.Explorer.Service Quorum.Explorer.getExplorerFiles
  ✅ should return a list of explorer files

✅ test/quorum/service/network.test.ts

Quorum.Network.Service Quorum.Network.add Quorum.Network.addMemberLocal
  ⚪ should add a new member locally
  ⚪ should throw timeout Error
Quorum.Network.Service Quorum.Network.add Quorum.Network.addMemberRemote
  ⚪ should add a remote member to the network
Quorum.Network.Service Quorum.Network.add Quorum.Network.addValidatorLocal
  ⚪ should add a new validator locally
  ⚪ should throw timeout Error
Quorum.Network.Service Quorum.Network.add Quorum.Network.addValidatorRemote
  ⚪ should add a remote validator to the network
Quorum.Network.Service Quorum.Network.add Quorum.Network.joinNode
  ⚪ should join a member node successfully
  ⚪ should join a validator node successfully
  ⚪ should throw timeout Error when join member
  ⚪ should throw timeout Error when join validator
Quorum.Network.Service Quorum.Network.create
  ⚪ should create and start the network
  ⚪ should create only validator containers
  ⚪ should create the bdk files
Quorum.Network.Service Quorum.Network.dockerService Quorum.Network.delete
  ⚪ should start one specific container
Quorum.Network.Service Quorum.Network.dockerService Quorum.Network.down
  ⚪ should stop all containers
Quorum.Network.Service Quorum.Network.dockerService Quorum.Network.upAll
  ⚪ should start all containers
Quorum.Network.Service Quorum.Network.dockerService Quorum.Network.upService
  ⚪ should start one specific containers
  ⚪ should up nothing when input wrong
Quorum.Network.Service Quorum.Network.generate
  ⚪ should generate the expected number of validators and members
Quorum.Network.Service Quorum.Network.getNetworkInfo
  ⚪ should get the correct member node information
  ⚪ should get the correct network information
  ⚪ should get the correct validator node information
  ⚪ should get undefined when wrong input

✅ test/wallet/service/create.test.ts

Wallet.Create Wallet.Create
  ✅ should create a ethereum wallet with address and private key