def METHOD_NAME(self, node: TestNode, data, success: bool) -> None:
    tx = self.wallet.create_self_transfer(fee_rate=0)["tx"]
    data = [] if data is None else [data]
    tx.vout.append(CTxOut(nValue=0, scriptPubKey=CScript([OP_RETURN] + data)))
    tx.vout[0].nValue -= tx.get_vsize()  # simply pay 1sat/vbyte fee
    tx_hex = tx.serialize().hex()
    if success:
        self.wallet.sendrawtransaction(from_node=node, tx_hex=tx_hex)
        assert tx.rehash() in node.getrawmempool(True), f'{tx_hex} not in mempool'
    else:
        assert_raises_rpc_error(-26, "scriptpubkey", self.wallet.sendrawtransaction, from_node=node, tx_hex=tx_hex)