From ec65222fcf89eea13a856ed6e6a6e500e0171696 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Thu, 14 Dec 2023 13:43:41 -0600 Subject: [PATCH] GH-1510 bios contract has to be set so setfinalizer is available --- tests/TestHarness/Cluster.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/TestHarness/Cluster.py b/tests/TestHarness/Cluster.py index 2d37ba3a1f..dfe7d821ad 100644 --- a/tests/TestHarness/Cluster.py +++ b/tests/TestHarness/Cluster.py @@ -1156,6 +1156,19 @@ def createSystemAccount(accountName): # enable instant finality if activateIF: + # publish bios contract with setfinalizer + contract = "eosio.bios" + contractDir = str(self.libTestingContractsPath / contract) + wasmFile = "%s.wasm" % (contract) + abiFile = "%s.abi" % (contract) + Utils.Print("Publish %s contract" % (contract)) + trans = biosNode.publishContract(eosioAccount, contractDir, wasmFile, abiFile, waitForTransBlock=True) + if trans is None: + Utils.Print("ERROR: Failed to publish contract %s." % (contract)) + return None + Node.validateTransaction(trans) + + # call setfinalizer numFins = len(launcher.network.nodes.values()) setFinStr = f'{{"finalizer_policy": {{' setFinStr += f' "threshold": {int(numFins * 2 / 3 + 1)}, ' @@ -1167,7 +1180,7 @@ def createSystemAccount(accountName): if len(n.producers) == 0: continue setFinStr += f' {{"description": "finalizer #{finNum}", ' - setFinStr += f' "fweight":1, ' + setFinStr += f' "weight":1, ' setFinStr += f' "public_key": "{n.keys[0].blspubkey}", ' setFinStr += f' "pop": "{n.keys[0].blspop}"' setFinStr += f' }}'