Skip to content

Commit 5d37017

Browse files
committed
fix tests
1 parent f53564e commit 5d37017

File tree

11 files changed

+78
-66
lines changed

11 files changed

+78
-66
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "pact-tests/pact-tests/marmalade"]
2+
path = pact-tests/pact-tests/marmalade
3+
url = git@github.com:kadena-io/marmalade.git

pact-tests/legacy-serial-tests/coin-v5/coin-v5.repl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@
113113
; w/o capability
114114
(expect-failure
115115
"direct call to credit fails"
116-
"cap not in scope"
116+
"require-capability: not granted: "
117117
(credit 'emily (read-keyset 'emily) 1.0))
118118

119119
(expect-failure
120120
"direct call to debit fails"
121-
"cap not in scope"
121+
"require-capability: not granted: "
122122
(debit 'emily 1.0))
123123

124124
(env-gas 0) (env-gaslog)
@@ -229,22 +229,22 @@
229229

230230
(expect-failure
231231
"fund-tx should fail when GAS is not in scope"
232-
"cap not in scope coin.GAS"
232+
"require-capability: not granted: (coin.GAS)"
233233
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
234234

235235
(test-capability (GAS))
236236
(env-keys [])
237237

238238
(expect-failure
239239
"fund-tx fails without signature"
240-
"Keyset enforce failure"
240+
"Keyset failure"
241241
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
242242

243243
(env-sigs [{"key": "keys1", "caps": [(TRANSFER "emily" "doug" 1.0)]}])
244244

245245
(expect-failure
246246
"fund-tx fails for no gas cap"
247-
"Keyset enforce failure"
247+
"Keyset failure"
248248
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
249249

250250
(expect-failure
@@ -457,7 +457,7 @@
457457

458458
(expect-failure
459459
"coinbase fails when capability is not in scope"
460-
"cap not in scope coin.COINBASE"
460+
"require-capability: not granted: (coin.COINBASE)"
461461
(coinbase 'emily (read-keyset 'emily) 0.0))
462462

463463
(test-capability (COINBASE))
@@ -515,7 +515,7 @@
515515

516516
(expect-failure
517517
"cross-chain transfers fail wrong key"
518-
"Keyset enforce failure"
518+
"Keyset failure"
519519
(transfer-crosschain 'emily 'doug (read-keyset 'doug) "1" 1.0))
520520

521521
(env-sigs [{ 'key: "keys1", 'caps: [(coin.TRANSFER_XCHAIN 'emily 'doug 1.0 "1")]}])
@@ -738,7 +738,7 @@
738738

739739
(expect-failure
740740
"allocation account creation only occurs at genesis"
741-
"cap not in scope coin.GENESIS"
741+
"require-capability: not granted: (coin.GENESIS)"
742742
(create-allocation-account "brandon" (time "1900-10-31T00:00:00Z") "brandon" 200000.0))
743743

744744
(test-capability (GENESIS))
@@ -795,7 +795,7 @@
795795

796796
(expect-failure
797797
"allocation release fails when keys are not in scope"
798-
"Keyset enforce failure"
798+
"Keyset failure"
799799
(release-allocation "brandon"))
800800

801801
(env-keys ["brandon"])
@@ -822,7 +822,7 @@
822822

823823
(expect-failure
824824
"gas-only fails without the presence of GAS"
825-
"cap not in scope coin.GAS"
825+
"require-capability: not granted: (coin.GAS)"
826826
(gas-only))
827827

828828
(expect-failure
@@ -865,7 +865,7 @@
865865

866866
(expect-failure
867867
"Remediations fail without the presence of REMEDIATE"
868-
"cap not in scope"
868+
"require-capability: not granted: "
869869
(remediate "brandon" 1.0))
870870

871871
(test-capability (REMEDIATE))

pact-tests/pact-tests/caps.repl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@
525525
(install-capability (C "alice" 0 true))
526526
(expect-failure
527527
"Autonomous install on unscoped user sig cannot acquire"
528-
"Keyset enforce failure"
528+
"Keyset failure"
529529
(go "alice" 0))
530530

531531
;; scenario: autonomous install, but fails anyway because call is not from module.
@@ -552,7 +552,7 @@
552552
(install-capability (C "bob" 1 true))
553553
(expect-failure
554554
"Attack with different parameters than signature cap fails"
555-
"Keyset enforce failure"
555+
"Keyset failure"
556556
(go "bob" 1))
557557

558558
(commit-tx)
@@ -584,7 +584,7 @@
584584
;; scenario: alice signs caps, only works in non-managed cap
585585
(env-sigs [{ "key": "alice", "caps": [(GUARD "alice-keyset")]}])
586586
(expect "cap-scoped works with cap" true (enforce-cap "alice-keyset"))
587-
(expect-failure "cap-scoped does not work without cap" "Keyset enforce failure"
587+
(expect-failure "cap-scoped does not work without cap" "Keyset failure"
588588
(enforce-wo-cap "alice-keyset"))
589589

590590

pact-tests/pact-tests/coin-v1.repl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@
114114
; w/o capability
115115
(expect-failure
116116
"direct call to credit fails"
117-
"cap not in scope"
117+
"require-capability: not granted: (coin.CREDIT)"
118118
(credit 'emily (read-keyset 'emily) 1.0))
119119

120120
(expect-failure
121121
"direct call to debit fails"
122-
"cap not in scope"
122+
"require-capability: not granted: (coin.DEBIT)"
123123
(debit 'emily 1.0))
124124

125125
(env-gas 0) (env-gaslog)
@@ -230,22 +230,22 @@
230230

231231
(expect-failure
232232
"fund-tx should fail when GAS is not in scope"
233-
"cap not in scope coin.GAS"
233+
"require-capability: not granted: (coin.GAS)"
234234
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
235235

236236
(test-capability (GAS))
237237
(env-keys [])
238238

239239
(expect-failure
240240
"fund-tx fails without signature"
241-
"Keyset enforce failure"
241+
"Keyset failure"
242242
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
243243

244244
(env-sigs [{"key": "keys1", "caps": [(TRANSFER "emily" "doug" 1.0)]}])
245245

246246
(expect-failure
247247
"fund-tx fails for no gas cap"
248-
"Keyset enforce failure"
248+
"Keyset failure"
249249
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
250250

251251
(expect-failure
@@ -458,7 +458,7 @@
458458

459459
(expect-failure
460460
"coinbase fails when capability is not in scope"
461-
"cap not in scope"
461+
"require-capability: not granted: (coin.COINBASE)"
462462
(coinbase 'emily (read-keyset 'emily) 0.0))
463463

464464
(test-capability (COINBASE))
@@ -696,7 +696,7 @@
696696

697697
(expect-failure
698698
"allocation account creation only occurs at genesis"
699-
"cap not in scope coin.GENESIS"
699+
"require-capability: not granted: (coin.GENESIS)"
700700
(create-allocation-account "brandon" (time "1900-10-31T00:00:00Z") "brandon" 200000.0))
701701
(test-capability (GENESIS))
702702

@@ -751,7 +751,7 @@
751751

752752
(expect-failure
753753
"allocation release fails when keys are not in scope"
754-
"Keyset enforce failure"
754+
"Keyset failure"
755755
(release-allocation "brandon"))
756756

757757
(env-keys ["brandon"])
@@ -778,7 +778,7 @@
778778

779779
(expect-failure
780780
"gas-only fails without the presence of GAS"
781-
"cap not in scope coin.GAS"
781+
"require-capability: not granted: (coin.GAS)"
782782
(gas-only))
783783

784784
(expect-failure

pact-tests/pact-tests/coin-v5.repl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@
126126
; w/o capability
127127
(expect-failure
128128
"direct call to credit fails"
129-
"cap not in scope"
129+
"require-capability: not granted: "
130130
(credit 'emily (read-keyset 'emily) 1.0))
131131

132132
(expect-failure
133133
"direct call to debit fails"
134-
"cap not in scope"
134+
"require-capability: not granted: "
135135
(debit 'emily 1.0))
136136

137137
(env-gas 0) (env-gaslog)
@@ -242,22 +242,22 @@
242242

243243
(expect-failure
244244
"fund-tx should fail when GAS is not in scope"
245-
"cap not in scope coin.GAS"
245+
"require-capability: not granted: (coin.GAS)"
246246
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
247247

248248
(test-capability (GAS))
249249
(env-keys [])
250250

251251
(expect-failure
252252
"fund-tx fails without signature"
253-
"Keyset enforce failure"
253+
"Keyset failure"
254254
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
255255

256256
(env-sigs [{"key": "keys1", "caps": [(TRANSFER "emily" "doug" 1.0)]}])
257257

258258
(expect-failure
259259
"fund-tx fails for no gas cap"
260-
"Keyset enforce failure"
260+
"Keyset failure"
261261
(fund-tx 'emily 'doug (read-keyset 'doug) 1.0))
262262

263263
(expect-failure
@@ -470,7 +470,7 @@
470470

471471
(expect-failure
472472
"coinbase fails when capability is not in scope"
473-
"cap not in scope coin.COINBASE"
473+
"require-capability: not granted: (coin.COINBASE)"
474474
(coinbase 'emily (read-keyset 'emily) 0.0))
475475

476476
(test-capability (COINBASE))
@@ -528,7 +528,7 @@
528528

529529
(expect-failure
530530
"cross-chain transfers fail wrong key"
531-
"Keyset enforce failure"
531+
"Keyset failure"
532532
(transfer-crosschain 'emily 'doug (read-keyset 'doug) "1" 1.0))
533533

534534
(env-sigs [{ 'key: "keys1", 'caps: [(coin.TRANSFER_XCHAIN 'emily 'doug 1.0 "1")]}])
@@ -751,7 +751,7 @@
751751

752752
(expect-failure
753753
"allocation account creation only occurs at genesis"
754-
"cap not in scope coin.GENESIS"
754+
"require-capability: not granted: (coin.GENESIS)"
755755
(create-allocation-account "brandon" (time "1900-10-31T00:00:00Z") "brandon" 200000.0))
756756

757757
(test-capability (GENESIS))
@@ -808,7 +808,7 @@
808808

809809
(expect-failure
810810
"allocation release fails when keys are not in scope"
811-
"Keyset enforce failure"
811+
"Keyset failure"
812812
(release-allocation "brandon"))
813813

814814
(env-keys ["brandon"])
@@ -835,7 +835,7 @@
835835

836836
(expect-failure
837837
"gas-only fails without the presence of GAS"
838-
"cap not in scope coin.GAS"
838+
"require-capability: not granted: (coin.GAS)"
839839
(gas-only))
840840

841841
(expect-failure
@@ -878,7 +878,7 @@
878878

879879
(expect-failure
880880
"Remediations fail without the presence of REMEDIATE"
881-
"cap not in scope"
881+
"require-capability: not granted: "
882882
(remediate "brandon" 1.0))
883883

884884
(test-capability (REMEDIATE))

pact-tests/pact-tests/db.repl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,43 +82,43 @@
8282
(begin-tx)
8383
(use dbtest)
8484
(expect-failure
85-
"write protected by admin key" "Keyset enforce failure"
85+
"write protected by admin key" "Keyset failure"
8686
(write persons "foo" ROW_A))
8787
(expect-failure
88-
"update protected by admin key" "Keyset enforce failure"
88+
"update protected by admin key" "Keyset failure"
8989
(update persons "foo" ROW_A))
9090
(expect-failure
91-
"insert protected by admin key" "Keyset enforce failure"
91+
"insert protected by admin key" "Keyset failure"
9292
(insert persons "foo" ROW_A))
9393
(expect-failure
94-
"keys protected by admin key" "Keyset enforce failure"
94+
"keys protected by admin key" "Keyset failure"
9595
(keys persons))
9696
(expect-failure
97-
"txids protected by admin key" "Keyset enforce failure"
97+
"txids protected by admin key" "Keyset failure"
9898
(txids persons 0))
9999
(expect-failure
100-
"txlog protected by admin key" "Keyset enforce failure"
100+
"txlog protected by admin key" "Keyset failure"
101101
(txlog persons 2))
102102
(expect-failure
103-
"keylogs protected by admin key" "Keyset enforce failure"
103+
"keylogs protected by admin key" "Keyset failure"
104104
(keylog persons "" 2))
105105
(expect-failure
106-
"read protected by admin key" "Keyset enforce failure"
106+
"read protected by admin key" "Keyset failure"
107107
(read persons ID_A))
108108
(expect-failure
109-
"with-read protected by admin key" "Keyset enforce failure"
109+
"with-read protected by admin key" "Keyset failure"
110110
(with-read persons ID_A { 'name:= name } name))
111111
(expect-failure
112-
"with-default-read protected by admin key" "Keyset enforce failure"
112+
"with-default-read protected by admin key" "Keyset failure"
113113
(with-default-read persons ID_A { 'name: "stu" } { 'name:= name } name))
114114
(expect-failure
115-
"select protected by admin key" "Keyset enforce failure"
115+
"select protected by admin key" "Keyset failure"
116116
(select persons (constantly true)))
117117
(expect-failure
118-
"keys protected by admin key" "Keyset enforce failure"
118+
"keys protected by admin key" "Keyset failure"
119119
(keys persons))
120120
(expect-failure
121-
"create-table protected by admin key" "Keyset enforce failure"
121+
"create-table protected by admin key" "Keyset failure"
122122
(create-table persons2))
123123

124124
;; just making sure this doesn't blow up, output is still TBD on better Term output in general
@@ -129,13 +129,13 @@
129129
(env-exec-config ["AllowReadInLocal"])
130130
(use dbtest)
131131
(expect-failure
132-
"write protected by admin key in local" "Keyset enforce failure"
132+
"write protected by admin key in local" "Keyset failure"
133133
(write persons "foo" ROW_A))
134134
(expect-failure
135-
"update protected by admin key in local" "Keyset enforce failure"
135+
"update protected by admin key in local" "Keyset failure"
136136
(update persons "foo" ROW_A))
137137
(expect-failure
138-
"insert protected by admin key in local" "Keyset enforce failure"
138+
"insert protected by admin key in local" "Keyset failure"
139139
(insert persons "foo" ROW_A))
140140
(expect
141141
"keys allowed in local" [ID_A]
@@ -165,7 +165,7 @@
165165
"keys allowed in local" [ID_A]
166166
(keys persons))
167167
(expect-failure
168-
"create-table protected by admin key in local" "Keyset enforce failure"
168+
"create-table protected by admin key in local" "Keyset failure"
169169
(create-table persons2))
170170

171171
;; test nested commits

pact-tests/pact-tests/marmalade

Submodule marmalade added at b6c1c20

0 commit comments

Comments
 (0)