tests/index.jsView |
---|
24 | 24 | node.on('ready', () => { |
25 | 25 | tape('basic', async t => { |
26 | 26 | t.plan(3) |
27 | 27 | let message |
28 | | - const expectedState = { |
29 | | - '/': 'zdpuAqbcQhgu2T2MBgHbYu1MtHXyZzNsCaQjTPTR6NN9s5hbk' |
30 | | - } |
| 28 | + const expectedState = { '/': 'zdpuAyCWhqq3v5DWhJCJPBgFkFbMxmD4do98TusonJmw7TyEG' } |
31 | 29 | |
32 | 30 | class testVMContainer extends BaseContainer { |
33 | 31 | onMessage (m) { |
34 | 32 | t.true(m === message, 'should recive a message') |
79 | 77 | |
80 | 78 | tape('basic - do not store containers with no ports bound', async t => { |
81 | 79 | t.plan(1) |
82 | 80 | const expectedState = { |
83 | | - '/': 'zdpuAop4nt8pqzg7duciSYbZmWfDaBiz87RCtGCbb35ewUrbW' |
| 81 | + '/': 'zdpuB1nzBk1RfSkZAx783Y54JiwW47WDHBxrBiUWSx1d9XraH' |
84 | 82 | } |
85 | 83 | |
86 | 84 | class testVMContainer extends BaseContainer { |
87 | 85 | onCreation () {} |
129 | 127 | tape('one child contract', async t => { |
130 | 128 | t.plan(4) |
131 | 129 | let message |
132 | 130 | const expectedState = { |
133 | | - '/': 'zdpuB2Huo3ro3Fv9mpMhnUcL3jjd37T6MJ6jEd8GvA2cpvaYR' |
| 131 | + '/': 'zdpuAnJrp8fEQL8NAJ9Jci3AJw6tzUdfhFvMMgtQ6BheL5JSb' |
134 | 132 | } |
135 | 133 | |
136 | 134 | let hasResolved = false |
137 | 135 | |
640 | 638 | }) |
641 | 639 | |
642 | 640 | tape('port deletion', async t => { |
643 | 641 | const expectedSr = { |
644 | | - '/': 'zdpuAxKfu5nMTfpz6uHPqXdHZFQDZdRUer8zcQ6nvC4pTQsop' |
| 642 | + '/': 'zdpuAzmHuZeX37ohQvWheN4mS3B63A3LknRgmsG4dQFcer5Xf' |
645 | 643 | } |
646 | 644 | |
647 | 645 | const hypervisor = new Hypervisor(node.dag) |
648 | 646 | const creationPort = hypervisor.creationService.getPort() |
710 | 708 | }) |
711 | 709 | |
712 | 710 | tape('clear unbounded ports', async t => { |
713 | 711 | const expectedSr = { |
714 | | - '/': 'zdpuAxKfu5nMTfpz6uHPqXdHZFQDZdRUer8zcQ6nvC4pTQsop' |
| 712 | + '/': 'zdpuAzmHuZeX37ohQvWheN4mS3B63A3LknRgmsG4dQFcer5Xf' |
715 | 713 | } |
716 | 714 | |
717 | 715 | const hypervisor = new Hypervisor(node.dag) |
718 | 716 | const creationPort = hypervisor.creationService.getPort() |
757 | 755 | }) |
758 | 756 | |
759 | 757 | tape('should remove subgraphs', async t => { |
760 | 758 | const expectedSr = { |
761 | | - '/': 'zdpuAxKfu5nMTfpz6uHPqXdHZFQDZdRUer8zcQ6nvC4pTQsop' |
| 759 | + '/': 'zdpuAzmHuZeX37ohQvWheN4mS3B63A3LknRgmsG4dQFcer5Xf' |
762 | 760 | } |
763 | 761 | |
764 | 762 | const hypervisor = new Hypervisor(node.dag) |
765 | 763 | const creationPort = hypervisor.creationService.getPort() |
828 | 826 | }) |
829 | 827 | |
830 | 828 | tape('should not remove connected nodes', async t => { |
831 | 829 | const expectedSr = { |
832 | | - '/': 'zdpuAr4A3i1t6B7BkLT9C7DoxwvFnNg74gEzyqhpFj7nqVBy6' |
| 830 | + '/': 'zdpuAnqT3rGwbquWcGP82C9pZGM59uDCdXYBDFaUcmXr3M6fs' |
833 | 831 | } |
834 | 832 | |
835 | 833 | const hypervisor = new Hypervisor(node.dag) |
836 | 834 | const creationPort = hypervisor.creationService.getPort() |
914 | 912 | }) |
915 | 913 | |
916 | 914 | tape('should remove multiple subgraphs', async t => { |
917 | 915 | const expectedSr = { |
918 | | - '/': 'zdpuAzYGmZeZsi5Zer7LXCTm1AsmqpUMJAXZnEeFW2UVDZj2P' |
| 916 | + '/': 'zdpuAwVszhPYNCas6qfcoLZcyaV6ee1UfbkjFiFyJULeoJR5x' |
919 | 917 | } |
920 | 918 | |
921 | 919 | const hypervisor = new Hypervisor(node.dag) |
922 | 920 | const creationPort = hypervisor.creationService.getPort() |
1143 | 1141 | |
1144 | 1142 | const stateRoot = await hypervisor.createStateRoot() |
1145 | 1143 | |
1146 | 1144 | const expectedSR = { |
1147 | | - '/': 'zdpuAonuhk7ZhdghJh4saaUCskY5mXZ6M9BcV9iAhCanAQx9i' |
| 1145 | + '/': 'zdpuAv2aHeZJ7Y3XB4NrrGPSKMfTLcB3Dj8VL7FUvYDVgj3jT' |
1148 | 1146 | } |
1149 | 1147 | t.deepEquals(stateRoot, expectedSR) |
1150 | 1148 | }) |
1151 | 1149 | |