def get_prepare_command(self): import bolilib obj_data = bolilib.SHIM_serialise_for_bolid(self.serialise()) # new superblocks won't have parent_hash, revision, etc... cmd = ['gobject', 'prepare', '0', '1', str(int(time.time())), obj_data] return cmd
def get_submit_command(self): import bolilib obj_data = bolilib.SHIM_serialise_for_bolid(self.serialise()) # new objects won't have parent_hash, revision, etc... cmd = ['gobject', 'submit', '0', '1', str(int(time.time())), obj_data] # some objects don't have a collateral tx to submit if not self.only_masternode_can_submit: cmd.append(go.object_fee_tx) return cmd
def get_submit_command(self): object_fee_tx = self.go.object_fee_tx import bolilib obj_data = bolilib.SHIM_serialise_for_bolid(self.serialise()) cmd = [ 'gobject', 'submit', '0', '1', str(int(time.time())), obj_data, object_fee_tx ] return cmd
def bolid_serialise(self): import bolilib return bolilib.SHIM_serialise_for_bolid(self.serialise())
def test_SHIM_serialise_for_bolid(sentinel_proposal_hex, sentinel_superblock_hex): assert bolilib.SHIM_serialise_for_bolid(sentinel_proposal_hex) == '5b5b2270726f706f73616c222c207b22656e645f65706f6368223a20313439313032323830302c20226e616d65223a2022626565722d7265696d62757273656d656e742d37222c20227061796d656e745f61646472657373223a2022795965384b77796155753559737753596d4233713372797838585455753979375569222c20227061796d656e745f616d6f756e74223a20372e30303030303030302c202273746172745f65706f6368223a20313438333235303430302c202274797065223a20312c202275726c223a202268747470733a2f2f6461736863656e7472616c2e636f6d2f626565722d7265696d62757273656d656e742d37227d5d5d' assert bolilib.SHIM_serialise_for_bolid(sentinel_superblock_hex) == '5b5b2274726967676572222c207b226576656e745f626c6f636b5f686569676874223a2036323530302c20227061796d656e745f616464726573736573223a2022795965384b77796155753559737753596d42337133727978385854557539793755697c795443363268755234595145506e39414a486a6e517878726548536267416f617456222c20227061796d656e745f616d6f756e7473223a2022357c33222c202274797065223a20327d5d5d'